Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 1 | #include <unistd.h> |
| 2 | #include "syscall.h" |
| 3 | #include "libc.h" |
| 4 | |
| 5 | off_t lseek(int fd, off_t offset, int whence) |
| 6 | { |
Rich Felker | c2cd25b | 2011-04-06 20:32:53 -0400 | [diff] [blame] | 7 | #ifdef SYS__llseek |
Rich Felker | 2cdfb7c | 2011-02-13 22:45:42 -0500 | [diff] [blame] | 8 | off_t result; |
Rich Felker | aa398f5 | 2011-03-20 00:16:43 -0400 | [diff] [blame] | 9 | return syscall(SYS__llseek, fd, offset>>32, offset, &result, whence) ? -1 : result; |
Rich Felker | 2cdfb7c | 2011-02-13 22:45:42 -0500 | [diff] [blame] | 10 | #else |
Rich Felker | aa398f5 | 2011-03-20 00:16:43 -0400 | [diff] [blame] | 11 | return syscall(SYS_lseek, fd, offset, whence); |
Rich Felker | 2cdfb7c | 2011-02-13 22:45:42 -0500 | [diff] [blame] | 12 | #endif |
Rich Felker | 0b44a03 | 2011-02-12 00:22:29 -0500 | [diff] [blame] | 13 | } |
| 14 | |
| 15 | LFS64(lseek); |