summaryrefslogtreecommitdiff
path: root/src/unistd/ttyname_r.c
AgeCommit message (Collapse)AuthorFilesLines
2018-09-15improve error handling of ttyname_r and isattyBenjamin Peterson1-1/+1
POSIX allows ttyname(_r) and isatty to return EBADF if passed file descriptor is invalid. maintainer's note: these are optional ("may fail") errors, but it's non-conforming for ttyname_r to return ENOTTY when it failed for a different reason.
2018-09-12move and deduplicate declarations of __procfdname to make it checkableRich Felker1-2/+1
syscall.h was chosen as the header to declare it, since its intended usage is alongside syscalls as a fallback for operations the direct syscall does not support.
2017-04-21make ttyname[_r] return ENODEV rather than ENOENTRich Felker1-1/+1
commit 0a950dcf15bb9f7274c804dca490e9e20e475f3e added checking that the pathname a tty device was opened with actually matches the device, which can fail to hold when a container inherits a tty from outside the container. the error code added at the time was ENOENT; however, discussions between affected applications and glibc developers resulted in glibc adopting ENODEV as the error for this condition, and this has now been documented in the man pages project as well. adopt the same error code for consistency. patch by Christian Brauner.
2016-08-30verify that ttyname refers to the same file as the fdSzabolcs Nagy1-4/+11
linux containers use separate mount namespace so the /proc symlink might not point to the right device if the fd was opened in the parent namespace, in this case return ENOENT.
2013-12-12include cleanups: remove unused headers and add feature test macrosSzabolcs Nagy1-2/+0
2013-08-02debloat code that depends on /proc/self/fd/%d with shared functionRich Felker1-1/+3
I intend to add more Linux workarounds that depend on using these pathnames, and some of them will be in "syscall" functions that, from an anti-bloat standpoint, should not depend on the whole snprintf framework.
2012-09-06fix broken ttyname[_r] (failure to null-terminate result)Rich Felker1-1/+4
2011-02-12initial check-in, version 0.5.0v0.5.0Rich Felker1-0/+19