summaryrefslogtreecommitdiff
path: root/src/stdio
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2019-07-16 18:31:33 -0400
committerRich Felker <dalias@aerifal.cx>2019-07-16 18:31:33 -0400
commit03919b26ed41c31876db41f7cee076ced4513fad (patch)
treebe592d50551a1ee8c600e35f5420e840e76a2f5c /src/stdio
parentb07d45eb01e900f0176894fdedab62285f5cb8be (diff)
downloadmusl-03919b26ed41c31876db41f7cee076ced4513fad.tar.gz
use namespace-safe __lseek for __stdio_seek instead of direct syscall
this probably saves a few bytes, avoids duplicating the clunky lseek/_llseek syscall convention in two places, and sets the stage for fixing broken seeks on x32 and mipsn32.
Diffstat (limited to 'src/stdio')
-rw-r--r--src/stdio/__stdio_seek.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/stdio/__stdio_seek.c b/src/stdio/__stdio_seek.c
index 13e06a66..326ab9bc 100644
--- a/src/stdio/__stdio_seek.c
+++ b/src/stdio/__stdio_seek.c
@@ -1,13 +1,7 @@
#include "stdio_impl.h"
+#include <unistd.h>
off_t __stdio_seek(FILE *f, off_t off, int whence)
{
- off_t ret;
-#ifdef SYS__llseek
- if (syscall(SYS__llseek, f->fd, off>>32, off, &ret, whence)<0)
- ret = -1;
-#else
- ret = syscall(SYS_lseek, f->fd, off, whence);
-#endif
- return ret;
+ return __lseek(f->fd, off, whence);
}