This is the mail archive of the libc-alpha@sourceware.org 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]
Other format: [Raw text]

Re: fdopendir


On Wed, Sep 28, 2005 at 03:38:51PM -0700, Ulrich Drepper wrote:
> Dmitry V. Levin wrote:
> > This implementation may close the descriptor passed to fdopendir(), e.g.
> > in case of fcntl() or malloc() failure.  In case of success, it will set
> > FD_CLOEXEC on this descriptor.  Both seems strange for me.
> 
> This is how it is documented on Solaris.  Once the descriptor is passed
> to the function nobody else can touch it again.

Indeed.  Their manpage says that "The directory file descriptor should not
be used or closed following a successful function call, as this might
cause undefined results from future operations on the directory stream
obtained from the call.  Use closedir(3C) to close a directory stream."

However, it doesn't answer the question what to do with this descriptor in
case of failure.  I guess that their implementation doesn't close it.


-- 
ldv

Attachment: pgp00000.pgp
Description: PGP signature


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