This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Re: Question on stdio standard behaviour (Bugreport libc/755)
- To: libc-hacker@cygnus.com
- Subject: Re: Question on stdio standard behaviour (Bugreport libc/755)
- From: Wolfram Gloger <wmglo@dent.med.uni-muenchen.de>
- Date: 25 Aug 1998 08:37:32 -0000
- References: <u8yasdy76r.fsf@arthur.rhein-neckar.de>
> we've received the appended bugreport. The essence is that "perl
> expects that fclose followed by fopen will return the same pointer".
> This works on most platforms but not with libc5 and glibc2.
Considering that FILE structures are allocated with malloc(), this is
a completely bogus assumption, IMHO. It boils down to the assumption
that ptr=malloc(size); ... ; free(ptr); ptr2=malloc(size); will always
yield ptr2==ptr. Only very simple mallocs do guarantee this, and it
will likely break down for multiple threads in any case.
It may be possible to fulfill the assumption if the FILE structures
for stdin/stdout/stderr are allocated statically, but I don't think it
is worth it....
Regards,
Wolfram.