This is the mail archive of the glibc-bugs@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]

[Bug libc/22145] ttyname() gives up too early in the face of namespaces


https://sourceware.org/bugzilla/show_bug.cgi?id=22145

--- Comment #21 from Christian Brauner <christian.brauner at mailbox dot org> ---
(In reply to Luke Shumaker from comment #20)
> > While POSIX does explicitly allow for this case I prefer setting
> > errno to a meaningful value on error. I don't like conveying
> > information implicitly be it in the error or success case. That's
> > best left for cocktail parties in the Oxford common room. :)
> 
> It actually doesn't; if isatty(FD) is true, then ttyname(FD) isn't
> allowed to fail according to POSIX.  The behavior I described is just
> what glibc did :)

No, I just meant that POSIX - or the C standard - says it's perfectly fine for
a function to return an error code but leave errno unchanged. Which for me
should always be the ultima ratio, i.e. when setting errno to anything would be
more confusing than not setting it. But we digress...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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