This is the mail archive of the
libc-hacker@cygnus.com
mailing list for the glibc project.
Re: libio backward compat bug? involving setmntent()
- To: hjl@lucon.org (H.J. Lu)
- Subject: Re: libio backward compat bug? involving setmntent()
- From: Zack Weinberg <zack@rabi.columbia.edu>
- Date: Tue, 13 Apr 1999 11:16:20 -0400
- cc: libc-hacker@cygnus.com
On Tue, 13 Apr 1999 08:10:19 -0700 (PDT), H.J. Lu wrote:
>>
>> On Tue, 13 Apr 1999 07:48:56 -0700 (PDT), H.J. Lu wrote:
>> >>
>> >>
>> >> The appended slightly-out-of-spec code segfaults when compiled on a
>> >> libc 2.0 system and run on a libc 2.1 system. The problem is that
>> >> setmntent() returns a new FILE*, but fclose is bound to the old
>> >> fclose.
>> >>
>> >> Do we want to support this, and if so, how? (Have old fclose
>> >> recognize when it's handed a new FILE* and call _IO_new_fclose?)
>> >>
>> >
>> >Thanks for the bug report. I will fix it.
>>
>> Try this patch for size.
[...]
>I like this approach. But on the other hand, libio is used
>by both glibc and libstdc++. I am not sure introducing
>_IO_NEW_MAGIC is a good idea or not. As least, you may have
>to change libstdc++ to match it.
I was afraid of that. I did it this way because I wasn't sure if
there were other functions in libc that return FILE pointers. Without
this, we'd need versions for all of them.
zw