Re: isatty() and errno

2011-11-08 Thread Bruno Haible
Eric, > Sounds like an isatty-gnu module might be in order, then, which > guarantees errno behavior. Yes, I agree. Bruno -- In memoriam The inmates of the Daugavpils Ghetto

Re: isatty() and errno

2011-11-08 Thread Eric Blake
On 11/07/2011 04:52 PM, Eric Blake wrote: Yuck. Making ptsname_r wrap ptsname() makes it possible to avoid the isatty() non-errno on Solaris, but exposes a FreeBSD 8.2 bug that ptsname(-1) doesn't set errno. Alas, I can't call that a FreeBSD bug; just as with isatty and ttyname[_r], POSIX leav

Re: isatty() and errno

2011-11-08 Thread Eric Blake
On 11/08/2011 10:07 AM, Paul Eggert wrote: On 11/08/11 03:33, Bruno Haible wrote: The fact that isatty() always sets errno in glibc is undocumented: Amusingly enough, this *is* documented in the GNU/Linux man page :

Re: isatty() and errno

2011-11-08 Thread Paul Eggert
On 11/08/11 03:33, Bruno Haible wrote: > The fact that isatty() always sets errno in glibc is undocumented: Amusingly enough, this *is* documented in the GNU/Linux man page : isatty() returns 1 if fd is an open file desc

Re: isatty() and errno

2011-11-08 Thread Bruno Haible
Eric Blake wrote: > that means it is likely that other GNU code will assume isatty() > sets errno. Should we provide an isatty() module that guarantees that > errno will be set when returning 0? The fact that isatty() always sets errno in glibc is undocumented: -- Function: int isatty (int FI

RE : isatty() and errno

2011-11-07 Thread Bastien ROUCARIES
isatty should be pached under windows. Try isatty(/dev/null) Bastien Le 8 nov. 2011 00:53, "Eric Blake" a écrit : Our assumption in ptsname.c is that isatty() will set errno on invalid fds. But this is not required by POSIX, and indeed not enforced by Solaris 10; that is, our ptsname.c impleme

Re: isatty() and errno

2011-11-07 Thread Eric Blake
On 11/07/2011 04:18 PM, Eric Blake wrote: Our assumption in ptsname.c is that isatty() will set errno on invalid fds. But this is not required by POSIX, and indeed not enforced by Solaris 10; that is, our ptsname.c implementation was copied from glibc, and was making an assumption only guaranteed