2 * Sherlock Library -- Large File Support
4 * (c) 1999 Martin Mares, <mj@atrey.karlin.mff.cuni.cz>
7 #ifndef _SHERLOCK_LFS_H
8 #define _SHERLOCK_LFS_H
10 #ifdef SHERLOCK_CONFIG_LFS
13 #if defined(__linux__) && defined(__i386__)
14 #define O_LARGEFILE 0100000
16 #error O_LARGEFILE unknown
20 #define SHERLOCK_O_LARGEFILE O_LARGEFILE
24 /* A "do it yourself" solution */
26 #include <asm/unistd.h>
29 _syscall5(int, _llseek, int, fd, int, hi, int, lo, loff_t *, result, int, whence);
31 extern inline loff_t sh_seek(int fd, sh_off_t pos, int whence)
36 err = _llseek(fd, pos >> 32, pos, &result, whence);
37 return (err < 0) ? err : result;
41 /* Touching hidden places in glibc */
42 extern loff_t llseek(int fd, loff_t pos, int whence);
43 #define sh_seek(f,o,w) llseek(f,o,w)
47 #else /* !SHERLOCK_CONFIG_LFS */
49 #define sh_seek(f,o,w) lseek(f,o,w)
50 #define SHERLOCK_O_LARGEFILE 0
52 #endif /* !SHERLOCK_CONFIG_LFS */
53 #endif /* !_SHERLOCK_LFS_H */