Commit Graph

4451 Commits

Author SHA1 Message Date
nectar
ebdf5cfddd The previous commit changed the behavior of nsdispatch() in the
case where an /etc/nsswitch.conf file was present, but could not
be opened (e.g. due to permissions).  Previously, the open failure
condition was suppressed, and the built-in defaults were used.  In
revision 1.11, however, propagated the open failure causing all
nsdispatch() invocations to return NS_UNAVAIL, and thus many APIs
including getpwnam and gethostbyname unconditionally failed.

This commit restores the previous behavior.

Pointy hat:	nectar  (+1 for obstinance; ache had to use clue bat)
Reported by:	ache
2004-04-01 19:12:45 +00:00
peter
aeb757d841 Fix Yet Another 16 byte stack alignment bug. Thankfully, this one is
solved by a simple 'make world'.  The signalcontext function was going
to the trouble of generating an even 16 byte alignment, but in fact it
needed to be odd aligned to simulate the 8-byte return address having
been pushed by the caller.  This fixes yet another group of crashes in
applications using libpthread.  And yet again, it was my fault all along.

While here, rename the duplicate internal ctx_wrapper() functions to
makectx_wrapper() and sigctx_wrapper() so that traces aren't ambiguous.
2004-03-31 07:27:31 +00:00
nectar
7ec3e33301 When a dynamic NSS module is built and linked against a thread
library, it may pull in that thread library at run time.  If the
process started out single-threaded, this could cause attempts to
release locks that do not exist.  Guard against this possibility by
checking __isthreaded before invoking thread primitives.

A similar problem remains if the process is linked against one thread
library, but the NSS module is linked against another.  This can only
be avoided by careful design of the NSS module.

Submitted by:	Sean McNeil <sean@mcneil.com> (mostly; bugs are mine)
2004-03-30 15:56:15 +00:00
tjr
1a32baef3b Add cross-references to isideogram(3), isphonogram(3), isrune(3),
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
tjr
0e393613f2 Add basic manual pages for isideogram(), isphonogram(), isrune()
and isspecial().
2004-03-30 07:23:54 +00:00
tjr
94fd478493 Trim cross-references. 2004-03-30 07:19:35 +00:00
tjr
9d08058845 Document the isnumber() and ishexnumber() functions, and explain how they
differ (at least in theory) from isdigit() and isxdigit().
2004-03-30 07:02:04 +00:00
tjr
8aa9f6fafe Remove duplicate MLINK. 2004-03-29 21:46:52 +00:00
tjr
9b0a927d71 Recognize the "rune" character class in wctype(). 2004-03-27 08:59:21 +00:00
bms
6fa18a5397 Document the existence of NET_RT_IFMALIST.
Reviewed by:	ru
2004-03-25 10:08:46 +00:00
ru
9e6098efd7 [troff] removed the unnecessary use of \_ escapes. 2004-03-25 09:25:24 +00:00
green
4927c84b48 Add locking so that arc4random(3) functions are all reentrant for
pthreads.

Submitted by:	Christian S.J. Peron <maneo@bsdpro.com>
2004-03-24 14:44:57 +00:00
tjr
f50e5eaa3b Document incorrect handling of multibyte characters. 2004-03-21 11:31:37 +00:00
tjr
023efa65f4 Mention that funopen() uses fpos_t incorrectly in the BUGS section. 2004-03-20 08:41:12 +00:00
tjr
55f1dd7399 Improve documentation for fgetpos() and fsetpos(), and discourage
users from assuming that fpos_t is an integral type.
2004-03-20 08:38:27 +00:00
dds
334e1c11e7 Shave-off troff cycles by invoking .Fa only once.
Submitted by:	ru
MFC after:	1 week
2004-03-19 16:04:11 +00:00
tjr
b893e6c496 Do not redundantly set the stream orientation in getc(), putc(), and
related functions - __sgetc() and __sputc() will set it when necessary.
2004-03-19 09:04:56 +00:00
tjr
41709fbe79 Update list of macros defined in <stdio.h>. 2004-03-17 12:54:06 +00:00
tjr
dab1ed1529 Re-add description of putc() macro (back out rev. 1.13.) 2004-03-17 12:46:17 +00:00
tjr
430cbeb954 Re-add text that says getc() is a macro (back out rev. 1.16.) 2004-03-17 12:37:28 +00:00
tjr
b4d98c6855 Re-add macro versions of getc(), getchar(), putc(), putchar(), feof(),
ferror(), fileno() and clearerr(), using the value of __isthreaded to
decide between the fast inline single-threaded code and the more
general function equivalent. This gives most of the performance
benefits of the old unsafe macros while preserving thread safety.
2004-03-17 01:43:08 +00:00
des
ce346529a3 Use unions to avoid violating C99 strict aliasing rules. 2004-03-16 20:42:02 +00:00
tjr
feae82b01a Refer to "wide characters" instead of "wide-characters". 2004-03-16 13:30:11 +00:00
tjr
d28b18f4b5 Sort MLINKS.
Noticed by:	ru
2004-03-16 11:06:31 +00:00
tjr
48661b2fa3 Add fairly minimal documentation for the nmount() syscall. 2004-03-16 09:45:38 +00:00
des
a52d3498dd Don't try to pass off a struct sockaddr as a struct sockaddr_in when it
may in fact very well be a struct sockaddr_in6.  Just use plain struct
sockaddr.

This brings us yet another step closer to a clean -O2 build.
2004-03-15 17:08:28 +00:00
truckman
8cf9e392b9 Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).
2004-03-15 10:32:37 +00:00
des
2d02e7d4d4 Make this compile with -O2. A proper fix would use a struct to represent
vectors, instead of requiring the caller to keep track of element size
and count and pass them in by reference.
2004-03-15 08:14:35 +00:00
des
243c5ae2b1 Whitespace nits. 2004-03-15 08:03:10 +00:00
tjr
00bce96751 Set stream orientation in ungetc() instead of __ungetc(). This avoids
setting it redundantly when called from ungetwc(), vfscanf() etc.,
which already set the orientation.
2004-03-10 12:41:11 +00:00
tjr
76708e58aa Remove duplicate check for EOF from ungetc(); __ungetc() already checks. 2004-03-10 11:13:23 +00:00
tjr
26739bcc23 Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().
2004-03-10 10:49:45 +00:00
tjr
d856ced836 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
tjr
c1542ae485 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
tjr
d27994efb7 Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
jb
c50fc65e96 Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
jb
e9062915d3 On 4.X it was possible for an application to initialise a local FILE
structure and call stdio functions. In 5.X this was broken when FILE
locking was introduced into libc.

This change makes most (relevant) stdio functions work again when the
_extra file in FILE isn't initialised (and can't be without a libc
function to do it since the __sFILEX structure is private to libc).
2004-03-09 02:44:59 +00:00
phk
a545780c51 Rearrange (centralize) initialization of mallocs internals to always be
done before the first call, even if this is a malloc(0) call.

PR:	62859
2004-03-07 20:41:27 +00:00
ache
ce8bd08be4 Merge some fixes from NetBSD's getopt.3 v1.31:
cleanup, add more sections, better explanation, declaration
2004-03-06 17:09:10 +00:00
ache
892e165566 Merge some fixes from NetBSD's getopt.c v1.26:
cleanups, handling 'ls -l-', handling '--*'

Note this is in the same time back out of our v1.3
"Don't print an error message if the bad option is '?'"
because it directly violates POSIX.
2004-03-06 17:05:45 +00:00
ache
5993cc3bce Fix typo, was 'W'; instead of `W;' 2004-03-06 14:47:49 +00:00
ache
c94e5bebf5 Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options
2004-03-06 14:24:10 +00:00
markm
0b0ae8e16e Make NULL a (void*)0 whereever possible, and fix the warnings(-Werror)
that this provokes. "Wherever possible" means "In the kernel OR NOT
C++" (implying C).

There are places where (void *) pointers are not valid, such as for
function pointers, but in the special case of (void *)0, agreement
settles on it being OK.

Most of the fixes were NULL where an integer zero was needed; many
of the fixes were NULL where ascii <nul> ('\0') was needed, and a
few were just "other".

Tested on: i386 sparc64
2004-03-05 08:10:19 +00:00
dds
91b0d17289 Document missing EFAULT errno value.
MFC after:	2 weeks
2004-03-03 14:51:11 +00:00
ache
6ec2ddd536 Make return code in noarg case GNU-compatible 2004-03-03 08:29:00 +00:00
ache
248096d10f Be more GNU-compatible in diagnostics 2004-03-03 03:05:21 +00:00
jkh
5a199c908b If handed a file pointer we can't write to, set errno properly to EBADF
in order to get SUSv2 conformant behavior in higher level calls like
fputs() and puts().

Reviewed by:	bde
2004-03-02 19:43:51 +00:00
grehan
da9e056b3c makecontext lib call.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
2004-03-02 06:22:24 +00:00
ache
7aeda997f8 Improve GNU compatibility in several places, use internal GNU_COMPATIBLE
define for it.
Don't catch POSIXLY_CORRECT env. into static variable, it can be changed
on the fly by program.
Use P1003.2 standartized illoptchar[]
2004-03-01 17:57:05 +00:00
ache
46a9b8739b Comment out things related to getopt() replacement we not use 2004-03-01 10:59:23 +00:00