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 #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.

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