This is the mail archive of the libc-hacker@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Question on stdio standard behaviour (Bugreport libc/755)


> 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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]