Commit Graph

4584 Commits

Author SHA1 Message Date
David E. O'Brien
253f85d3c9 Remove bogus FBSDID. 2004-05-02 20:13:29 +00:00
David E. O'Brien
af15264014 Fix damaged FBSDID. 2004-05-02 20:09:14 +00:00
David Schultz
30d3088041 Merge vfscanf.c, v1.37:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
2004-05-02 10:56:26 +00:00
David Schultz
ce2551ad29 Merge vfprintf.c, v1.65:
- s/#ifdef FLOATING_POINT/#ifndef NO_FLOATING_POINT/
- Remove HEXFLOAT
2004-05-02 10:56:17 +00:00
David Schultz
757edc654e Add option NO_FP_LIBC, which disables floating-point support in
*printf() and *scanf().  Currently, this reduces the size of libc.so
by 9K on i386.  But the real savings are for static binaries that use
*printf() or *scanf() but not strtod(); with an FP-disabled libc,
these binaries will not depend on the gdtoa routines, making each
binary about 22K smaller.
2004-05-02 10:55:07 +00:00
David Schultz
8de9e89719 - To make it easier to compile *printf() and *scanf() without
floating-point support, remove default definition of FLOATING_POINT
  from the source, and change the compile-time option to
  NO_FLOATING_POINT.
- Remove the HEXFLOAT option.  It saves an insignificant amount of
  space (<0.1% of the size of libc on i386) and complicates vfprintf()
  and checkfmt().
2004-05-02 10:55:06 +00:00
David Schultz
38d17374b2 When *printf() and *scanf() are compiled without floating-point
support, fmtcheck() should not accept format strings that contain
floating-point formats.
2004-05-02 10:55:05 +00:00
Ruslan Ermilov
d1ec91e353 Markup nit. 2004-04-27 09:18:49 +00:00
Andrey A. Chernov
28aec5a68c Rewrite split_lines() to operate safely
PR:             62694
Submitted by:   moulin p <moulin.p@calyopea.com>
2004-04-25 19:56:50 +00:00
Tim J. Robbins
ccc8c6c31f Use the correct size to allocate, copy and clear argument type tables
after their change from an array of char to an array of enum.
This fixes problems that occurred when using positional arguments in
format strings, particularly with more than STATIC_ARG_TBL_SIZE (8)
of them.

PR:		65841
Submitted by:	Steven Smith (mostly)
2004-04-22 11:35:12 +00:00
Jonathan Chen
dbb4b1c83d Fix a bug that could result in getpw*() incorrectly returning NULL when NIS
adjunct maps are used.  One symtom of this bug is sshd saying:
	login_get_lastlog: Cannot find account for uid X
when logging in.  The problem here is caused by an incorrect reuse of the rv
variable when previous values are needed later.
2004-04-21 21:15:08 +00:00
Ruslan Ermilov
2d695ed31d Unbreak world. 2004-04-21 09:50:52 +00:00
Nate Lawson
1cc11684ac MFdragonfly: resolver fix for timeouts on unqualified hostnames
res_search only incremented got_servfail for h_errno == TRY_AGAIN *AND*
  hp->rcode == SERVFAIL.  However, there are cases such as timeouts where
  rcode is not always set to SERVFAIL.  This leads to inconsistent nameserver
  operation during multi-domain and truncated dot searches, especially during
  booting when portions of the network are being brought up simultanious with
  dns lookups.

  This patch attempts to correct the problem by unconditionally terminating
  the search if TRY_AGAIN is returned (after res_query has gone through all
  retries and name servers) instead of trying other domain elements in the
  domain seach path.

  This patch should fix reported problems (which I can reproduce) with some
  NFS mounts failing during boot.  This occured because mount_nfs thought the
  host name lookup returned a definitive failure using a non-dotted host name
  when, in fact, it timed out on the first part (host.search.domain.name) and
  got a definitive host-not-found response on the second part (host.).

  Generally speaking, search path name server timeouts can exceed 60 seconds
  per element and most machines which consistently timeout on earlier portions
  of a search path are effectively non-operational due to the imposed delays.
  It is more important for DNS lookups to return the proper error code then
  to be able to recover a valid lookup in later portions of the search path
  in these situations.

Obtained from:	DragonFly
MFC after:	3 weeks
2004-04-21 00:56:38 +00:00
Colin Percival
3b38d66be6 Add mention of the fact that timeouts are silently limited to 24 hours.
Observed by:	jmg
2004-04-20 21:07:43 +00:00
Colin Percival
b6f7c57ecf Document POSIX stupidity: Attempts to mmap zero bytes will succeed (and
have no effect), while attempts to munmap zero bytes will fail.
2004-04-18 23:36:45 +00:00
Christian Brueffer
e2738131b1 Bring describtion of a sysctl in line with the source:
kern.acct_chkfreq is specified in seconds, not minutes.

Cluebat provided by:	kensmith
2004-04-16 22:53:51 +00:00
Christian Brueffer
0d5d3ffdb7 Remove unnecessary .Pp macro and bump document date
Submitted by:	ru
2004-04-16 22:38:54 +00:00
Christian Brueffer
e8490b5cb4 List some sysctl variables that influence accounting
PR:		65070
Submitted by:	Marc Silver <marcs@draenor.org>
X-MFC after:	re approval
2004-04-16 20:32:56 +00:00
Tim J. Robbins
fc813796d2 Perform some basic validation of multibyte conversion state objects. 2004-04-12 13:09:18 +00:00
Tim J. Robbins
c282a0a1ed Remove a nonsensical remark about byte order markers in UTF-8 streams. 2004-04-12 12:58:41 +00:00
Maxime Henrion
4af6b50978 Belatedly remove the getvfsent(3) API. All the consumers have been
updated to use getvfsbyname(3) or the vfs.conflist sysctl since a
long time, except mount_smbfs(8) which has just been fixed.
2004-04-11 21:36:31 +00:00
Tim J. Robbins
78c4a3f225 Document the meaning of the zero return value. 2004-04-11 05:19:19 +00:00
David Xu
6464650388 Fix a typo. I was locked out for two days from my machine. 2004-04-10 14:36:57 +00:00
Tim J. Robbins
fa02ee78c8 Don't cast away const qualifiers.
Spotted by:	bde
2004-04-10 00:27:52 +00:00
Tim J. Robbins
7937c23d49 Terminate execl()'s argument list with a null pointer instead of a
null pointer constant. (The latter may be an integer constant, which
is not correct here.)

Submitted by:	Stefan Farfeleder
2004-04-09 11:32:32 +00:00
Tim J. Robbins
8b8109275c Update manual pages for change to C99 mbrtowc() semantics. 2004-04-08 09:59:02 +00:00
Tim J. Robbins
ca2dae426e Allow partial multibyte characters to accumulate in conversion state
objects passed to mbrtowc(), mbsrtowcs(), and mbrlen(), as required
by C99.
2004-04-07 10:48:19 +00:00
Tim J. Robbins
93996f6d58 Prepare to handle trivial state-dependent encodings. Full support for
state-dependent encodings with locking shifts will come later if there
is demand for it.
2004-04-07 09:55:05 +00:00
Tim J. Robbins
e97e856274 Begin conversions for sgetrune() and sputrune() in the initial
conversion state.
2004-04-07 09:49:10 +00:00
Tim J. Robbins
dc763237da Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-07 09:47:56 +00:00
Tim J. Robbins
ed870c6a8e Begin in the initial shift state in mbstowcs() and wcstombs().
(This change is non-functional since nothing uses states yet.)
2004-04-07 08:33:23 +00:00
Tim J. Robbins
74f90def09 Prepare to handle state-dependent encodings. This mainly involves not
taking shortcuts when it comes to storing and passing around conversion
states.
2004-04-06 13:14:03 +00:00
Pierre Beyssac
54846c9ff0 Add a missing "*errp = h_errno" forgotten in rev 1.36. 2004-04-06 09:31:22 +00:00
Doug Rabson
0128d11082 Update .Dd value.
Reminded by: ru
2004-04-06 09:06:45 +00:00
Pierre Beyssac
e651d83aa3 Fix _dns_ghbyname() to return NS_TRYAGAIN instead of NS_NOTFOUND
on temporary nameserver failure. This is necessary to get
getipnodebyname(3) to correctly return h_errno=TRY_AGAIN instead
of HOST_NOT_FOUND.

Reviewed by:	green, thomas
MFC after:	1 week
2004-04-05 20:18:48 +00:00
Doug Rabson
8aca967c58 Document lgetfh(2). 2004-04-05 10:17:56 +00:00
Tim J. Robbins
4fb9e805dc Remove support for emulating mbrtowc() and wcrtomb() in terms of the
old rune interface now that it is no longer needed.
2004-04-04 11:31:29 +00:00
Tim J. Robbins
4f6d4aa30d Reimplement the GB18030 encoding method using the new-style (mbrtowc()/
wcrtomb()) interface.
2004-04-04 11:00:42 +00:00
Tim J. Robbins
54c61797df Reimplement the deprecated UTF2 encoding method using the UTF-8 code
as a base. mbrtowc() and wcrtomb() are now implemented directly
instead of being emulatedi with sgetrune() and sputrune().
2004-04-04 10:49:45 +00:00
Andrey A. Chernov
f853699a55 Simplify one condition in prev. commit:
short_too already assumes FLAG_LONGONLY
2004-04-01 22:32:28 +00:00
Andrey A. Chernov
ed4fbbd5e3 Fix parsing of ambiguous options, whole loop must be processed 2004-04-01 22:09:07 +00:00
Jacques Vidrine
8074e24dce 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 Wemm
3726033348 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
Jacques Vidrine
a03fd3b656 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
Tim J. Robbins
6de4bcc717 Add cross-references to isideogram(3), isphonogram(3), isrune(3),
isspecial(3) and wctype(3).
2004-03-30 08:11:57 +00:00
Tim J. Robbins
32d9553d83 Add basic manual pages for isideogram(), isphonogram(), isrune()
and isspecial().
2004-03-30 07:23:54 +00:00
Tim J. Robbins
bee1de57ca Trim cross-references. 2004-03-30 07:19:35 +00:00
Tim J. Robbins
ba6699086d 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
Tim J. Robbins
ab02b93f75 Remove duplicate MLINK. 2004-03-29 21:46:52 +00:00
Tim J. Robbins
97062607cd Recognize the "rune" character class in wctype(). 2004-03-27 08:59:21 +00:00
Bruce M Simpson
3b367e998f Document the existence of NET_RT_IFMALIST.
Reviewed by:	ru
2004-03-25 10:08:46 +00:00
Ruslan Ermilov
f8a89f622e [troff] removed the unnecessary use of \_ escapes. 2004-03-25 09:25:24 +00:00
Brian Feldman
5295209eff 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
Tim J. Robbins
8e6b7161d3 Document incorrect handling of multibyte characters. 2004-03-21 11:31:37 +00:00
Tim J. Robbins
6eb5892c2b Mention that funopen() uses fpos_t incorrectly in the BUGS section. 2004-03-20 08:41:12 +00:00
Tim J. Robbins
1e709c9cb5 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
Diomidis Spinellis
78a5f747c9 Shave-off troff cycles by invoking .Fa only once.
Submitted by:	ru
MFC after:	1 week
2004-03-19 16:04:11 +00:00
Tim J. Robbins
f639538c20 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
Tim J. Robbins
3236e08bf8 Update list of macros defined in <stdio.h>. 2004-03-17 12:54:06 +00:00
Tim J. Robbins
7a0fae27c9 Re-add description of putc() macro (back out rev. 1.13.) 2004-03-17 12:46:17 +00:00
Tim J. Robbins
0ac162b7cc Re-add text that says getc() is a macro (back out rev. 1.16.) 2004-03-17 12:37:28 +00:00
Tim J. Robbins
567d74a5ec 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
Dag-Erling Smørgrav
261e614637 Use unions to avoid violating C99 strict aliasing rules. 2004-03-16 20:42:02 +00:00
Tim J. Robbins
34d72a66ad Refer to "wide characters" instead of "wide-characters". 2004-03-16 13:30:11 +00:00
Tim J. Robbins
36fa8d519c Sort MLINKS.
Noticed by:	ru
2004-03-16 11:06:31 +00:00
Tim J. Robbins
be0f84026d Add fairly minimal documentation for the nmount() syscall. 2004-03-16 09:45:38 +00:00
Dag-Erling Smørgrav
5b3ce02186 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
Don Lewis
c947dc059b Document additional reasons that sysctl(3) can return ENOMEM (due to
vslock() failure).
2004-03-15 10:32:37 +00:00
Dag-Erling Smørgrav
4705e3da6a 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
Dag-Erling Smørgrav
2fb05f85d5 Whitespace nits. 2004-03-15 08:03:10 +00:00
Tim J. Robbins
85fa6736d8 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
Tim J. Robbins
4124f7c013 Remove duplicate check for EOF from ungetc(); __ungetc() already checks. 2004-03-10 11:13:23 +00:00
Tim J. Robbins
a6a9f0cde3 Call __sputc() directly in fputc() instead of taking an expensive
detour through putc().
2004-03-10 10:49:45 +00:00
Tim J. Robbins
2df1baf643 Call __sgetc() directly in getchar() instead of taking an expensive
detour through getc().
2004-03-10 10:24:15 +00:00
Tim J. Robbins
87a6c90a99 Set the stream orientation explicitly in fgetln() instead of relying on
__srefill() to do it.
2004-03-10 09:28:38 +00:00
Tim J. Robbins
d17235e59f Set stream orientation in puts(). 2004-03-10 09:15:38 +00:00
John Birrell
44fce14365 Backout the previous revision due to objections. 2004-03-09 04:51:58 +00:00
John Birrell
59fac1825f 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
Poul-Henning Kamp
7594cde032 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
Andrey A. Chernov
05cfdd0995 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
Andrey A. Chernov
9109761318 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
Andrey A. Chernov
64f37911f8 Fix typo, was 'W'; instead of `W;' 2004-03-06 14:47:49 +00:00
Andrey A. Chernov
3700175bf1 Make GNU-compatible following case:
single '-' in command line and '-' (non-first) in options
2004-03-06 14:24:10 +00:00
Mark Murray
16fc3635f7 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
Diomidis Spinellis
5eb48ad91e Document missing EFAULT errno value.
MFC after:	2 weeks
2004-03-03 14:51:11 +00:00
Andrey A. Chernov
8848539902 Make return code in noarg case GNU-compatible 2004-03-03 08:29:00 +00:00
Andrey A. Chernov
9f06a99edd Be more GNU-compatible in diagnostics 2004-03-03 03:05:21 +00:00
Jordan K. Hubbard
1b629e865e 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
Peter Grehan
57df12f6c4 makecontext lib call.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
2004-03-02 06:22:24 +00:00
Andrey A. Chernov
f2fd86b76e 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
Andrey A. Chernov
2298a6e766 Comment out things related to getopt() replacement we not use 2004-03-01 10:59:23 +00:00
Andrey A. Chernov
8a4dd785c0 Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.
2004-03-01 10:12:45 +00:00
Andrey A. Chernov
ee43cb7a22 Change "-"-started options when POSIX_CORRECTLY is set handling
in favour of GNU instead of NetBSD, because configure's use us and
expect GNU.
2004-03-01 10:03:34 +00:00
Diomidis Spinellis
3f0a01ea87 Make consistent with the better written wcsrtombs function:
- Fix syntax
- Remove the (slightly wrong) duplicate explanation of the error condition
- Change reference to invalid multibyte character into invalid wide character
2004-02-27 15:03:22 +00:00
Brian Feldman
33dee81933 Make the resolver(3) and many associated interfaces much more reentrant.
The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now
with what should be totally reentrant, and h_errno values will now
be preserved correctly, but this does not affect interfaces such as
gethostbyname(3) which are still mostly non-reentrant.

In all of these relevant functions, the thread-safety has been pushed
down as far as it seems possible right now.  This means that operations
that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected
still under global locks that getaddrinfo(3) defines, but where possible
the locking is greatly reduced.  The most noticeable improvement is
that multiple DNS lookups can now be run at the same time, and this
shows major improvement in performance of DNS-lookup threaded programs,
and solves the "Mozilla tab serialization" problem.

No single-threaded applications need to be recompiled.  Multi-threaded
applications that reference "_res" to change resolver(3) options will
need to be recompiled, and ones which reference "h_errno" will also
if they desire the correct h_errno values.  If the applications already
understood that _res and h_errno were not thread-safe and had their own
locking, they will see no performance improvement but will not
actually break in any way.

Please note that when NSS modules are used, or when nsdispatch(3)
defaults to adding any lookups of its own to the individual libc
_nsdispatch() calls, those MUST be reentrant as well.
2004-02-25 21:03:46 +00:00
Andrey A. Chernov
829a229d88 Add getopt_long_only() from OpenBSD and other OpenBSD cleanups
PR:             63173
Submitted by:   Marius Strobl <marius@alchemy.franken.de>
2004-02-24 08:07:26 +00:00
Brian Feldman
7ce21b2023 Apply style(9).
Submitted by:	"Christian S.J. Peron" <maneo@bsdpro.com>
PR:		bin/63283
2004-02-23 20:42:03 +00:00
Josef El-Rayes
474f8512ae Add signal numbers to signal(3).
Approved by:    simon(mentor)
Reviewed by:    ru
Submitted by:   Stefan Farfeleder <stefan@fafoe.narf.at>
PR:             docs/60044
2004-02-23 13:20:03 +00:00
Andrey A. Chernov
75207c7a43 Add optarg, optind, opterr, optopt, optreset to SYNOPSYS 2004-02-23 05:07:11 +00:00
Andrey A. Chernov
60fb481f43 POSIX clearly states that getsubopt() should be declared in <stdlib.h>
not in <unistd.h>
2004-02-23 03:32:10 +00:00
Andrey A. Chernov
f0d82b33be Remove unneccessary <unistd.h> 2004-02-23 03:30:02 +00:00
Peter Wemm
efbef97de9 Change the syscall stub branch orders so that the static branch prediction
will assume that syscalls will succeed rather than fail.
2004-02-22 02:11:39 +00:00
Poul-Henning Kamp
1b105d0c6e Remove the triplicity in the public functions by vectoring them all
through a realloc like function.

Make the malloc_active variable a local static to this new function.

Don't warn about recursion more than once per base call.

constify malloc_func.
2004-02-21 09:14:38 +00:00
Poul-Henning Kamp
1044082184 Move the check for sensitive processes to the point where the exception
has been hit, this makes it cover more cases.

Call the message function directly rather than fiddle with flag-saving
when we find an unknown character in our options.

The 'A' flag should not trigger on legal out of memory conditions.
2004-02-21 08:55:38 +00:00
Hajimu UMEMOTO
b8b31f33b1 add destination address selection support for getipnodebyname(3).
though getipnodebyname(3) is obsoleted api, some major applications
such as Mozilla are still using it.  so, it will help ipv4 users.
2004-02-20 17:59:33 +00:00
Ruslan Ermilov
f3b6219857 Unbreak the upgrade path from 4.9 after removal of GNU getopt and
<gnuregex.h>.
2004-02-20 11:55:14 +00:00
Brian Feldman
d1cd079e12 Document dependence of mktemp(3) on the non-reentrant arc4random(3). 2004-02-20 04:08:28 +00:00
David Schultz
a94707138b Remove the code and an associated comment for gcc 1.x compatibility
and fix a typo in the !__GNUC__ case.
2004-02-16 10:03:02 +00:00
David Schultz
0f6da645e5 Fix a typo in the !__GNUC__ case and remove an obsolete comment. 2004-02-16 10:02:51 +00:00
David Schultz
36e22bed27 Fix some aliasing problems. 2004-02-16 10:02:40 +00:00
Peter Grehan
88d2dd24fd Add forgotten IEEE functions. The Perl 5.8 port now compiles.
Submitted by: Suleiman Souhlal <refugee@segfaulted.com>
Obtained from:  NetBSD
2004-02-12 09:11:06 +00:00
Colin Percival
1c81bd2c60 style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after teh copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:45:28 +00:00
Colin Percival
d623b765cf style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags after the copyright notice,
inside the comment block (incorrect, removed),
and outside the comment block (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:42:33 +00:00
Colin Percival
3c754d8be1 style cleanup: Remove duplicate $FreeBSD$ tags.
These files had tags at the start of the file
(incorrect, removed), and after the copyright
notices (correct).

Approved by:	rwatson (mentor)
2004-02-10 20:40:17 +00:00
Peter Wemm
47ae38b543 Rewrite fabs.S to use pure SSE2 operations. I got the clues how to do
this from looking at code generated by gcc.
2004-02-08 21:21:45 +00:00
David Schultz
10b1416d2f Update the documentation for setpgrp(2) to reflect the access control
checks that the code actually performs.  Judging from the 4.2BSD
release notes, the docs have only been out of date for 20 years.

PR:	29844
2004-02-08 12:38:30 +00:00
Mike Silbersack
a4e8244762 Document the SF_NODISKIO flag, and fix a small typo. 2004-02-08 07:38:35 +00:00
Ruslan Ermilov
50a51e39a9 Unbreak world. 2004-02-07 11:13:47 +00:00
Diomidis Spinellis
a54c3906ad getnetbyname fixes:
Do not choke on malformed network addresses.
Return n_name in static space, not on the function's stack.

MFC after: 1 week
2004-02-07 07:30:02 +00:00
Daniel Eischen
e3b4bf9411 Prevent memory leak on sem_destroy() by destroying the semaphore's
internal mutex and CV.
2004-02-06 15:15:44 +00:00
Daniel Eischen
e7f1524858 Only allow the semaphore to be taken when the value is positive.
Don't decrement it twice when it is taken.

Reported by:	kris
2004-02-06 13:54:38 +00:00
Daniel Eischen
08a6a888da Correct check for invalid semaphore on sem_destroy() (s/==/!=/).
Reported by:	kris
2004-02-05 23:32:45 +00:00
Daniel Eischen
3962ef4305 Correct the weak reference for sem_unlink. 2004-02-05 22:36:27 +00:00
Daniel Eischen
903f2e5041 Allow libc's version of sem_trywait() to work for non-pshared mutexes. 2004-02-04 15:37:48 +00:00
Daniel Eischen
5c70dac879 Modify the implementation of libc semaphores so that they can be
overridden by the threads library to provide a userland version
of non-pshared semaphores and cancellation points.  Also add
a sem_timedwait().

The libc version of semaphores always uses kernel semaphores
regardless of whether pshared is set or not.  When threads are
not present, it is difficult to get sem_wait() or sem_timedwait()
to do the right thing (since pthread_cond_timedwait() and
pthread_cond_wait() are stubs in libc and just return immediately).
2004-02-03 05:47:19 +00:00
David Schultz
01623eaad2 Merge vfscanf.c,v 1.35. 2004-01-31 23:18:53 +00:00
David Schultz
ff81345642 Fix the handling of negative hexadecimal numbers in integer formats.
Note that this bug is unrelated to recent work in this area; it seems
to have been present since revision 1.1.

Obtained from:	NetBSD
2004-01-31 23:16:09 +00:00
Andrey A. Chernov
41ddc53bca LC_ALL not always take priority over other LC_*
Obtained from:  NetBSD
PR:             62047
2004-01-31 19:15:32 +00:00
Andrey A. Chernov
e6e9fb749a Add reference to environ(7) 2004-01-29 09:27:24 +00:00
Eivind Eklund
93a876df31 Xref kqueue and poll 2004-01-26 15:20:16 +00:00
Eivind Eklund
1633f3b5a2 Xref kqueue 2004-01-26 15:19:54 +00:00
Andrey A. Chernov
81ccc5779c Describe EOVERFLOW case 2004-01-25 06:24:08 +00:00
Martin Blapp
09c37f5de6 When writing/reading longs use explicit 32bit temporary values.
MFNetBSD rev. 1.15 + rev 1.16

PR:		bin/60901
Submitted by:	Logan Gabriel <gersh@sonn.com>
Obtained from:	NetBSD
2004-01-24 01:23:30 +00:00
David Schultz
7b7e350998 Merge vfprintf.c, v1.61 and 1.62. For compatibility with __hdtoa()
and to reduce diffs between vfprintf.c and vfwprintf.c, declare xdigs*
to be char arrays rather than wchar_t arrays.

In collaboration with:	tjr
2004-01-23 22:48:16 +00:00
Peter Grehan
864dbc1065 Include <stdlib.h> to get abort() prototype. 2004-01-21 05:04:25 +00:00
Peter Grehan
b12b51fb53 Updated manh shift constant type to 'ULL' for PPC to fix
shift-too-large compile error

reviewed by: das
2004-01-21 04:51:50 +00:00
David Schultz
60ce8b0e07 Discard the first 1024 bytes of output as suggested by
http://citeseer.nj.nec.com/fluhrer01weaknesses.html and
http://citeseer.nj.nec.com/531224.html .

PR:		61126
Submitted by:	Jeff Ito <jeffi@rcn.com>
2004-01-20 04:22:47 +00:00
David Schultz
307649e2f3 Use 'uint32_t' instead of 'long' when a 32-bit integer is intended.
This results in no functional change, aside from fixing a data
corruption bug on LP64 platforms.  The code here could still use a
significant amount of cleanup.

PR:		56502
Submitted by:	hrs (earlier version)
2004-01-20 03:02:18 +00:00
David Schultz
f4d140366a Simplify mpool_get() and mpool_write() by using pread() and pwrite()
instead of lseek()/_read() and lseek()/_write().

PR:		bin/54276
Submitted by:	<dnelson@allantgroup.com>
2004-01-20 00:40:35 +00:00
Jacques Vidrine
8e1b0bc697 libc is now WARNS=2 clean with the exception of the gdtoa bits (which
are now not built with warnings enabled at all).
2004-01-19 16:16:53 +00:00
Jacques Vidrine
07a6d1d3f2 Add prototypes for the three syscall stubs that are invoked here,
in order to quiet warnings.
2004-01-19 16:14:58 +00:00
Poul-Henning Kamp
a9b19289e6 add cross-reference to clock_gettime(2) 2004-01-19 12:41:39 +00:00
David Schultz
e18c6616e2 Bring the *printf(3) documentation up to date with the code:
- Update and improve the documentation for %[aA]
  o Like %[eE], %[aA] may round the result if a precision is specified.
  o Grammar police: Fix a split infinitive.
  o The FreeBSD implementation does better than the minimum required
    by C99 (literal translation of the mantissa).  The digit before
    the hexadecimal-point is never 0 unless the number itself is 0.
  o Clarify that the exponent field represents a decimal exponent of 2.
  o Discuss the fact that multiple valid representations are possible.
  o Remove the entry in the BUGS section claiming that %[aA] is not
    implemented.

- Remove the entry in the BUGS section claiming that the ' flag for
  printing thousands separators is unimplemented for floating-point.

- Remove the entry in the BUGS section claiming that the L modifier
  reduces the precision to "double" before conversion.
2004-01-19 08:28:30 +00:00
Philippe Charnier
c4fe9d664a add missing endusershell() call. Original version was incorrect.
PR: bin/2442
Reviewed by: Friedemann Becker <zxmxy33@mail.uni-tuebingen.de>
2004-01-18 21:33:25 +00:00
David Schultz
8f59277300 Implement __hdtoa() and __hldtoa() and enable printf() support for %a
and %A, which print floating-point numbers in hexadecimal.
2004-01-18 10:32:49 +00:00
David Schultz
06c89bd55b Prototype __hdtoa() and __hldtoa(). 2004-01-18 08:28:47 +00:00
David Schultz
904322a502 Fix some bugs affecting the %a and %A format specifiers. Since
these are not fully implemented and ifdef'd out, the bugs have
never manifested themselves.  Specifically:

	- Fix a memory leak in the case where %a follows another
	  floating-point format.
	- Make the %a/%A code behave like %e/%E with respect to
	  precision.
	- It is no longer valid to assume that '-' and '0x' are
	  mutually exclusive.
	- Address other minor issues.
2004-01-18 08:28:32 +00:00
David Schultz
2ad265067c Add a delta accidentally omitted from the previous commit:
Define DBL_MANH_SIZE and DBL_MANL_SIZE to be the sizes of the
high and low words of the mantissa in bits, respectively.
2004-01-18 08:05:21 +00:00
David Schultz
a8cb7cca02 Define LDBL_MANH_SIZE and LDBL_MANL_SIZE to be the sizes of the
high and low words of the mantissa in bits, respectively.
2004-01-18 07:57:02 +00:00
David Schultz
d784b0c32c Fix a bug that caused long double subnormals to be printed
incorrectly on architectures without an explicit normalization
bit (sparc64, powerpc).
2004-01-18 07:53:49 +00:00