freebsd-skq/lib/libc/gen
Xin LI 8dcb56dc78 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@
2005-05-13 16:27:30 +00:00
..
__xuname.c
_pthread_stubs.c Use newly added __used attribute to keep static function symbols from being 2004-07-29 18:07:08 +00:00
_rand48.c
_spinlock_stub.c
_thread_init.c
alarm.3
alarm.c
arc4random.3 The upper end of the range of arc4random(3) is 2**32-1, not 2**31-1. 2003-07-31 06:18:24 +00:00
arc4random.c Add locking so that arc4random(3) functions are all reentrant for 2004-03-24 14:44:57 +00:00
assert.c
basename.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
basename.c
check_utility_compat.3 Sort sections. 2005-01-20 09:17:07 +00:00
check_utility_compat.c
clock.3
clock.c
closedir.c
confstr.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
confstr.c
crypt.c
ctermid.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
ctermid.c
daemon.3 Remove ',' accidentally added after ".Xr fork 2". 2003-11-10 22:04:51 +00:00
daemon.c Prevent abnormal termination of a child daemon process when created 2003-11-10 22:01:42 +00:00
devname.3 Add an EXAMPLES section[1], quote Nd, and bump doc date. 2005-02-23 02:02:38 +00:00
devname.c Add devname_r(3) which takes a buffer as argument. 2003-06-20 09:52:27 +00:00
directory.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
dirname.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
dirname.c
disklabel.c
dladdr.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
dlfcn.c Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror) 2004-03-05 08:10:19 +00:00
dlfunc.c
dlinfo.3 Sort sections. 2005-01-20 09:17:07 +00:00
dllockinit.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
dlopen.3 Fix the ordering in the description of the dlsym() lookup procedure to 2004-06-03 10:13:26 +00:00
drand48.c
erand48.c
err.3 Mutually cross-reference sysexits(3) and err(3). Add text to err(3) 2004-10-04 14:04:37 +00:00
err.c
errlst.c Add some missing errnos from POSIX. Nothing in FreeBSD generates 2005-04-02 12:33:28 +00:00
errno.c
exec.3 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
exec.c Fixed some style bugs. 2003-07-01 12:30:03 +00:00
fmtcheck.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
fmtcheck.c Teach fmtcheck() about the ' (thousands separator) flag. 2005-03-21 08:00:55 +00:00
fmtmsg.3
fmtmsg.c
fnmatch.3 Remove claim of conformance to IEEE Std. 1003.2. Replace it with a list 2004-07-18 06:56:40 +00:00
fnmatch.c Remove unused variables and assignments. 2005-04-08 21:24:23 +00:00
fpclassify.3 - Move the functions presently described in in ieee(3) to their own 2005-01-27 05:46:17 +00:00
fpclassify.c Update my email address. 2005-02-06 03:23:31 +00:00
frexp.3 Document frexpl and ldexpl. 2005-03-07 05:00:54 +00:00
frexp.c Replace seven nominally MD implementations of frexp() that are broken 2004-07-18 21:23:39 +00:00
fstab.c
ftok.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
ftok.c Change the signature of ftok from (const char *, char) to (const char *, int) 2004-06-01 06:53:07 +00:00
fts-compat.c In fts_build(), if we try to chdir and fail (e.g. due to lack of search 2004-06-08 06:23:23 +00:00
fts-compat.h Introduce new field 'fts_bignum' which is 64bit long and will allow to 2005-01-07 00:06:20 +00:00
fts.3 Update manual page after adding 'fts_bignum' field. 2005-01-07 07:03:19 +00:00
fts.c In fts_build(), if we try to chdir and fail (e.g. due to lack of search 2004-06-08 06:23:23 +00:00
ftw.3 Fixed markup. 2004-07-07 20:11:35 +00:00
ftw.c Replace the current implementations of ftw() and nftw() with the OpenBSD 2004-08-24 13:00:55 +00:00
getbootfile.3 Sort sections. 2005-01-20 09:17:07 +00:00
getbootfile.c Include paths.h for prototype of getbootfile(3). 2005-05-03 15:28:07 +00:00
getbsize.3
getbsize.c
getcap.3 Expand contractions. 2005-02-13 23:45:54 +00:00
getcap.c
getcontext.3 Fix description: the argument to setcontext(3) must have been previously 2004-12-03 14:10:04 +00:00
getcwd.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
getcwd.c Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
getdiskbyname.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
getdomainname.3 Sort sections. 2005-01-20 09:17:07 +00:00
getdomainname.c
getfsent.3 Spelling fixes. 2004-06-21 19:30:45 +00:00
getgrent.3 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
getgrent.c getgrent() and friends should set errno if there is an error. 2004-05-17 22:15:49 +00:00
getgrouplist.3
getgrouplist.c Cleanup for getgrouplist(3): 2005-05-03 16:20:03 +00:00
gethostname.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
gethostname.c Add a kluge suggested by Marcel to paper over the difference between 2003-08-19 23:01:46 +00:00
getloadavg.3
getloadavg.c
getlogin.c Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
getmntinfo.3
getmntinfo.c
getnetgrent.3 Sort sections. 2005-01-20 09:17:07 +00:00
getnetgrent.c remember to reset nextgrp in getnetgrent(), so that subsequent calls to getnetgrent() doesn't return bogus information. 2005-01-13 18:33:01 +00:00
getobjformat.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
getobjformat.c
getosreldate.3
getosreldate.c
getpagesize.3
getpagesize.c
getpass.3
getpeereid.3
getpeereid.c
getprogname.3
getprogname.c
getpwent.3 Expand *n't contractions. 2005-02-13 22:25:33 +00:00
getpwent.c POSIX prohibits any library function from setting errno to 0. 2004-05-17 18:27:05 +00:00
getttyent.3 Fix the NAME section making whatis(1) happy in particular. 2004-07-05 17:12:53 +00:00
getttyent.c
getusershell.3 Fixed the misplaced $FreeBSD$. 2005-02-09 18:07:17 +00:00
getusershell.c
getvfsbyname.3
getvfsbyname.c Remove incomplete support for running FreeBSD userland on old NetBSD kernels 2003-10-29 10:45:01 +00:00
glob.3 Septepber -> September 2004-09-01 23:28:27 +00:00
glob.c Add support for multibyte characters. 2004-07-29 03:48:52 +00:00
initgroups.3
initgroups.c Fix problem where initgroups would silently truncate groups with 2003-11-19 15:51:26 +00:00
isatty.c
isgreater.3 Update my email address. 2005-02-06 03:23:31 +00:00
isinf.c Unbreak alpha: On alpha a long double is the same as a double and 2004-07-10 15:52:26 +00:00
isnan.c Remove __isnanl() to avoid conflicting with the same function in libm. 2004-09-24 06:33:22 +00:00
jrand48.c
lcong48.c
ldexp.3 Document frexpl and ldexpl. 2005-03-07 05:00:54 +00:00
ldexp.c Replace the ldexp() implementation in libc with a renamed copy of the 2005-01-22 06:03:40 +00:00
lockf.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
lockf.c
lrand48.c
makecontext.3
Makefile.inc Connect MLINKS for ttyname_r(3), and add prototype into unistd.h. 2005-05-11 14:07:25 +00:00
modf.3
mrand48.c
msgctl.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
msgget.3
msgrcv.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
msgsnd.3 Sort sections. 2005-01-20 09:17:07 +00:00
nftw.c Replace the current implementations of ftw() and nftw() with the OpenBSD 2004-08-24 13:00:55 +00:00
nice.3
nice.c
nlist.3
nlist.c
nrand48.c
opendir.c Avoid using void pointers in additive expressions. 2004-08-14 17:46:10 +00:00
pause.3
pause.c
pmadvise.c Add the POSIX 1003.1-2001 posix_madvise() interface. 2003-08-09 03:23:24 +00:00
popen.3 Sort sections. 2005-01-20 09:17:07 +00:00
popen.c
posixshm.c
pselect.3
pselect.c
psignal.3
psignal.c
pw_scan.c add missing endusershell() call. Original version was incorrect. 2004-01-18 21:33:25 +00:00
pw_scan.h
pwcache.3
pwcache.c
raise.3
raise.c Make raise and _raise as weak symbols, so they can be overriden by 2003-07-19 05:22:56 +00:00
rand48.3 Sort sections. 2005-01-20 09:17:07 +00:00
rand48.h
readdir.c
readpassphrase.3 Sort sections. 2005-01-20 09:17:07 +00:00
readpassphrase.c
rewinddir.c
rfork_thread.3
scandir.3
scandir.c
seed48.c
seekdir.c
sem_destroy.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem_getvalue.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem_init.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem_open.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem_post.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem_wait.3 Markup tidying. 2004-07-02 16:45:56 +00:00
sem.c Prevent memory leak on sem_destroy() by destroying the semaphore's 2004-02-06 15:15:44 +00:00
semctl.c
setdomainname.c
sethostname.c
setjmp.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
setjmperr.c
setmode.3
setmode.c Use prototypes in the function definitions. 2005-04-08 21:15:38 +00:00
setproctitle.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
setproctitle.c Don't segfault if setproctitle(3) is called with NULL initially. 2003-07-01 09:45:35 +00:00
setprogname.c
shm_open.3 Sort sections. 2005-01-20 09:17:07 +00:00
siginterrupt.3
siginterrupt.c
siglist.c
signal.3 Mark up SIGSTOP with .Dv and use .Nm in HISTORY for marking up `signal'. 2004-12-29 19:40:56 +00:00
signal.c
sigsetops.3 o The macro versions of sigemptyset(3), sigfillset(3), sigaddset(3), 2004-12-16 20:27:55 +00:00
sigsetops.c
sleep.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
sleep.c
srand48.c
statvfs.3
statvfs.c
stringlist.3 Expand contractions. 2005-02-13 23:45:54 +00:00
stringlist.c
strtofflags.3
strtofflags.c
swapcontext.c
sysconf.3 Sort sections. 2005-01-20 09:17:07 +00:00
sysconf.c
sysctl.3 Add a sysctl that returns the full path of a process' text file. 2005-04-18 02:10:37 +00:00
sysctl.c
sysctlbyname.c
sysctlnametomib.c
syslog.3 Add LOG_NTP facility. 2004-12-30 13:09:34 +00:00
syslog.c Use prototypes in the function definitions. 2005-04-08 21:15:38 +00:00
tcgetpgrp.3
tcsendbreak.3
tcsetattr.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
tcsetpgrp.3
telldir.c
telldir.h
termios.c
time.3 Sort sections. 2005-01-20 09:17:07 +00:00
time.c C99 compliance: time() always sets its return value in both places 2003-07-19 02:53:46 +00:00
times.3
times.c Make the returnvalue of times(3) insensitive to changes in wall-clock. 2005-03-08 08:12:35 +00:00
timezone.3
timezone.c
tls.c Use __weak_reference macro to define weak symbols. 2005-03-21 13:17:16 +00:00
ttyname.3 Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly 2005-05-13 16:27:30 +00:00
ttyname.c Provide more POSIX-complaint ttyname_r(3) interface[1], which is slightly 2005-05-13 16:27:30 +00:00
ttyslot.c
tzset.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
ualarm.3 Mechanically kill hard sentence breaks. 2004-07-02 23:52:20 +00:00
ualarm.c
ucontext.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
ulimit.3
ulimit.c
uname.3 mdoc(7): Use the new feature of the .In macro. 2003-09-08 19:57:22 +00:00
uname.c
unvis.3 Eliminate double whitespace. 2004-07-03 22:30:10 +00:00
unvis.c Remove an implicit int parameter by using prototypes. 2004-08-02 08:46:23 +00:00
usleep.3
usleep.c
utime.3 Sort sections. 2005-01-20 09:17:07 +00:00
utime.c
valloc.3
valloc.c
vis.3 Markup: convert a display to a list. 2005-01-15 11:40:33 +00:00
vis.c Add '#' to the characters VIS_GLOB encodes. This fixes a bug in mtree. 2003-10-30 12:41:50 +00:00
wait3.c
wait.c
waitpid.c
wordexp.3 Document incorrect handling of multibyte characters due to limitations 2004-07-28 15:43:33 +00:00
wordexp.c Fix typo: WRDE_DOOFS -> WRDE_DOOFFS. 2004-06-30 13:55:08 +00:00