X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstdio%2F__stdio_seek.c;h=326ab9bce48ed38f5f56e059b9312efb0328acbe;hb=68c983919ecfa75a8216d93b85baaefcb7b6e51c;hp=35ae788cd1aface51136b4d53ffa6e493e98a37d;hpb=e3cd6c5c265cd481db6e0c5b529855d99f0bda30;p=musl diff --git a/src/stdio/__stdio_seek.c b/src/stdio/__stdio_seek.c index 35ae788c..326ab9bc 100644 --- a/src/stdio/__stdio_seek.c +++ b/src/stdio/__stdio_seek.c @@ -1,21 +1,7 @@ #include "stdio_impl.h" - -static off_t retneg1(FILE *f, off_t off, int whence) -{ - errno = ESPIPE; - return -1; -} +#include 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 - /* Detect unseekable files and optimize future failures out */ - if (ret < 0 && errno == ESPIPE) f->seek = retneg1; - return ret; + return __lseek(f->fd, off, whence); }