summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/common/tell.c
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/common/tell.c')
-rw-r--r--libc/sysdeps/linux/common/tell.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/common/tell.c b/libc/sysdeps/linux/common/tell.c
new file mode 100644
index 000000000..b58f3f944
--- /dev/null
+++ b/libc/sysdeps/linux/common/tell.c
@@ -0,0 +1,15 @@
+#define lseek __normal_lseek
+#include <unistd.h>
+#include <syscall.h>
+#undef lseek
+
+static inline
+_syscall3(off_t,lseek,int,fildes,off_t,offset,int,origin)
+
+off_t tell(int);
+
+off_t
+tell (int fildes)
+{
+ return lseek (fildes, 0, SEEK_CUR);
+}