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: "lukeshu at sbcglobal dot net" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 10 Oct 2017 11:24:40 +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 #18 from Luke Shumaker <lukeshu at sbcglobal dot net> ---
In cleaning up my patchset, I went to update the manual, since I
figured ENODEV should be mentioned as a possible return value there.
And I'm left with a question:
Does `errno=ENODEV` really convey any more useful information than
`errno != EBADF && errno != ENOTTY`? It has already passed `isatty()`
(well `tcgetattr()`).
Prior to Serge & your change, name=NULL/errno=unchanged signaled "the
file descriptor is valid, and is associated with a terminal, but the
associated file name could not be determined". ENODEV is mostly that
same thing, but "is associated with a PTY", instead of a generic TTY.
Is that a meaningful distinction to make?
What about using ENODEV for all cases were the file descriptor is
valid, and is associated with a terminal, but the associated file name
could not be determined?
AFAICT, the only other cases where this can happen are if `/proc` and
`/dev` are not mounted/set-up as expected.
--
You are receiving this mail because:
You are on the CC list for the bug.