summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
...
* Rearrange (centralize) initialization of mallocs internals to always bePoul-Henning Kamp2004-03-071-19/+13
| | | | | | | | | done before the first call, even if this is a malloc(0) call. PR: 62859 Notes: svn path=/head/; revision=126727
* Merge some fixes from NetBSD's getopt.3 v1.31:Andrey A. Chernov2004-03-061-43/+88
| | | | | | | cleanup, add more sections, better explanation, declaration Notes: svn path=/head/; revision=126697
* Merge some fixes from NetBSD's getopt.c v1.26:Andrey A. Chernov2004-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. Notes: svn path=/head/; revision=126696
* Fix typo, was 'W'; instead of `W;'Andrey A. Chernov2004-03-061-1/+1
| | | | Notes: svn path=/head/; revision=126693
* Make GNU-compatible following case:Andrey A. Chernov2004-03-062-23/+27
| | | | | | | single '-' in command line and '-' (non-first) in options Notes: svn path=/head/; revision=126692
* Make return code in noarg case GNU-compatibleAndrey A. Chernov2004-03-032-20/+24
| | | | Notes: svn path=/head/; revision=126535
* Be more GNU-compatible in diagnosticsAndrey A. Chernov2004-03-031-11/+61
| | | | Notes: svn path=/head/; revision=126518
* Improve GNU compatibility in several places, use internal GNU_COMPATIBLEAndrey A. Chernov2004-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[] Notes: svn path=/head/; revision=126452
* Comment out things related to getopt() replacement we not useAndrey A. Chernov2004-03-011-36/+36
| | | | Notes: svn path=/head/; revision=126440
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-17/+17
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126439
* Change "-"-started options when POSIX_CORRECTLY is set handlingAndrey A. Chernov2004-03-011-1/+5
| | | | | | | | in favour of GNU instead of NetBSD, because configure's use us and expect GNU. Notes: svn path=/head/; revision=126438
* Add getopt_long_only() from OpenBSD and other OpenBSD cleanupsAndrey A. Chernov2004-02-243-299/+459
| | | | | | | | PR: 63173 Submitted by: Marius Strobl <marius@alchemy.franken.de> Notes: svn path=/head/; revision=126189
* Add optarg, optind, opterr, optopt, optreset to SYNOPSYSAndrey A. Chernov2004-02-231-0/+5
| | | | Notes: svn path=/head/; revision=126143
* POSIX clearly states that getsubopt() should be declared in <stdlib.h>Andrey A. Chernov2004-02-231-1/+1
| | | | | | | not in <unistd.h> Notes: svn path=/head/; revision=126139
* Remove unneccessary <unistd.h>Andrey A. Chernov2004-02-231-1/+0
| | | | Notes: svn path=/head/; revision=126138
* Remove the triplicity in the public functions by vectoring them allPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126061
* Move the check for sensitive processes to the point where the exceptionPoul-Henning Kamp2004-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. Notes: svn path=/head/; revision=126060
* Unbreak the upgrade path from 4.9 after removal of GNU getopt andRuslan Ermilov2004-02-201-2/+0
| | | | | | | <gnuregex.h>. Notes: svn path=/head/; revision=126039
* style cleanup: Remove duplicate $FreeBSD$ tags.Colin Percival2004-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) Notes: svn path=/head/; revision=125668
* Use 'uint32_t' instead of 'long' when a 32-bit integer is intended.David Schultz2004-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) Notes: svn path=/head/; revision=124738
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorAlexander Kabaev2003-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) Notes: svn path=/head/; revision=123674
* Implement __cxa_atexit/__cxa_finalize as specified by the cross-vendorAlexander Kabaev2003-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) Notes: svn path=/head/; revision=123673
* Do not adjust to the pagesize at runtime. Besides for the one-timeMarcel Moolenaar2003-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 Notes: svn path=/head/; revision=123031
* Improve the performance of radixsort() whenTim Kientzle2003-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) Notes: svn path=/head/; revision=122458
* Externalize malloc's spinlock so that a thread library can takeDaniel Eischen2003-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 Notes: svn path=/head/; revision=122069
* Remove incomplete support for running FreeBSD userland on old NetBSD kernelsTim J. Robbins2003-10-291-3/+1
| | | | | | | lacking the issetugid() and utrace() syscalls. Notes: svn path=/head/; revision=121667
* Don peril sensitive (ie: bikeshed sensitive) sunglasses and quietlyPeter Wemm2003-10-282-408/+1
| | | | | | | | | | | | | | send strhash(3) off to sleep with the fishes. Nothing in our tree uses it. It has no documentation. It is nonstandard and in spite of the filename strhash.c and strhash.h, it lives in application namespace by providing compulsory global symbols hash_create()/hash_destroy()/hash_search()/ hash_traverse()/hash_purge()/hash_stats() regardless of whether you #include <strhash.h> or not. If it turns out that there is a huge application for this after all, I can repocopy it somewhere safer and we can revive it elsewhere. But please, not in libc! Notes: svn path=/head/; revision=121639
* Consistently cast to (u_char *) when filling with junk.Poul-Henning Kamp2003-10-251-3/+3
| | | | Notes: svn path=/head/; revision=121518
* Style changes. Inching closer to convergence with OpenBSD.Poul-Henning Kamp2003-10-251-61/+60
| | | | Notes: svn path=/head/; revision=121500
* Cite the published version of "Engineering a Sort Function" instead ofTim J. Robbins2003-09-301-4/+7
| | | | | | | an email address. Spell McIlroy correctly. Notes: svn path=/head/; revision=120598
* More style fixes to improve diffability with OpenBSD.Poul-Henning Kamp2003-09-271-46/+54
| | | | | | | Pull 'A' evilness for realloc(3) from OpenBSD. Notes: svn path=/head/; revision=120524
* Style changes to improve diffability against OpenBSD version.Poul-Henning Kamp2003-09-271-91/+91
| | | | Notes: svn path=/head/; revision=120520
* Get rid of duplicates.Ruslan Ermilov2003-09-142-2/+2
| | | | Notes: svn path=/head/; revision=120054
* mdoc(7): Properly mark C headers.Ruslan Ermilov2003-09-101-1/+1
| | | | Notes: svn path=/head/; revision=119964
* mdoc(7): Use the new feature of the .In macro.Ruslan Ermilov2003-09-082-2/+2
| | | | Notes: svn path=/head/; revision=119893
* Replace some syscalls with libc version, this makes abort work better withDavid Xu2003-08-161-10/+7
| | | | | | | | | libkse. Tested under libc_r, libkse, libthr. Reviewed by: deischen Notes: svn path=/head/; revision=118988
* For type 0 rng lower initial drop to 50, it is enough to hide linearityAndrey A. Chernov2003-08-101-1/+5
| | | | | | | Reorganize historic #ifdef section Notes: svn path=/head/; revision=118731
* Cross-reference arc4random(3).David Schultz2003-07-311-0/+4
| | | | Notes: svn path=/head/; revision=118248
* Minor constification.Poul-Henning Kamp2003-07-291-2/+2
| | | | Notes: svn path=/head/; revision=118153
* mdoc(7) fix: Use the normal AT&T macro (.At) rather than itsRuslan Ermilov2003-06-281-1/+1
| | | | | | | internal string in the macro context. Notes: svn path=/head/; revision=117007
* mdoc policeDavid E. O'Brien2003-06-251-6/+6
| | | | Notes: svn path=/head/; revision=116843
* Be more specific in BUGS.David E. O'Brien2003-06-251-5/+7
| | | | | | | | | Submitted by: ru Add history. Notes: svn path=/head/; revision=116834
* Assorted mdoc(7) fixes.Ruslan Ermilov2003-06-011-27/+28
| | | | Notes: svn path=/head/; revision=115631
* Clarify the code a bit.Poul-Henning Kamp2003-06-011-1/+2
| | | | | | | Submitted by: Nadav Eiron <nadav@TheEirons.org> Notes: svn path=/head/; revision=115610
* Fix grammar bogons.Jens Schweikhardt2003-05-311-1/+1
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=115571
* Fix stripping last path component when only one path component left.Max Khon2003-05-281-2/+2
| | | | | | | | PR: 52686 MFC after: 1 day Notes: svn path=/head/; revision=115362
* Assorted mdoc(7) fixes.Ruslan Ermilov2003-05-221-5/+6
| | | | | | | Approved by: re (blanket) Notes: svn path=/head/; revision=115225
* Back out the `hiding' of strlcpy and strlcat. Several peopleJacques Vidrine2003-05-011-6/+6
| | | | | | | vocally objected to this safety belt. Notes: svn path=/head/; revision=114443
* Tell malloc.c that AMD64 uses the same pagesize as i386.Peter Wemm2003-04-301-0/+4
| | | | Notes: svn path=/head/; revision=114321
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referenceJacques Vidrine2003-04-291-6/+6
| | | | | | | | | | technique) so that we don't wind up calling into an application's version if the application defines them. Inspired by: qpopper's interfering and buggy version of strlcpy Notes: svn path=/head/; revision=114256