Hanske;Stefan writes:
> Here is what I get for a small llseek() test program using libc with
> _FILE_OFFSET_BITS=64:
> file = fopen("/dev/zero","r");
> offset = llseek(file, 0x1000, SEEK_SET);
> printf("The offset is: %lld.\n", offset);
>
> This is using gcc version 2.95.3 19991030 (prerelease)
Try compiling it with -Wall. You will get warnings. For starters,
llseek doesn't take a FILE * argument as the first parameter. Secondly,
it returns an "int".
Try:
file = fopen("/dev/zero", "r");
fseeko64(file, 0x1000ULL, SEEK_SET);
offset = ftello64(file);
printf("The offset is %lld.\n", offset);
That appears to work as expected. (Note that fseeko64 does not appear to
return the new file position, and, in addition you need to define
_LARGEFILE64_SOURCE).
_____
|_____| ------------------------------------------------- ---+---+-
| | Russell King [EMAIL PROTECTED] --- ---
| | | | http://www.arm.linux.org.uk/ / / |
| +-+-+ --- -+-
/ | THE developer of ARM Linux |+| /|\
/ | | | --- |
+-+-+ ------------------------------------------------- /\\\ |
unsubscribe: body of `unsubscribe linux-arm' to [EMAIL PROTECTED]
++ Please use [EMAIL PROTECTED] for ++
++ kernel-related discussions. ++