summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* 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
* MFp4: Link strtof.3 and strtold.3 to strtod.3.Tim J. Robbins2003-04-051-0/+1
| | | | Notes: svn path=/head/; revision=113105
* BDE'ifyMax Khon2003-03-291-79/+89
| | | | Notes: svn path=/head/; revision=112823
* fix truncation check and buffer overflow checkMax Khon2003-03-291-11/+11
| | | | Notes: svn path=/head/; revision=112820
* - MAXPATHLEN -> PATH_MAX (pass correct buffer size to readlink as well)Max Khon2003-03-281-17/+17
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=112743
* Make realpath() thread-safe. New implementation does not use chdir(2) at all.Max Khon2003-03-272-111/+128
| | | | | | | Submitted by: Constantin S. Svintsoff <kostik (at) iclub.nsu.ru> Notes: svn path=/head/; revision=112726
* According to C99 decimal_point can't be emptyAndrey A. Chernov2003-03-201-4/+1
| | | | Notes: svn path=/head/; revision=112427
* The gdtoa import apparently hasn't caused anything or anyone toDavid Schultz2003-03-151-2429/+0
| | | | | | | | explode, so nix the old strtod() / dtoa(). This change is part of the gdtoa patches reviewed on standards@. Notes: svn path=/head/; revision=112257
* Document strtof() and strtold(). Update vendor license.David Schultz2003-03-121-32/+75
| | | | | | | Reviewed by: bde (briefly), mike (mentor), obrien Notes: svn path=/head/; revision=112164
* Replace our ancient dtoa/strtod implementation with the gdtoaDavid Schultz2003-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | package, a more recent, generalized set of routines. Among the changes: - Declare strtof() and strtold() in stdlib.h. - Add glue to libc to support these routines for all kinds of ``long double''. - Update printf() to reflect the fact that dtoa works slightly differently now. As soon as I see that nothing has blown up, I will kill src/lib/libc/stdlib/strtod.c. Soon printf() will be able to use the new routines to output long doubles without loss of precision, but numerous bugs in the existing code must be addressed first. Reviewed by: bde (briefly), mike (mentor), obrien Notes: svn path=/head/; revision=112163
* Document the fact that hdestory calls free on the keys added withDavid Malone2003-03-121-5/+25
| | | | | | | | | | hsearch(.., ENTER). Make the example reflect this. PR: 49951 Submitted by: Peter Jeremy <peterjeremy@optushome.com.au> Notes: svn path=/head/; revision=112143
* Fix typo.Robert Drehmel2003-02-251-1/+1
| | | | Notes: svn path=/head/; revision=111503
* Use strlcpy instead of strncpy.Johan Karlsson2003-02-221-2/+1
| | | | | | | | Submitted by: imp Reviewed by: silence on -audit Notes: svn path=/head/; revision=111261
* Back out "drop first N values" method of removing monotonically increasedAndrey A. Chernov2003-02-171-7/+1
| | | | | | | | | | | | | | | | | | seed->first value correlation. It breaks rand_r()... Other possible methods like shuffling inside aray will breaks rand_r() too, because it assumes only one word state, i.e. nothing extra can be added after seed assignment in srand(). BTW, for old formulae seed->first value correlation is not so monotonically increased as with other Linear Congruential Generators of this type only becase arithmetic overflow happens. But overflow affects distribution and lower bits very badly, as many articles says, such type of overflow not improves PRNG. So, monotonically increased seed->first value correlation problem remains... Notes: svn path=/head/; revision=111026
* Since we drop NSHUFF values now, set default seed to what it becomesAndrey A. Chernov2003-02-051-3/+3
| | | | | | | after srand(1) Notes: svn path=/head/; revision=110421
* For rand(3) and random(3) TYPE_0 drop NSHUFF values right after srand{om}()Andrey A. Chernov2003-02-042-6/+15
| | | | | | | | | | to remove part of seed -> 1st value correlation. Correlation still remains because of algorithm limits. Note that old algorithm have even stronger correlation, especially in the lower bits area, but not eye-visible, as current one. Notes: svn path=/head/; revision=110321
* Park & Miller PRNG can be safely initialized with any value but 0 and stuckAndrey A. Chernov2003-02-032-2/+8
| | | | | | | | | | at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not works since 2147483647 seed returns to 0 again on the next interation. Instead of after calculation mapping, map 0 to another value _before_ calculation, so it never stucks. Notes: svn path=/head/; revision=110280
* For some combinations of variable sizes and RAND_MAX value rand_r()Andrey A. Chernov2003-02-021-2/+4
| | | | | | | may store less amount bits for seed, than available. Fix it. Notes: svn path=/head/; revision=110236
* Catch some cases where asking for ridiculously large allocations couldPoul-Henning Kamp2003-01-301-0/+4
| | | | | | | result in a segfault. Instead just return NULL. Notes: svn path=/head/; revision=110103
* Add an MLINK malloc.conf(5) -> malloc(3).Mike Barcroft2003-01-241-1/+2
| | | | Notes: svn path=/head/; revision=109803
* For "sensitive" processes, we always set the 'A' flag which causes abort()Poul-Henning Kamp2003-01-231-0/+7
| | | | | | | | | | | | | | | | to be called on first sight of trouble. "sensitive" is somewhat arbitrarily defined as "setuid, setgid, uid == root or gid == wheel". The 'A' option carries no performance penalty. It is not possible to override this setting: fix the program instead. Absentmindedly nodded OK to by: various Notes: svn path=/head/; revision=109754
* realpath(3) should use PATH_MAX instead of MAXPATHLEN according to POSIX.Johan Karlsson2003-01-152-9/+9
| | | | | | | | | | | This also reverts the PATH_MAX -> MAXPATHLEN part of rev 1.3 of src/bin/realpath/realpath.c Requested by: imp Reviewed by: imp, bde Notes: svn path=/head/; revision=109331
* strfmon(3) does not correctly handle multibyte characters in theTim J. Robbins2003-01-061-0/+6
| | | | | | | format string. Notes: svn path=/head/; revision=108776
* No need to include <assert.h> here.Tim J. Robbins2003-01-054-4/+0
| | | | Notes: svn path=/head/; revision=108694
* Fix three warnings:Tim J. Robbins2003-01-041-2/+2
| | | | | | | | | o #include <stdio.h> to make sprintf()'s prototype visible. o Remove unused variable: sbuf. o Don't use assignment as truth value. Notes: svn path=/head/; revision=108646
* style(9): return type on separate line from function name.Tim J. Robbins2003-01-042-2/+4
| | | | Notes: svn path=/head/; revision=108644