summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* Fix ptsname(3) by converting it to use devname(3) to obtain the name ofmarcus2005-07-071-3/+4
| | | | | | | | | | | | a tty device instead of the legacy minor number approach. This is known to fix gnome-vfs' sftp module as well as kio_sftp and kdesu on -CURRENT. Thanks to scottl for the snprintf() approach idea. Reviewed by: phk Tested by: pav mich Approved by: re (scottl)
* Do not require the pty(4) majors to be anything in particular.green2005-03-041-3/+0
|
* Remove the check about whether MALLOC_EXTRA_SANITY is defined,delphij2005-02-271-2/+0
| | | | | | | | | surrounding the undef'ing it. It does not seem necessary to undef some symbol that is not exist, and gcc does not complain about whether a symbol is exist before #undef'ing it out. Spotted by: mingyanguo via ChinaUnix.net forum Reviewed by: phk
* Especially mention that setting errno to EINVAL in "no conversion" caseache2005-01-222-4/+8
| | | | | | is not portable. Asked by: joerg
* Whitespace/style tweaking of prev. commit.ache2005-01-216-24/+18
| | | | Noted by: bde
* POSIX says that 0[xX] prefix is _optional_ even in base 16 case, make itache2005-01-216-6/+30
| | | | | | | | | | really so. "If the value of base is 16, the characters 0x or 0X may optionally precede the sequence of letters and digits, following the sign if present." Found by: joerg
* Sort sections.ru2005-01-209-77/+77
|
* Markup fixes.ru2005-01-141-6/+6
|
* Fix some signed/unsigned comparisons. Fix prototypes while I'm here.brian2005-01-121-3/+6
| | | | | | PR: 28890 Submitted by: matthias.andree at web dot de MFC after: 7 days
* sranddev() is not magic pixie dust. While it gives a good randomimp2004-11-101-2/+4
| | | | | | | | seed, the random number generator rand(3) still sucks and is unlikely sufficient for crypto use. Correct what appears to be a cut and paste error from the srandomdev() man page. Submitted by: Ben Mesander
* Reword recent addition about memory moving.alfred2004-08-191-5/+4
| | | | | | | | Requested by: keramida Bump .Dd Requested by: ru
* Clarify that realloc and reallocf may move the memory allocation.alfred2004-08-181-3/+7
|
* Use #include <unistd.h> rather than the explicit externs in theimp2004-07-311-2/+1
| | | | | | example. The externs haven't been needed in about 10 years, so there's no reason to have them other than for hysterical raisins. And the California Rasins haven't been around for a long time...
* mdoc(7) fixes.ru2004-07-071-2/+3
|
* Move the return value information about the getenv(3) library functionhmp2004-07-061-4/+10
| | | | | | | | | under the RETURN VALUES section so it is consistent with others. Cleanup the return value text for getenv(3) a little while I am here. PR: docs/58033 MFC after: 3 days
* Keep it sync with OpenBSD:ache2004-07-061-3/+4
| | | | | | | An optional argument cannot start with '-', even if permutation is disabled. Obtained from: OpenBSD getopt_long.c v1.17
* Sort SEE ALSO references (in dictionary order, ignoring case).ru2004-07-041-1/+1
|
* Consistently use __inline instead of __inline__ as the former is an empty macrostefanf2004-07-041-3/+3
| | | | in <sys/cdefs.h> for compilers without support for inline.
* Eliminate double whitespace.ru2004-07-031-4/+4
|
* Mechanically kill hard sentence breaks.ru2004-07-025-14/+30
|
* Define malloc_pageshift and malloc_minsize for arm.cognet2004-05-141-0/+4
|
* Link radixsort(3) to sradixsort(3), make the latter appear inru2004-05-122-1/+2
| | | | the whatis(1) output.
* Simplify one condition in prev. commit:ache2004-04-011-2/+1
| | | | short_too already assumes FLAG_LONGONLY
* Fix parsing of ambiguous options, whole loop must be processedache2004-04-011-17/+27
|
* Rearrange (centralize) initialization of mallocs internals to always bephk2004-03-071-19/+13
| | | | | | done before the first call, even if this is a malloc(0) call. PR: 62859
* Merge some fixes from NetBSD's getopt.3 v1.31:ache2004-03-061-43/+88
| | | | cleanup, add more sections, better explanation, declaration
* Merge some fixes from NetBSD's getopt.c v1.26:ache2004-03-061-26/+43
| | | | | | | | 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.
* Fix typo, was 'W'; instead of `W;'ache2004-03-061-1/+1
|
* Make GNU-compatible following case:ache2004-03-062-23/+27
| | | | single '-' in command line and '-' (non-first) in options
* Make return code in noarg case GNU-compatibleache2004-03-032-20/+24
|
* Be more GNU-compatible in diagnosticsache2004-03-031-11/+61
|
* Improve GNU compatibility in several places, use internal GNU_COMPATIBLEache2004-03-012-29/+49
| | | | | | | 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[]
* Comment out things related to getopt() replacement we not useache2004-03-011-36/+36
|
* Change "-"-started options when POSIX_CORRECTLY is set handlingache2004-03-011-17/+17
| | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU.
* Change "-"-started options when POSIX_CORRECTLY is set handlingache2004-03-011-1/+5
| | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU.
* Add getopt_long_only() from OpenBSD and other OpenBSD cleanupsache2004-02-243-299/+459
| | | | | PR: 63173 Submitted by: Marius Strobl <marius@alchemy.franken.de>
* Add optarg, optind, opterr, optopt, optreset to SYNOPSYSache2004-02-231-0/+5
|
* POSIX clearly states that getsubopt() should be declared in <stdlib.h>ache2004-02-231-1/+1
| | | | not in <unistd.h>
* Remove unneccessary <unistd.h>ache2004-02-231-1/+0
|
* Remove the triplicity in the public functions by vectoring them allphk2004-02-211-70/+49
| | | | | | | | | | 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.
* Move the check for sensitive processes to the point where the exceptionphk2004-02-211-14/+7
| | | | | | | | | 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.
* Unbreak the upgrade path from 4.9 after removal of GNU getopt andru2004-02-201-2/+0
| | | | <gnuregex.h>.
* style cleanup: Remove duplicate $FreeBSD$ tags.cperciva2004-02-101-2/+0
| | | | | | | | These files had tags after the copyright notice, inside the comment block (incorrect, removed), and outside the comment block (correct). Approved by: rwatson (mentor)
* Use 'uint32_t' instead of 'long' when a 32-bit integer is intended.das2004-01-201-31/+32
| | | | | | | | | 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)
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorkan2003-12-192-13/+2
| | | | | | | | | | | | | รณ++ ABI document at http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor The ABI was initially defined for ia64, but GCC3 and Intel compilers have adopted it on other platforms. This is the patch from PR bin/59552 with a number of changes by me. PR: bin/59552 Submitted by: Bradley T Hughes (bhughes at trolltech dot com)
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorkan2003-12-191-7/+101
| | | | | | | | | | | | | C++ ABI document at http://www.codesourcery.com/cxx-abi/abi.html#dso-dtor The ABI was initially defined for ia64, but GCC3 and Intel compilers have adopted it on other platforms. This is the patch from PR bin/59552 with a number of changes by me. PR: bin/59552 Submitted by: Bradley T Hughes (bhughes at trolltech dot com)
* Do not adjust to the pagesize at runtime. Besides for the one-timemarcel2003-11-281-8/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization overhead, there's a problem in that we never call imalloc() and thus malloc_init() for zero-sized allocations. As a result, malloc(0) returns NULL when it's the first or only malloc in the program. Any non-zero allocation will initialize the malloc code with the side-effect that subsequent zero-sized allocations return a non-NULL pointer. This is because the pointer we return for zero- sized allocations is calculated from malloc_pageshift, which needs to be initialized at runtime on ia64. The result of the inconsistent behaviour described above is that configure scripts failed the test for a GNU compatible malloc. This resulted in a lot of broken ports. Other, even simpler, solutions were possible as well: 1. initialize malloc_pageshift with some non-zero value (say 13 for 8KB pages) and keep the runtime adjustment. 2. Stop using malloc_pageshift to calculate ZEROSIZEPTR. Removal of the runtime adjustment was chosen because then ia64 is the same as any other platform. It is not to say that using a page size obtained at runtime is bad per se. It's that there's currently a high level of gratuity for its existence and the moment it causes problems is the moment you need to get rid of it. Hence, it's not unthinkable that this commit is (partially) reverted some time in the future when we do have a good reason for it and a good way to achieve it. Approved by: re@ (rwatson) Reported by: kris (portmgr@) -- may the ports be with you
* Improve the performance of radixsort() whenkientzle2003-11-111-0/+11
| | | | | | | | | | | | | sorting strings with common prefixes by noting when all the strings land in just one bin. Testing shows significant speedups (on the order of 30%) on strings with common prefixes and no slowdowns on any of my test cases. Submitted by: Markus Bjartveit Kruger <markusk@pvv.ntnu.no> PR: 58860 Approved by: gordon (mentor)
* Externalize malloc's spinlock so that a thread library can takedeischen2003-11-041-0/+1
| | | | | | | | | | | it around an application's fork() call. Our new thread libraries (libthr, libpthread) can now have threads running while another thread calls fork(). In this case, it is possible for malloc to be left in an inconsistent state in the child. Our thread libraries, libpthread in particular, need to use malloc internally after a fork (in the child). Reviewed by: davidxu
* Remove incomplete support for running FreeBSD userland on old NetBSD kernelstjr2003-10-291-3/+1
| | | | lacking the issetugid() and utrace() syscalls.
OpenPOWER on IntegriCloud