summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Don't pull <math.h> just because it can return HUGE_VAL in themartynas2013-01-151-3/+2
| | | | corner cases. OK millert@.
* Fix bug in random offset introduced in rev 1.143; random range wasotto2012-12-221-3/+3
| | | | expanded, but not enough due to precedence error. Spotted by Thorsten Glaser.
* Remove excessive sys/cdefs.h inclusionderaadt2012-12-051-2/+1
| | | | ok guenther millert kettenis
* no need for .Pp before lists;jmc2012-12-051-3/+2
|
* Rewritten posix_openpt manual that doesn't include any of the POSIXmillert2012-12-041-74/+49
| | | | text. OK deraadt@
* Use "path name" not "pathname".millert2012-12-041-3/+3
|
* Simple emulation of POSIX pty APIs posix_openpt(), ptsname(),millert2012-12-034-6/+414
| | | | | grantpt() and unlockpt() using /dev/ptm. Man pages from FreeBSD. OK kettenis@ deraadt@ beck@ ajacoutot@ naddy@
* Ensure that the base provided to strtol(3) is between 2 and 36 inclusive,jsing2012-11-181-1/+12
| | | | | | or the special value of 0. ok deraadt@ otto@
* Per POSIX, fix raise() and abort() to send the signal to the current thread.guenther2012-11-101-3/+5
| | | | | | Should make coredumps from abort() easier to debug too. ok kurt@
* Add a new malloc option 'U' => "Free unmap" that does the guarding/djm2012-11-022-18/+36
| | | | | | | | | | | | unmapping of freed allocations without disabling chunk randomisation like the "Freeguard" ('F') option does. Make security 'S' option use 'U' and not 'F'. Rationale: guarding with no chunk randomisation is great for debugging use-after-free, but chunk randomisation offers better defence against "heap feng shui" style attacks that depend on carefully constructing a particular heap layout so we should leave this enabled when requesting security options.
* Make setenv(3) consistent with unsetenv(3), giving EINVAL if passedjeremy2012-09-232-20/+10
| | | | | | an empty name, NULL pointer, or a name containing an '=' character. OK millert@, guenther@
* remove some wacky Xo/Xc;jmc2012-09-161-3/+3
|
* remove tahoe-specific makefile machinery, no such hardware is known to bemiod2012-09-151-5/+1
| | | | | in working condition anymore (assuming there would be interest in running on it).
* Document that strtod functions accept INF, NAN, NAN(). From Michal Mazurek.martynas2012-09-151-3/+28
|
* specify the bounds of the dst to strlcat (both values were static andderaadt2012-09-131-2/+2
| | | | | equal, but it is more correct) from Michal Mazurek
* Fix precedence bug (& has lower precedence than !=).pirofti2012-09-131-2/+2
| | | | | | Okay otto@. Found by Michal Mazurek <akfaew at jasminek dot net>, thanks!
* remove lint leftovers; ok guenther@okan2012-09-041-5/+1
|
* use PAGE_SHIFT instead of PGSHIFT, in preperation for futurederaadt2012-07-091-2/+2
| | | | | param.h symbol reduction. ok guenther
* Zap extra spaces from function pointer argumentsguenther2012-07-082-8/+8
| | | | Pointed out by Joachim Schipper (joachim at joachimschipper.nl)
* Describe tdelete()'s return value correctly and update the related CAVEATguenther2012-07-081-12/+15
| | | | | Based on a note from Steffen Daode Nurpmeso (sdaoden at googlemail.com) ok jmc@
* after a talk with ariane, use MAP_FIXED for mquery to avoid the cost oftedu2012-06-261-2/+2
| | | | | | scanning for free space if the hint isn't available. also, on further inspection, this will prevent pmap_prefer from "improving" our hint.
* two changes which should improve realloc. first, fix zapcacheregion totedu2012-06-221-10/+19
| | | | | | clear out the entire requested area, not just a perfect fit. second, use mquery to check for room to avoid getting an address we don't like and having to send it back.
* two small fixes to free page cache. first, we need two nibbles of randomtedu2012-06-201-4/+4
| | | | | | in order to span the the entire cache. second, on free use the same offset to put things in the cache instead of always starting at zero. ok otto
* Support larger-than-page-alignment requests in posix_memalign() bymatthew2012-06-182-23/+130
| | | | | | overallocating and then releasing unneeded memory pages. ok otto
* Update STANDARDS section for a few <stdlib.h> functionsguenther2012-06-023-9/+29
| | | | | | Update SYNOPSIS for setkey() to show it's in <stdlib.h> ok jmc@, millert@
* Improve standards conformance: ecvt(), fcvt(), gcvt(), mktemp(), ttyslot(),guenther2012-06-013-8/+11
| | | | | | | and valloc() are not in the current version, while posix_memalign() mkstemp(), and mkdtemp() are, and setstate()'s argument has lost a bogus 'const'. ok millert@ jmc@ espie@ kettenis@; ports build testing by naddy@
* alloca is NOT machine dependent; it has exactly the samederaadt2012-04-121-7/+3
| | | | | effective result. its use is NOT discouraged -- it is not common, but when you need it, there is nothing else that will do.
* Fix a bug where random() always returns 0 when srandom() is seededmillert2012-03-211-2/+3
| | | | | with 0. Use 1 and not 0 as the first element of the state array, similar to what glibc does. OK nicm@
* - Test for the retrieved page address not being NULL. This turns free((void*)1)otto2012-02-291-2/+7
| | | | | | into an bogus pointer error instead of a segfault. - Document that we use the assumption that a non-MAP_FIXED mmap() with hint 0 never returns NULL.
* Revert previous diff as it resulted in the wrong return code whenguenther2012-02-061-5/+3
| | | | | | | the last node is deleted. Instead, resolve the Coverity warning by returning (node *)1 when you delete the root node. based an idea from millert@. ok otto@
* Complete the HISTORY of all syscalls that exist since Version 1 AT&T UNIX.schwarze2011-11-171-2/+11
| | | | | All facts from http://minnie.tuhs.org/cgi-bin/utree.pl, checked by sobrado@. Feedback and ok jmc@ jmc@ (sic, Jason checked and ok'ed this twice).
* Make struct chunk_info a variable sized struct, wasting lessotto2011-10-061-28/+55
| | | | | space for meta data by only allocating space actually needed for the bitmap (modulo alignment requirements). ok deraadt@
* some minor tweaks;jmc2011-09-031-2/+2
|
* make -column lists pretty again;jmc2011-09-031-3/+3
| | | | | | | | | | specifically, rewrite them to permit some markup in the column headers, and use "Ta" instead of literal tabs; mandoc does not currently match groff 100%, but a mandoc fix may be some time off, and we've gone enough releases with poorly formatting column lists. in some cases i have rewritten the lists as -tag, where -column made little sense.
* in column lists, enforce the following ordering:jmc2011-08-301-3/+3
| | | | | | | | | .Bl -column header1 header2 ... <Bl flags> mixing things up confuses mandoc, and adding flags in can screw up the list. this hopefully just makes things a bit safer (and more consistent). (one more bit of work left and all column lists should format how we want)
* occured -> occurred;jmc2011-07-241-2/+2
|
* Recent Single Unix will malloc memory if the second argument of realpath()miod2011-07-242-17/+52
| | | | | | is NULL, and third-party software is starting to rely upon this. Adapted from FreeBSD via Jona Joachim (jaj ; hcl-club , .lu), with minor tweaks from nicm@ and yours truly.
* Show (in the example) that < and > can be used multiple times; ok jmc@otto2011-07-221-4/+5
| | | | jasper@
* - add a MALLOC_OPTIONS section header. the content is already there, but havingjasper2011-07-211-3/+3
| | | | | | a section will help people looking for just the MALLOC_OPTIONS. ok otto@ jmc@
* on malloc flag S, set cache size to 0; will catch even moreotto2011-07-121-2/+6
| | | | use-after-free bugs; ok krw@ dlg@ pirofti@
* no more math(3);jmc2011-07-079-32/+23
|
* as man page states, lower case undoes upper case. add support for little s,tedu2011-06-201-1/+5
| | | | | no security, for consistency. use of this option is discouraged. :) ok deraadt guenther millert
* save errno dance in wrterror() and malloc_dump(); prompted by and ok deraadt@otto2011-05-201-2/+6
|
* introduce symbolic constant for initial number of regionsotto2011-05-181-2/+3
|
* zap regions_bits and rework MALLOC_MAXSHIFT a bit; ok djm@otto2011-05-181-14/+8
|
* Avoid fp computations for stats, this make calling malloc_dump() safe in moreotto2011-05-121-10/+7
| | | | cases.
* fix comment, the bitmap is an array of u_short nowotto2011-05-121-2/+2
|
* Introduce leak detection code for MALLOC_STATSotto2011-05-121-25/+165
|
* Move MALLOC_STATS code to bottom of file, so the real stuff is more at the top.otto2011-05-081-137/+141
|
* Up until now, malloc scanned the bits of the chunk bitmap fromotto2011-05-051-32/+24
| | | | | | | | | | | | | | | | | | position zero, skipping a random number of free slots and then picking the next free one. This slowed things down, especially if the number of full slots increases. This changes the scannning to start at a random position in the bitmap and then taking the first available free slot, wrapping if the end of the bitmap is reached. Of course we'll still scan more if the bitmap becomes more full, but the extra iterations skipping free slots and then some full slots are avoided. The random number is derived from a global, which is incremented by a few random bits every time a chunk is needed (with a small optimization if only one free slot is left). Thanks to the testers!