This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/22145] ttyname() gives up too early in the face of namespaces
- From: "christian.brauner at mailbox dot org" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Wed, 11 Oct 2017 04:25:38 +0000
- Subject: [Bug libc/22145] ttyname() gives up too early in the face of namespaces
- Auto-submitted: auto-generated
- References: <bug-22145-131@http.sourceware.org/bugzilla/>
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.