Commit Graph

375 Commits

Author SHA1 Message Date
kleink 2d356478dd Make the spelling of reentrant match the rest of the system. 2004-07-01 10:38:28 +00:00
jmc b2f782612f Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
2004-06-20 22:20:14 +00:00
wiz 508c6e7767 Uppercase Dt argument; \-1, not -1; sort SEE ALSO; & -> \*[Am]. 2004-05-28 00:10:57 +00:00
wiz 714885bde5 Drop trailing whitespace. 2004-05-28 00:06:50 +00:00
christos 892ad9caae unix/98 pty functions and manual pages. 2004-05-27 02:58:48 +00:00
kleink f379d2c8ac There are two instances of getsubopt.c, one in gen, which came by the
ways of 386BSD, and one in stdlib, which is from Lite-2.  The former was
picked up by the build process and has seen a little more maintenance
while the latter's location is "right", so bring the latter up to par
with the former and dispose of the (now) latter.

Reported by David A. Holland in PR lib/25160, which is worded in a
far less mind-boggling fashion than the above.
2004-05-09 19:34:11 +00:00
simonb 04680727b1 s/this this/this/. 2004-04-23 02:48:12 +00:00
lukem a19008b17f Explicitly use base 10 when parsing numbers, to enforce the "decimal number"
semantics that the comments referred to and as per dd(1) (which was the
origin of this functionality).
2004-03-05 05:58:29 +00:00
wiz e3fc4b66c3 Spell the plural of suffix "suffixes", not "suffices".
Inspired by PR 24400 by Todd Vierling.
2004-02-13 17:56:17 +00:00
dbj 1d81763357 print max rather than min in error message when number
parsed by strsuftollx is greater than max
2004-01-17 23:02:51 +00:00
jdolecek b02f563aeb improve random number generation by using largest 31-bit prime
as denominator; regenerate the randtbl[] with new generator

patch provided in lib/22853 by KIHARA Hideto; code actually present
in libkern/random.c since 1994/06/03

matches similar change done in glibc in 1995, and FreeBSD & OpenBSD in 1996
2003-11-26 20:44:40 +00:00
lukem 171d653219 Overhaul how `build.sh tools' are used:
*	Rename "config.h" to "nbtool_config.h" and
	HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
	This makes in more obvious in the source when we're using
	tools/compat/config.h versus "standard autoconf" config.h

    *	Consistently move the inclusion of nbtool_config.h to before
    	<sys/cdefs.h> so that the former can provide __RCSID() (et al),
    	and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
	#if HAVE_NBTOOL_CONFIG_H
	#include "nbtool_config.h"
	#endif
to the top of the source files (for the general case).
2003-10-27 00:12:41 +00:00
junyoung e3ac3a4d0c Style fixes to reduce diff size against the FreeBSD version, notably:
- Use NULL where appropriate.
 - No need to pull in stdint.h.
 - Get rid of "register" keywords in the hope that the compiler will
   do a better job for us. :-)
 - Every message ends with a period.
 - MMAP() macro is supposed to return MAP_FAILED rather than -1 if it
   fails.
 - De-__P.
2003-10-05 04:49:46 +00:00
wiz a66ae71844 Slight syncing with OpenBSD version. 2003-09-23 10:26:54 +00:00
itojun 57e4de6099 add warning on realloc() size de-synchronization. from openbsd 2003-09-19 05:36:59 +00:00
wiz 8d66b069c8 Use standard section headers, suggested by jmc@openbsd. Sort sections. 2003-09-10 13:30:16 +00:00
wiz 9e4a539564 Pull over some improvements from OpenBSD's v1.26 of this file, including
SEE ALSO and RETURN VALUES sections.
2003-09-10 09:35:41 +00:00
itojun 0186de22d3 getopt return value has to be held in int, not char. 2003-09-10 00:03:42 +00:00
wiz 185463aee4 Fix typos and declare a missing variable in example. From Quentin Garnier in PR 22733. 2003-09-09 19:31:53 +00:00
wiz dca9ccd375 Use St -isoC-9X instead of St -isoC9X, to be in sync with groff. 2003-09-08 17:54:31 +00:00
wiz c4f582bcc6 Fix typos in comments; from Brian Poole via jmc@openbsd. 2003-09-07 19:06:50 +00:00
agc eb7c1594f1 Move UCB-licensed code from 4-clause to 3-clause licence.
Patches provided by Joel Baker in PR 22280, verified by myself.
2003-08-07 16:42:00 +00:00
salo 99410184e7 netbsd.org->NetBSD.org 2003-07-26 19:24:24 +00:00
itojun 6f4e912af4 call malloc_init() on first call to free/realloc, to make malloc.conf to
take effect.  in response to PR 22223
2003-07-23 08:15:02 +00:00
wiz e19fe12b03 Remove superfluous comma. 2003-06-27 18:01:08 +00:00
wiz 3e884db9b9 Quote question mark. 2003-06-27 14:03:45 +00:00
uwe 0bbb587407 Add atoll(3) to libnbcompat. We need it when building target's gcc
for a 64-bit target on a 32-bit host.

NB: There seems to be a bug in either gcc itself or the way we import
it, b/c the incorrect #define HAVE_ATOLL is picked from (e.g. for
sparc64) gnu/usr.bin/gcc/arch/sparc64/auto-host.h - so when gen*
auxilary (host) programs are built in gnu/usr.bin/gcc/backend, they
incorrectly pick-up target's HAVE_ATOLL.

For now providing atoll(3) in libnbcompat is a simple and sufficient
workaround.
2003-06-03 03:16:48 +00:00
kleink 4f95ecd71a KNF example: NULL vs. 0, space after switch. 2003-05-29 17:48:49 +00:00
wiz 7a7ee80bcc Misc fixes from jmc@openbsd. 2003-05-10 12:24:54 +00:00
wiz 472351e13d Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
2003-04-16 13:34:34 +00:00
kleink c02f38cf64 Warn if the old unsetenv() is referenced. 2003-04-13 17:39:13 +00:00
kleink aa92e94d2a Observed in other places: move __unsetenv13.c near unsetenv.c, only
group name space wrappers separately.
2003-04-07 17:18:20 +00:00
drochner 1a9947a7d7 unsetenv(3) returns "int" now 2003-04-07 16:29:06 +00:00
drochner 22b67837d4 compile unsetenv(3) into libc or you'll mess up your system 2003-04-07 16:22:43 +00:00
kleink 13dee93fb3 1003.1-2001 has introduced unsetenv() which differs from the current
implementation in not permitting a "name=value" argument.
* Add a conforming __unsetenv13() and do function renaming for
  unsetenv(); preserve old symbol with old behavior.
* Make visible setenv() and unsetenv() for 1003.1-2001 feature selection
  macros; resolves PR standards/20479.
2003-04-07 13:41:13 +00:00
nathanw aa70f03b23 When implementing a recursive mutex, it helps if you remember to
decrement the recursion count.

Fixes the problem of uic dying with a no-next-thread assertion while
building kdeadmin3; reported by Perry Metzger and others on
tech-pkg.
2003-03-19 22:26:47 +00:00
nathanw f60f35f3ab Don't acquire __environ_lock around exec*() calls; nothing requires
that these calls be thread-safe with respect to the environment, and it
causes serious problems for threaded applications which call vfork() and
exec*() (including indirectly, via popen() or system()).

Acquire and release __environ_lock in the parent in popen() and system() to
play safe and provide the child with a stable environment.

__environ_lock should also have an atfork() handler; still under development.
2003-03-04 19:44:09 +00:00
thorpej 65ec6ba6e7 Fix lib/20558:
A dynamically linked program invokes the rtld cleanup routine via
an atexit handler.  This rtld cleanup routine invokes _fini() for
shared libraries, which in-turn invoke __cxa_finalize() with their
DSO handle.  By luck, this happens to work okay for non-threaded
programs, but for a threaded program, this leads to deadlock (sometimes
manifested as an assertion failure, if the program didn't actually
create any threads).

Fixed by teaching __cxa_finalize() that it can be recursively invoked,
adjusting the handler list manipulation accordingly.
2003-03-04 18:09:48 +00:00
bjh21 22ebd2b34b Add _Exit(), for C99 and POSIX-2001.
Proposed on tech-userlevel to a resounding silence in April last year.
2003-03-01 15:59:02 +00:00
thorpej 26be93fa6f Rewrite atexit(3), and add support for __cxa_atexit()/__cxa_finalize(),
as specified by the C++ ABI for Itanium.  Despite the ABI document's name,
many of the items in it are implemented for other architectures.

See the following URL for a reference:

	http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor

Fixes lib/18379 (from Joel Baker).
2003-03-01 04:19:37 +00:00
itohy ca348cd671 Use definition in "namespace.h" to rename functions, not home grown. 2003-02-08 07:27:51 +00:00
heinz 077e910e6d Provide some more details for papers by Bentley/M.D. McIlroy and by
P.M. McIlroy (after short e-mail conversation with M.D. McIlroy on
www@).
2003-01-29 22:12:53 +00:00
dsl c673281c37 Fix lib/17248 properly
'ls -l-' now reports unknown option -- -
'env -' and 'su -' both work ok
(change approved by christos)
2003-01-20 09:06:35 +00:00
christos af26d1a576 s/_REENT/_REENTRANT/ 2003-01-18 17:20:04 +00:00
thorpej 3fdac2b8c5 Merge the nathanw_sa branch. 2003-01-18 10:52:16 +00:00
chris 5e606f5b98 Add a couple of missing THREAD_UNLOCK's, for the error exit path.
No functional change on Mainline, however SA branch probably needs this.
2002-12-09 14:14:59 +00:00
wiz 454f40b755 a <-> an fixes. 2002-11-29 19:19:39 +00:00
lukem 6ca5b5bb68 add strsuftoll(3) and strsuftollx(3) - parse a string for a number
with an optional suffix, product (two numbers separated by `x'), and
provide range checking
2002-11-29 12:58:14 +00:00
enami b37113ebab Fix indent in sample code. 2002-11-15 04:38:55 +00:00
thorpej d6e3c04143 Fix signed/unsigned comparison warnings. 2002-11-11 20:34:10 +00:00