summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* get cheaper random bytes, less waste and no getpid() calls, which areotto2007-02-121-2/+3
| | | | done by arc4random(); ok millert@ deraadt@
* fix some dodgy displays;jmc2007-02-061-2/+2
|
* sync with the code: int -> intmax_tsteven2007-01-161-3/+3
| | | | ok jmc@
* advertising clauses that can be droppedderaadt2007-01-081-6/+2
|
* a failed mmap returns MAP_FAILED, not NULL. found while exercising paxotto2006-12-191-3/+3
| | | | in low-mem conditions; ok dim@
* columns for underflow and overflow were swapped, noticed by Mathieu Oliviergrunk2006-11-021-2/+2
| | | | | | <molivier at users dot sourceforge dot net> ok jmc@ mickey@
* must pull in sys/types.h unconditionaly, because it is needed my pthreadsderaadt2006-10-301-2/+2
| | | | includes used a bit later (for instance on the vax)
* make __dtoa & strtod() thread-safe useing the same method as newer gdtoaderaadt2006-10-293-36/+89
| | | | | codebase. tested mostly by ckuethe and myself. __dtoa() use now requires a call to __freedtoa()
* respond to ben hawkes's ruxcon presentation.tedu2006-10-241-61/+125
| | | | | | | | | | | | | create special allocators for pginfo and pgfree structs instead of imalloc. this keeps them separated from application memory. for chunks, to prevent deterministic reuse, keep a small array and swizzle the to be freed chunk with a random previously freed chunk. this last bit only for chunks because keeping arbitrarily large regions of pages around may cause out of memory issues (and pages are, to some extent, returned in random order). all changes enabled by default. thanks to ben for pointing out these issues. ok tech@
* __mips64__ handling too.. sighderaadt2006-10-131-4/+5
|
* sparc64 should be in the #ifdefderaadt2006-10-121-2/+2
|
* use __amd64__ instead, until lint is fixedderaadt2006-10-121-2/+2
|
* reorder #if tests because apparently on amd64 cpp proceeds to blow it'sderaadt2006-10-121-3/+4
| | | | own brains out, and then takes lint down with it. To be investigated...
* Teach'em about cpus in spandexmiod2006-10-101-4/+4
|
* from wiz@netbsd:jmc2006-10-041-8/+1
| | | | | | Log Message: Switch from 4-clause to 2-clause BSD license. Ok dillo@, board@.
* Make a var volatile, which forces a mem write at the right spot, andotto2006-10-011-2/+7
| | | | | | detctecion of underflow where it would otherwise not happen for FPUs that have a larger register size than sizeof double (i386, m68k). ok deraadt@ weingart@ kettenis@
* Back out change in rev 1.15 of to allow whitespace to separate amillert2006-09-221-10/+1
| | | | | | | | | flag from its optional argument if permutation is disabled. The idea was that since "r:" would match "-r foo" then "r::" should match "-r foo" too as long as we know that things have not been reshuffled. Unfortunately, this causes incompatibilities with GNU getopt_long when the POSIXLY_CORRECT environment variable is set. OK deraadt@
* Fix 'double by a factor of two' and make cache options a bit morepedro2006-06-061-4/+4
| | | | descriptive while at it, input and okay jmc@
* fix a !foo & bar.thib2006-05-191-2/+2
| | | | ok miod@, tedu@, pedro@
* Fix the second malloc_ulimit regression: maintaining the free listotto2006-05-141-3/+12
| | | | | | requires memory; try to make sure we have it. If all fails, leak instead of crash. Test case originally found by cloder@, fix tested by many.
* strtonum does not require limits.htedu2006-04-251-2/+1
| | | | spotted by ray some time ago
* Do not leave an hole in the directory list if allocation of theotto2006-04-241-11/+32
| | | | | | | region succeeds, but allocation a required page dir failed. This can happen if we're really close to ulimit after allocation the region of the size requested. See malloc_ulimit1 regress test. Tested by many; thanks.
* delint; original from deraadt@ with fixes from tdeval@ and me;otto2006-04-181-43/+60
| | | | tested by quite a few developers. ok deraadt@
* POSIX says tdelete() returns the parent of the deleted node. Sadly theotto2006-04-041-1/+9
| | | | | | root node doesn't have a parent, and POSIX does not say what should be done in that case. Warn developers that different implementations may do different things.
* When tdelete() is used to delete the root node, don't return amoritz2006-04-042-3/+5
| | | | | | | | | | pointer to the freed root node, but return a pointer to the new root node. POSIX does not define, what should be returned in that case. Fixes Coverity CID 2528. ok millert@ otto@
* Use SIZE_MAX instead of SIZE_T_MAX, the latter is not POSIX andotto2006-04-022-4/+4
| | | | remove redundant check on size. ok millert@ deraadt@
* Xr to strtonum(3), because vice versa is already the casegrunk2006-03-291-1/+2
| | | | ok jmc@ otto@
* Add warning about malloc(num * size) and recommend calloc() instead,ray2006-03-261-5/+40
| | | | | | | | or if malloc must be used suggest check. Get rid of "one". OK deraadt@ and jmc@, OK kjell@ to earlier version with "one"s.
* Removes extraneous variables from getopt(3). Inspired by one ofray2006-03-151-3/+1
| | | | | | David Hill's diffs. ok otto
* Avouid a race in atexit() handling by introducing a lock. Problemotto2006-02-221-9/+20
| | | | | originally reported by Gergely Kovacs; help from dhartmei@; ok tedu@ millert@
* quick path for free(0)espie2006-02-141-5/+5
| | | | `looks to be safe' millert, okay tedu.
* document posixness;jmc2006-01-302-9/+7
| | | | fixes pr #4996, from joachim schipper;
* missing auxillary verbjakemsr2006-01-181-2/+2
| | | | "yes, that is correct." jmc@ (a while back)
* back out previous - imaxabs is already listed;jmc2006-01-151-2/+1
|
* Xr imaxabs()millert2006-01-141-1/+2
|
* fix the .Fn line; ok millertjmc2006-01-141-2/+2
|
* sort SEE ALSO;jmc2006-01-141-2/+2
|
* Add lldiv(), imaxabs(), imaxdiv(), strtoimax() and strtoumax()millert2006-01-1317-74/+685
|
* Return inf or nan as per printf() not Inf, Infinity or Nan (from dtoa)millert2006-01-102-11/+15
| | | | Remove an extraneous check for dtoa returning Inf/Nan
* Use localeconv() to get the locale-specific radix char like printf does.millert2006-01-101-3/+6
|
* Nan and Infinity can be negativemillert2006-01-101-6/+12
| | | | | | | Decimal point was missing for some exponential output Only divide sign by 10 once per loop Add a missing NUL terminator for one case If there is no whole number portion, print a leading zero (e.g. 0.1 not .1)
* Prototypes live in <search.h>millert2005-12-231-1/+2
|
* Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a timeotto2005-11-302-42/+14
| | | | | | | and remove fallback code. If somebody is dumb enough to make the sysctl fail using systrace, he deserves what he gets. Saves 7 syscalls on process startup. looks good miod@ ok deraadt@ tedu@
* add $OpenBSD$ tags, as requested by dtucker.espie2005-11-101-0/+1
|
* Remove obsolete comment. ok deraadt@otto2005-10-261-5/+1
|
* clarifications from ray lai;jmc2005-10-261-3/+5
| | | | tweaked by tedu@ and myself;
* dont' -> don't in comments;jmc2005-10-251-2/+2
| | | | from ray lai;
* tidy up examplesjaredy2005-10-113-17/+16
| | | | | | | | - use err() for error handling - add lint hints - spacing nits and missing braces ok otto
* fix a few warnings, keep the crypt stuff for later.espie2005-10-101-2/+2
| | | | okay otto@
* Remove a few warnings. Those were not apparent thanks to a bug in gcc 2.95.espie2005-10-101-3/+3
| | | | | Patch by Leonardo Chiquitto Filho <leonardo@iken.com.br> Thanks.