I currently have a little battle involving seekC running in a 32-bit (x86) window.
In particular, I seem to be unable to look beyond the seemingly rather arbitrary file offset.
If I do this:
unsigned long long pos = 15032385535LLU;
int r = fseek(fd, pos, SEEK_SET);
then i will get
fstat64(3, {st_mode=S_IFREG|0644, st_size=1000000000000, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb77c3000
_llseek(3, 2147479552, [2147479552], SEEK_SET) = 0
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 4095) = 4095
TL DR is working.
However, if I increase posonly by 1 ...
unsigned long long pos = 15032385536LLU;
int r = fseek(fd, pos, SEEK_SET);
... then everything falls apart spectacularly:
fstat64(3, {st_mode=S_IFREG|0644, st_size=1000000000000, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xb771e000
_llseek(3, 18446744071562067968, 0xbfd0f5f8, SEEK_SET) = -1 EINVAL (Invalid argument)
I completely lost why. What am I doing wrong?
The only significant tidbits that I can come up with are that 15032385535there is 37FFFFFFFone that seems interesting, as well as the fact that the number seems to be related to a temporary reduction .
-D_FILE_OFFSET_BITS=64, , , , , , . -DLARGEFILES -D_LARGEFILE_SOURCE , , , .
( ): truncate, 32- (); - - , , -, Range: . nginx Perl. ( Slackware - ), Python SimpleHTTPServer , thttpd mmap-. ...