summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2005-05-13 16:27:30 +0000
committerdelphij <delphij@FreeBSD.org>2005-05-13 16:27:30 +0000
commit4c5083a81ce14f96f4193b746c54f7e17d94e21b (patch)
tree4f6f760d66637df39c7d6d860807b7c5aeb6bf2e /include
parent1a9b6b826f2931676b4a4a507bd8120dee017699 (diff)
downloadFreeBSD-src-4c5083a81ce14f96f4193b746c54f7e17d94e21b.zip
FreeBSD-src-4c5083a81ce14f96f4193b746c54f7e17d94e21b.tar.gz
Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly
different from what has been offered in libc_r (the one spotted in the original PR which is found in libthr has already been removed by David's commit, which is rev. 1.44 of lib/libthr/thread/thr_private.h): - Use POSIX standard prototype for ttyname_r, which is, int ttyname_r(int, char *, size_t); Instead of: char *ttyname_r(int, char *, size_t); This is to conform IEEE Std 1003.1, 2004 Edition [1]. - Since we need to use standard errno for return code, include errno.h in ttyname.c - Update ttyname(3) implementation according to reflect the API change. - Document new ttyname_r(3) behavior - Since we already make use of a thread local storage for ttyname(3), remove the BUGS section. - Remove conflicting ttyname_r related declarations found in libc_r. Hopefully this change should not have changed the API/ABI, as the ttyname_r symbol was never introduced before the last unistd.h change which happens a couple of days before. [1] http://www.opengroup.org/onlinepubs/009695399/functions/ttyname.html Requested by: Tom McLaughlin <tmclaugh sdf lonestar org> Through PR: threads/76938 Patched by: Craig Rodrigues <rodrigc crodrigues org> (with minor changes) Prompted by: mezz@
Diffstat (limited to 'include')
-rw-r--r--include/unistd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/unistd.h b/include/unistd.h
index c56fb4f..9bc7af7 100644
--- a/include/unistd.h
+++ b/include/unistd.h
@@ -365,7 +365,7 @@ long sysconf(int);
pid_t tcgetpgrp(int);
int tcsetpgrp(int, pid_t);
char *ttyname(int);
-char *ttyname_r(int, char *, size_t);
+int ttyname_r(int, char *, size_t);
int unlink(const char *);
ssize_t write(int, const void *, size_t);
OpenPOWER on IntegriCloud