summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
AgeCommit message (Collapse)Author
2012-12-22Fix bug in random offset introduced in rev 1.143; random range wasOtto Moerbeek
expanded, but not enough due to precedence error. Spotted by Thorsten Glaser.
2012-12-05Remove excessive sys/cdefs.h inclusionTheo de Raadt
ok guenther millert kettenis
2012-12-05no need for .Pp before lists;Jason McIntyre
2012-12-04Rewritten posix_openpt manual that doesn't include any of the POSIXTodd C. Miller
text. OK deraadt@
2012-12-04Use "path name" not "pathname".Todd C. Miller
2012-12-03Simple emulation of POSIX pty APIs posix_openpt(), ptsname(),Todd C. Miller
grantpt() and unlockpt() using /dev/ptm. Man pages from FreeBSD. OK kettenis@ deraadt@ beck@ ajacoutot@ naddy@
2012-11-18Ensure that the base provided to strtol(3) is between 2 and 36 inclusive,Joel Sing
or the special value of 0. ok deraadt@ otto@
2012-11-10Per POSIX, fix raise() and abort() to send the signal to the current thread.Philip Guenthe
Should make coredumps from abort() easier to debug too. ok kurt@
2012-11-02Add a new malloc option 'U' => "Free unmap" that does the guarding/Damien Miller
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.
2012-09-23Make setenv(3) consistent with unsetenv(3), giving EINVAL if passedJeremy Evans
an empty name, NULL pointer, or a name containing an '=' character. OK millert@, guenther@
2012-09-16remove some wacky Xo/Xc;Jason McIntyre
2012-09-15remove tahoe-specific makefile machinery, no such hardware is known to beMiod Vallat
in working condition anymore (assuming there would be interest in running on it).
2012-09-15Document that strtod functions accept INF, NAN, NAN(). From Michal Mazurek.Martynas Venckus
2012-09-13specify the bounds of the dst to strlcat (both values were static andTheo de Raadt
equal, but it is more correct) from Michal Mazurek
2012-09-13Fix precedence bug (& has lower precedence than !=).Paul Irofti
Okay otto@. Found by Michal Mazurek <akfaew at jasminek dot net>, thanks!
2012-09-04remove lint leftovers; ok guenther@Okan Demirmen
2012-07-09use PAGE_SHIFT instead of PGSHIFT, in preperation for futureTheo de Raadt
param.h symbol reduction. ok guenther
2012-07-08Zap extra spaces from function pointer argumentsPhilip Guenthe
Pointed out by Joachim Schipper (joachim at joachimschipper.nl)
2012-07-08Describe tdelete()'s return value correctly and update the related CAVEATPhilip Guenthe
Based on a note from Steffen Daode Nurpmeso (sdaoden at googlemail.com) ok jmc@
2012-06-26after a talk with ariane, use MAP_FIXED for mquery to avoid the cost ofTed Unangst
scanning for free space if the hint isn't available. also, on further inspection, this will prevent pmap_prefer from "improving" our hint.
2012-06-22two changes which should improve realloc. first, fix zapcacheregion toTed Unangst
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.
2012-06-20two small fixes to free page cache. first, we need two nibbles of randomTed Unangst
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
2012-06-18Support larger-than-page-alignment requests in posix_memalign() byMatthew Dempsky
overallocating and then releasing unneeded memory pages. ok otto
2012-06-02Update STANDARDS section for a few <stdlib.h> functionsPhilip Guenthe
Update SYNOPSIS for setkey() to show it's in <stdlib.h> ok jmc@, millert@
2012-06-01Improve standards conformance: ecvt(), fcvt(), gcvt(), mktemp(), ttyslot(),Philip Guenthe
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@
2012-04-12alloca is NOT machine dependent; it has exactly the sameTheo de Raadt
effective result. its use is NOT discouraged -- it is not common, but when you need it, there is nothing else that will do.
2012-03-21Fix a bug where random() always returns 0 when srandom() is seededTodd C. Miller
with 0. Use 1 and not 0 as the first element of the state array, similar to what glibc does. OK nicm@
2012-02-29- Test for the retrieved page address not being NULL. This turns free((void*)1)Otto Moerbeek
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.
2012-02-06Revert previous diff as it resulted in the wrong return code whenPhilip Guenthe
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@
2011-11-17Complete the HISTORY of all syscalls that exist since Version 1 AT&T UNIX.Ingo Schwarze
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).
2011-10-06Make struct chunk_info a variable sized struct, wasting lessOtto Moerbeek
space for meta data by only allocating space actually needed for the bitmap (modulo alignment requirements). ok deraadt@
2011-09-03some minor tweaks;Jason McIntyre
2011-09-03make -column lists pretty again;Jason McIntyre
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.
2011-08-30in column lists, enforce the following ordering:Jason McIntyre
.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)
2011-07-24occured -> occurred;Jason McIntyre
2011-07-24Recent Single Unix will malloc memory if the second argument of realpath()Miod Vallat
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.
2011-07-22Show (in the example) that < and > can be used multiple times; ok jmc@Otto Moerbeek
jasper@
2011-07-21- add a MALLOC_OPTIONS section header. the content is already there, but havingJasper Lievisse Adriaanse
a section will help people looking for just the MALLOC_OPTIONS. ok otto@ jmc@
2011-07-12on malloc flag S, set cache size to 0; will catch even moreOtto Moerbeek
use-after-free bugs; ok krw@ dlg@ pirofti@
2011-07-07no more math(3);Jason McIntyre
2011-06-20as man page states, lower case undoes upper case. add support for little s,Ted Unangst
no security, for consistency. use of this option is discouraged. :) ok deraadt guenther millert
2011-05-20save errno dance in wrterror() and malloc_dump(); prompted by and ok deraadt@Otto Moerbeek
2011-05-18introduce symbolic constant for initial number of regionsOtto Moerbeek
2011-05-18zap regions_bits and rework MALLOC_MAXSHIFT a bit; ok djm@Otto Moerbeek
2011-05-12Avoid fp computations for stats, this make calling malloc_dump() safe in moreOtto Moerbeek
cases.
2011-05-12fix comment, the bitmap is an array of u_short nowOtto Moerbeek
2011-05-12Introduce leak detection code for MALLOC_STATSOtto Moerbeek
2011-05-08Move MALLOC_STATS code to bottom of file, so the real stuff is more at the top.Otto Moerbeek
2011-05-05Up until now, malloc scanned the bits of the chunk bitmap fromOtto Moerbeek
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!
2011-04-30Now that we use an array of u_short for the chunk bitmap change a fewOtto Moerbeek
1UL to 1U.