On Sat, Apr 15, 2000 at 07:32:52PM +0100, Chris Lingard wrote:
>
> Stepped your program through gdb, hope this is of some use.
Thanks a lot.
> Breakpoint 2, main (argc=2, argv=0x1019ba0) at marcus.c:19
> 19 if (0 != fgetpos(f, &fpos)) {
> (gdb) step
> fgetpos (stream=0x80499d0, pos=0x1019b34) at fgetpos.c:31
> fgetpos.c: Read-only file system.
> (gdb) step
> fgetpos.c: Read-only file system.
> (gdb) step
> ftell (stream=0x80499d0) at ftell.c:28
> ftell.c: Read-only file system.
Where do those "<filename>: Read-only file system" come from? Is this an
auto display of some sort? I couldn't determine it from the script you sent.
If it is an auto display, it seems to imply that errno is EROFS before/when
entering fgetpos, and not changed while executing it. This could mean that
fgetpos runs correctly, and the errno value is bogus. However, why would
fgetpos return a value != 0?
It might be useful not to step through all the libc code, as this gets you
deeper and deeper into the code, probably before the interesting thing
happens, and messing up something on the way.
If you can, try to "next" through some of the deeper code to localize the
error. For example, what does __stdio_check_offset in ftell return? etc.
I will try to do some tests on my own when I get a chance. One could check
if ftell() returns EROFS as well, which is used by fgetpos.
Thanks,
Marcus
--
`Rhubarb is no Egyptian god.' Debian http://www.debian.org Check Key server
Marcus Brinkmann GNU http://www.gnu.org for public PGP Key
[EMAIL PROTECTED], [EMAIL PROTECTED] PGP Key ID 36E7CD09
http://homepage.ruhr-uni-bochum.de/Marcus.Brinkmann/ [EMAIL PROTECTED]