Commit Graph

368 Commits

Author SHA1 Message Date
yamt c5caadcfd8 bring in EXAMPLES and a note.
from openbsd.
2002-08-11 07:05:41 +00:00
yamt 6410ff3c05 bring in EXAMPLES from OpenBSD. 2002-08-11 06:53:39 +00:00
yamt 8acd3a715f - more description about realloc.
- mention errno.
- add FILES section for malloc.conf.
from openbsd.
2002-08-11 06:12:45 +00:00
yamt 145cf30b9f fix sample code. from openbsd. 2002-08-10 17:25:01 +00:00
yamt 1060c75faa result of getenv should be treated as read-only.
from OpenBSD.
2002-08-10 17:14:50 +00:00
yamt 0010f8875d bump .Dd . 2002-08-10 17:10:11 +00:00
yamt 9d36ca1fbf note only 8 bits of exit-status is passed.
from OpenBSD.
2002-08-10 17:09:27 +00:00
yamt 120c9b3256 note that alloca can't report error.
from OpenBSD.
2002-08-10 16:55:18 +00:00
yamt 14e693f16b bump .Dd for my previous commit. 2002-08-10 16:51:26 +00:00
yamt cd575f9fb2 note that abort(3) causes streams flushed and closed.
from OpenBSD.
2002-08-10 16:47:54 +00:00
jdolecek 06a4a82134 restore the previous form of the condition checking malloc() return value, which
was changed in previous revision
2002-07-31 12:57:36 +00:00
itojun 891518d386 allow calloc(0, x) and calloc(x, 0). sync w/openbsd 2002-07-31 09:26:49 +00:00
itojun c68c6aa7e0 die if integer overflow. from openbsd 2002-07-30 09:45:02 +00:00
yamt 673cbedc13 import CAVEATS sections from OpenBSD.
with little tweak by me.
2002-07-10 14:37:12 +00:00
wiz 4dc035fd8a Undo last two, until I have time to take a good look at the problems. 2002-06-21 09:56:33 +00:00
wiz ec1956ee4e According to POSIX, "-" (the string) is an exception and should not
be parsed as option. Restore behaviour broken by previous commit.
Mirrors second part of patch from lib/17248.
2002-06-13 21:18:50 +00:00
wiz d2d91a9170 Fix '-' handling. POSIX only recognizes "--" as end-of-options.
Problem noted in lib/17248 by David Laight, including a patch.
Part of this patch was used.
2002-06-13 20:49:00 +00:00
fredette 02ac1ae2f0 Added hppa support (some of it incomplete) to lib/csu, lib/libc,
and lib/libkvm.
2002-06-06 20:31:19 +00:00
wiz 919948e5f4 Fix SYNOPSIS, noted by Martin Macok on tech-userlevel. 2002-06-03 12:01:43 +00:00
wiz bf5ec17026 Remove #ifdef Bad_float_h and #ifndef __STDC__ parts (unneeded). 2002-05-26 15:04:08 +00:00
zuntum 0f1273fc58 Xref fabs(3)
OK'd by Jaromir Dolecek
2002-04-28 11:52:43 +00:00
ross 9856438e91 generate & symbolically 2002-02-07 09:24:04 +00:00
ross 814f296b77 Generate <>& symbolically. 2002-02-07 07:00:09 +00:00
tv 9fbd88883c Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
  sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
2002-01-31 22:43:33 +00:00
tv a328e34106 Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
2002-01-29 10:20:28 +00:00
wiz bae3b2f44b Punctuation fixes. 2002-01-28 02:07:57 +00:00
kleink f100d16fcf C99: support INF, INFINITY, NAN and NAN(n-char-sequence-opt) arguments. 2002-01-28 00:10:04 +00:00
wiz 626980860b Use .Pp instead of empty lines. 2002-01-15 02:37:56 +00:00
wiz a62d4fbf73 Use Aq for email address. 2002-01-15 02:37:32 +00:00
thorpej 10b6bfb636 Make a note about the alignment requirement of the state array
passed to initstate(3).  This is actually documented in comments
in the code.
2002-01-08 02:19:56 +00:00
thorpej 3181978909 Make this actually work on LP64 platforms. It has been broken
since some "cleanups" in the master (UCB?) version of this file
were made in 1994 (which assumed the size of long is 4 bytes).

This fixes krb5-enabled logins on the Alpha.
2002-01-08 02:11:39 +00:00
thorpej 846f87dbb9 Use __sh__ instead of __sh3__. 2001-12-15 03:39:53 +00:00
lukem 50f5afd52e fix WARNS=2 (-Wshadow) warnings 2001-11-04 13:57:29 +00:00
kleink e8befb717e Inspired by Stevens' APUE and the implementation example in XSH:
* Don't return if wait()ing for the child is interrupted.
* Fix a race condition for the parent's SIG{INT,QUIT} disposition.
* While we're here, convert from using signal(3) to sigaction(2).
2001-10-31 13:31:26 +00:00
wiz 4e59d26612 Drop unnecessary whitespace and .Pp, sort SEE ALSO, sort sections,
and some minor fixes.
2001-09-16 01:31:51 +00:00
enami 0af73d03a2 Sort SEE ALSO and remove trailing comma. 2001-09-16 01:09:18 +00:00
fvdl a067632dd5 Add x86_64 to the list of if defined(blah) for endian determination
(surely this can be done in a better way).
2001-06-19 22:08:07 +00:00
assar 12df1a8eb8 remove confusing comparison with srand (it does not return the old seed)
use .Sh AUTHORS and .An for author
2001-06-09 01:43:53 +00:00
simonb 8e610505cb Add sradixsort to the NAME section. 2001-06-07 13:17:09 +00:00
mycroft d44a3af5c0 Add an underscore for consistency. 2001-05-10 06:10:35 +00:00
kleink 714d58eb51 For consistency add a _DIAGASSERT() case, and remove some cruft. 2001-05-07 08:32:20 +00:00
kleink b03ace75dd Add a _DIAGASSERT() case, and remove some cruft. 2001-05-07 08:29:25 +00:00
kleink cb31d8175c Use <stddef.h> rather than <stdio.h> if it's just NULL that's wanted. 2001-05-07 08:26:13 +00:00
lukem 3b2a77c393 need stdio.h for NULL... 2001-05-07 02:51:59 +00:00
christos b2126f94bb More fixes:
1. use uintptr_t instead of u_long
2. check for overflow in map_pages and malloc_pages
3. bring in fixes from FreeBSD [int -> size_t, and a missing THREAD_UNLOCK]
4. rewrite map_pages to use sbrk() only to grow memory (avoids extra syscall
   and elides bug in brk(2) that ross is fixing)
5. restore the break point to its original value if the mmap(2) for the page
   directory or the alignment sbrk breaks.

reviewed by: chuq and ross
tested by: make build and reboot
Now memtest nearly works; unfortunately there is no way currently to lower
the break point as we free, so memtest keeps trying to reduce memory when
mlock() fails and that does not work.
2001-05-06 04:48:41 +00:00
christos fa27739cb4 PR/12810: Chris ?: malloc core-dumps when given large number as the argument.
This is because integer overflow occurs in the computation of the size of
the page directory array. We now detect that, and return ENOMEM.
2001-05-03 15:35:12 +00:00
kleink fe3c9ceaf7 * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
  explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
  macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
  intmax_t, pointer-type and size_t arguments.
2001-04-28 15:41:28 +00:00
joda 77dec036c1 don't claim that options are illegal, cf lib/12715 2001-04-24 09:07:43 +00:00
cgd e8c9c330a8 document EXIT_SUCCESS and EXIT_FAILURE, since they've been around
since ANSI and (for portability, since ANSI) in some circles they're
the preferred exit status codes.
2001-03-22 01:37:46 +00:00
kleink 77fbd9fe1c Sprinkle some restrict qualifiers. 2001-03-21 22:42:28 +00:00
fair 0b6f011535 Add documentation of nmemb parameter, per PR 10567 2001-03-16 07:47:29 +00:00
bjh21 fe6fa58436 Add support for ARM VFP-format doubles, conditional on __VFP_FP__. 2001-02-21 18:09:25 +00:00
lukem 2e118c9dce fix _DIAGASSERT usage in hsearch() 2001-02-21 16:31:01 +00:00
cgd 0fd3d5e599 nuke a ref to __progname that somehow crept in 2001-02-19 22:43:21 +00:00
cgd 6b25d77513 convert from __progname to getprogname() 2001-02-19 22:22:16 +00:00
ross 687259968d LP64 2001-02-19 21:26:04 +00:00
msaitoh 36db62c9dc add hcreate.3 2001-02-16 12:25:09 +00:00
cgd d563d62f6c update for current status of implementation 2001-02-14 05:59:56 +00:00
cgd 579369d368 build new hsearch() code 2001-02-14 05:44:29 +00:00
cgd 51a7af156e add new, from scratch implementation of hsearch() et al that actually works 2001-02-14 05:41:25 +00:00
cgd 66678fd1bb move db/man/hcreate.3 to stdlib/hcreate.3 2001-02-14 05:41:01 +00:00
cgd e76f9e3425 don't extern char *__progname; it's never used! 2001-02-12 23:59:17 +00:00
bjh21 b2ffea9b75 __arm26__ || __arm32__ -> __arm__
Not least because the unified NetBSD/arm compiler probably won't predefine
__arm26__ or __arm32__.
2001-02-09 18:38:32 +00:00
jdolecek ae76c71d75 slighly clarify how endbyte is used, so that this matches implementation more closely 2001-01-12 19:23:11 +00:00
lukem b8d674b457 link sradixsort(3) -> radixsort(3) 2001-01-08 14:06:09 +00:00
jdolecek 75ee9a37dd we now have utrace, support it here 2001-01-05 22:29:28 +00:00
lukem c5b9e1cef5 sprinkle _DIAGASSERT() around 2001-01-04 03:35:29 +00:00
itojun 408f4697a6 first import of citrus LC_CTYPE locale. singlebyte only at this moment.
shot-term TODO:
- enable multibyte locales.  this includes loadable locale modules
  (#ifdef DLRUNE).
- populate LC_CTYPE definition files.
- other functions such as iconv()
- make libc functions more friendly with multibyte.
- multilingualize other LC_xx
- torture tests

XXX don't forget to "make depend" when you rebuild libc, multibyte.c is
moved from lib/libc/stdlib to lib/libc/locale.
2000-12-21 11:29:47 +00:00
christos bebeeecd5b fix sbrk casts 2000-12-20 20:56:01 +00:00
christos 6bae1e9ae7 avoid nested extern declaration 2000-12-20 18:38:30 +00:00
christos b8e7598d98 fix nested extern 2000-12-20 15:59:51 +00:00
christos ee5e1d12cf fix nested extern declaration. 2000-12-19 21:17:37 +00:00
garbled 41f8bfbc99 Radixsort wants a const u_char ** as a fisrt argument, not just a
u_char **.  Fix this manpage.
2000-12-13 22:11:24 +00:00
wiz e7775dbf9e Be SUS-conformant regarding return value when option argument is missing.
Handle "-" correctly.
2000-11-26 23:39:11 +00:00
wiz 7af3cfc292 Reorder sections to conform more to mdoc.samples; remove non-mdoc
section header; fix two typos.
2000-11-26 22:35:53 +00:00
itojun 8f6dee4c39 make random(3) manpage meet with actual implementation.
argument to srandom() and initstate() were changed in
lib/libc/stdlib/random.c 1.28 -> 1.29, and manpage was left behind.
2000-10-05 06:21:53 +00:00
thorpej a3fe3d3cf9 Some (popular) programs expect to be able to re-initialize `optind'
to 0 and have getopt(3)/getopt_long(3) continue to function properly.
This happens to work with GNU getopt_long(3), so mimmick the behavior.

Fixes pkg/10980 (Manuel Bouyer): rsyncd was relying on this behavior.
2000-08-25 17:05:49 +00:00
sommerfeld ac7a8f6bc2 Correct format mismatch for field widths 2000-07-08 14:58:43 +00:00
christos 6b283a58bd avoid losing precision warnings 2000-07-06 03:13:22 +00:00
msaitoh f6f00e2615 remove extra period in SEE ALL section 2000-07-05 15:45:28 +00:00
cgd d220ca5ba3 fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well.  No functional changes.
2000-06-14 06:48:47 +00:00
nathanw 045f0427b1 Don't segfault when complaining about an invalid single-character option.
When complaining about a long option which requires an argument,
print the actual option, not some pointer-garbage.

(Hint: "%c" and "%s" are different.)
2000-06-09 21:35:53 +00:00
simonb ecce47356a Disable malloc's hints to the kernel - now that the madvise() syscall
actually does something, this can be expensive.  From discussion on
current-users.

Note that the man page is already correct - we imported malloc.c from
FreeBSD before they made the same change but malloc.3 after...
2000-05-20 15:13:31 +00:00
is 20b532d4ea Workaround no longer needed, now that the compiler is fixed. 2000-05-16 22:07:30 +00:00
bjh21 6c97e2bd78 Initial commit of arm26 port 2000-05-09 21:55:44 +00:00
is 2ced82ab8e Add the (void)&acc; hack from strtouq.c to strtoull.c. This works around
an arm32 compiler bug. Change the comment in strtouq.c to reflect the current
usage of the hack.
2000-05-02 12:39:03 +00:00
enami d76da5f70c Fix the bug introduced in rev 1.28 and actually caused failure on alpha;
In the function malloc_make_chunks, don't define the local variable ``l'',
which is used to hold the actual size of pginfo, as size_t.  Define it as
a signed integer as before.  We expect it to become zero or negative value,
and we know that it is much smaller than pagesize and it is small enough to
fit in signed interger.
2000-04-07 15:15:08 +00:00
enami 07fd543922 Backout the previous backing out. 2000-04-07 14:56:13 +00:00
wiz 3492cfdd4b small fixes; not yet complete 2000-04-07 00:02:32 +00:00
christos 6d34da153c Add "namespace.h" and include <getopt.h> since we moved the stuff out
of <unistd.h>
2000-04-02 22:04:06 +00:00
christos bfb2439e73 Remove sections relevant to getopt, and add implementation differences. 2000-04-02 20:30:07 +00:00
christos 6dfafca13a New getopt_long from Thomas Klausner and Dieter Baron 2000-04-02 20:27:58 +00:00
erh 5aef3fa29b Make mbstowcs and wcstombs work correctly when handed NULL pointers. 2000-04-01 19:42:57 +00:00
enami c09a75571b Add missing comma. 2000-03-16 04:57:11 +00:00
kleink c2ee7198c1 Need to quote excessively long Nd argument. 2000-03-15 20:53:57 +00:00
kleink 31f60ab101 No longer need internal names for strtoq() and strtouq(). 2000-03-08 20:17:19 +00:00
kleink 4c3c49ae8b Make lint happy about long long integers. (C99 mode for lint, anyone?) 2000-03-07 20:02:00 +00:00
kleink e4d7c2e329 Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
2000-03-06 18:32:22 +00:00
thorpej 62c7591543 Back out the previous 2 revs. The delint'ing of this file caused
something to break horribly on the Alpha.
2000-01-31 22:56:14 +00:00
elric e0b171cf6d Added a tab before a '}' to put the brace in the right place. 2000-01-25 23:22:49 +00:00