blob: 0a5ed392bc03c231208933ff3c2376bcfcb5f3b3 [file] [log] [blame]
Rich Felker0b44a032011-02-12 00:22:29 -05001#include <unistd.h>
2#include "syscall.h"
3#include "libc.h"
4
5off_t lseek(int fd, off_t offset, int whence)
6{
Rich Felkerc2cd25b2011-04-06 20:32:53 -04007#ifdef SYS__llseek
Rich Felker2cdfb7c2011-02-13 22:45:42 -05008 off_t result;
Rich Felkeraa398f52011-03-20 00:16:43 -04009 return syscall(SYS__llseek, fd, offset>>32, offset, &result, whence) ? -1 : result;
Rich Felker2cdfb7c2011-02-13 22:45:42 -050010#else
Rich Felkeraa398f52011-03-20 00:16:43 -040011 return syscall(SYS_lseek, fd, offset, whence);
Rich Felker2cdfb7c2011-02-13 22:45:42 -050012#endif
Rich Felker0b44a032011-02-12 00:22:29 -050013}
14
15LFS64(lseek);