This is the mail archive of the newlib@sourceware.org mailing list for the newlib 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: errno.h: ESTRPIPE


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to DJ Delorie on 3/17/2009 3:31 PM:
> DJGPP says:
> 
>  ENMFILE -- No more files.  @code{findfirst} and @code{findnext} assign
>  this to @code{errno} when they exhaust the files in the directory.
>  @code{readdir} does that as well.
> 
> So, probably Cygwin-specific from newlib's point of view.  Compatible
> with Borland, I think.  Linux readdir() doesn't set errno when it runs
> out of entries, it just returns 0 instead of 1 (vs -1 for error).

Cygwin only uses ENMFILE internally; it should never be returned to the
user, since that would violate POSIX readdir(): "When the end of the
directory is encountered, a null pointer shall be returned and errno is
not changed."  Technically, cygwin should not have polluted the errno
namespace with this internal detail.  However, we can't remove it now, in
case existing code is compiled using that value.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             ebb9@byu.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAknAMlEACgkQ84KuGfSFAYCXsgCgijKF0wOVHSKCnwwfNiXzSrtg
0LgAoLnUiR0KO4XWbepbz2SEocjs0gaZ
=rf+u
-----END PGP SIGNATURE-----


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