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

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


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

Re: C99 freopen


Roland McGrath <roland@frob.com> writes:

> ISO C was defined in the context of the world we live in, where the
> prototypical underlying implementation is POSIX.  If the ISO C committee
> nowadays is populated by people who are so foolish as to think the standard
> can mandate wholly new functionality requiring deep changes in the ways
> that underlying systems have worked for decades, then this so-called
> "standard" is not one worth our attention.

Well, they say "shall attempt".

> Can someone please cite for us the actual ISO C specification and rationale
> text for this new behavior of freopen?  I am tired of arguing in the dark.

There is no rationale (I checked it).  This is the text:

   If filename is a null pointer, the freopen() function shall attempt
   to change the mode of the stream to that specified by mode, as if
   the name of the file currently associated with the stream had been
   used. It is implementation-defined which changes of mode are
   permitted (if any), and under what circumstances.

> It is obvious to anyone who has been involved in the C and POSIX world for
> any length of time that the only conceivable uses of this new addition that
> a reasonable C standard would contemplate are those that correspond on
> POSIX systems to reuse of the existing file descriptor.

Well, I don't see it this way.

-- 
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------


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