bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

isatty() and errno


From: Eric Blake
Subject: isatty() and errno
Date: Mon, 07 Nov 2011 16:18:32 -0700
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110928 Fedora/3.1.15-1.fc14 Lightning/1.0b3pre Mnenhy/0.8.4 Thunderbird/3.1.15

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 by glibc's implementation choice for isatty(), which ends up leaving errno unchanged when that code is compiled on Solaris.

But 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? Or should I just patch ptsname.c to guarantee that errno is set without relying on isatty() to do the job?

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

[Prev in Thread] Current Thread [Next in Thread]