Contents of /trunk/mkinitrd-magellan/klibc/usr/klibc/llseek.c
Parent Directory | Revision Log
Revision 532 -
(show annotations)
(download)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File MIME type: text/plain
File size: 689 byte(s)
Sat Sep 1 22:45:15 2007 UTC (17 years ago) by niro
File MIME type: text/plain
File size: 689 byte(s)
-import if magellan mkinitrd; it is a fork of redhats mkinitrd-5.0.8 with all magellan patches and features; deprecates magellan-src/mkinitrd
1 | /* |
2 | * llseek.c |
3 | * |
4 | * On 32-bit platforms, we need to use the _llseek() system call |
5 | * rather than lseek(), to be able to handle large disks. _llseek() |
6 | * isn't just a normal syscall which takes a 64-bit argument; it needs |
7 | * to return a 64-bit value and so takes an extra pointer. |
8 | */ |
9 | |
10 | #include <unistd.h> |
11 | #include <sys/syscall.h> |
12 | #include <bitsize.h> |
13 | |
14 | #if _BITSIZE == 32 |
15 | |
16 | extern int __llseek(int fd, unsigned long hi, unsigned long lo, off_t * res, |
17 | int whence); |
18 | |
19 | off_t lseek(int fd, off_t offset, int whence) |
20 | { |
21 | off_t result; |
22 | int rv; |
23 | |
24 | rv = __llseek(fd, (unsigned long)(offset >> 32), (unsigned long)offset, |
25 | &result, whence); |
26 | |
27 | return rv ? (off_t) - 1 : result; |
28 | } |
29 | |
30 | #endif |