chiark / gitweb /
[PATCH] added klibc version 0.82 (cvs tree) to the udev tree.
[elogind.git] / klibc / klibc / llseek.c
1 /*
2  * llseek.c
3  *
4  * On 32-bit platforms, we need llseek() as well as lseek() to be
5  * able to handle large disks
6  */
7
8 #include <unistd.h>
9 #include <sys/syscall.h>
10
11 #if BITSIZE == 32
12
13 static inline _syscall5(int, _llseek, int, fd, unsigned long, hi, unsigned long, lo, loff_t *,res, int, whence);
14
15 loff_t llseek(int fd, loff_t offset, int whence)
16 {
17   loff_t result;
18   int rv;
19
20   rv = _llseek(fd, (unsigned long)(offset >> 32),
21                 (unsigned long)offset, &result, whence);
22   
23   return rv ? (loff_t)-1 : result;
24 }
25
26 #else
27
28 loff_t llseek(int fd, loff_t offset, int whence)
29 {
30   return lseek(fd, offset, whence);
31 }
32
33 #endif
34