Mail Archives: djgpp-workers/2001/04/04/14:33:25
According to Martin Stromberg:
> ; uname -a
> SunOS lws256 5.6 Generic_105181-23 sun4u sparc
> ; l c.c
> -rw-r----- 1 eplmst erisoft 466 Apr 4 16:44 c.c
> ; ./c
> 1, ftell(f) = 466.
> 2, ftell(f) = 0.
Linux:
nietzsche:/tmp> uname -a
Linux nietzsche 2.0.38 #3 Sat Apr 15 13:57:22 CEST 2000 i586 unknown
nietzsche:/tmp> ldd c
/lib/nfslock.so.0 => /lib/nfslock.so.0 (0x4000d000)
libc.so.6 => /lib/libc.so.6 (0x40012000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
nietzsche:/tmp> ./c
1, ftell(f) = 471.
2, ftell(f) = 471.
nietzsche:/tmp> ./d
1, lseek(fd, 0, SEEK_CUR) = 0.
fdopen failed, errno = 0.
After removing calls to fdopen():
nietzsche:/tmp> ./d
1, lseek(fd, 0, SEEK_CUR) = 0.
2, lseek(fd, 0, SEEK_CUR) = 0.
So in Linux fopen() seeks to the end and open does not.
Right,
MartinS
- Raw text -