--- /dev/null
+/*
+ * fgetpos.c
+ *
+ * Christian Groessler, 07-Aug-2000
+ */
+
+
+#include <stdio.h>
+
+
+int fgetpos(FILE* f, fpos_t *pos)
+{
+ *pos = ftell (f);
+
+ if (*pos != -1)
+ return 0;
+ return 1;
+}
+
--- /dev/null
+/*
+ * fseek.c
+ *
+ * Christian Groessler, 07-Aug-2000
+ */
+
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include "_file.h"
+
+
+int fseek(FILE* f, long offset, int whence)
+{
+ long res;
+
+ /* Is the file open? */
+ if ((f->f_flags & _FOPEN) == 0) {
+ _errno = EINVAL; /* File not open */
+ return 1;
+ }
+
+ res = lseek(f->f_fd, offset, whence);
+ if (res == -1L) return 1;
+ return 0;
+}
+
--- /dev/null
+/*
+ * fsetpos.c
+ *
+ * Christian Groessler, 07-Aug-2000
+ */
+
+
+#include <stdio.h>
+
+
+int fsetpos(FILE* f, const fpos_t *pos)
+{
+ return fseek (f, (fpos_t)*pos, SEEK_SET);
+}
+
--- /dev/null
+/*
+ * ftell.c
+ *
+ * Christian Groessler, 07-Aug-2000
+ */
+
+
+#include <stdio.h>
+#include <errno.h>
+#include <fcntl.h>
+#include "_file.h"
+
+
+long ftell(FILE* f)
+{
+ long pos;
+
+ /* Is the file open? */
+ if ((f->f_flags & _FOPEN) == 0) {
+ _errno = EINVAL; /* File not open */
+ return -1L;
+ }
+
+ pos = lseek(f->f_fd, 0L, SEEK_CUR);
+ return pos; /* -1 for error, comes from lseek() */
+}
+