summaryrefslogtreecommitdiff
path: root/src/lib/libc/stdlib (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove cast of int* to int*guenther2015-09-141-2/+2
|
* For now, permit overriding of the malloc family, to make emacs happyguenther2015-09-131-6/+6
|
* Overshot w/PROTO_DEPRECATED: seed48_deterministic() is used internallyguenther2015-09-131-1/+2
|
* Wrap <stdlib.h> so that calls go direct and the symbols not in theguenther2015-09-1320-24/+49
| | | | | | C standard are all weak. Apply __{BEGIN,END}_HIDDEN_DECLS to gdtoa{,imp}.h, hiding the arch-specific __strtorx, __ULtox_D2A, __strtorQ, __ULtoQ_D2A symbols.
* Wrap <inttypes.h> and finish wrapping of <wchar.h> so that calls go directguenther2015-09-122-2/+4
| | | | and the symbols not in the C standard are weak
* Wrap <getopt.h> to make the functions weak and make access to the initializedguenther2015-09-121-1/+6
| | | | variables go direct. (Common variables cannot be aliased.)
* Pull in namespace.h when building all .c files using gcc's -include option,guenther2015-09-101-2/+1
| | | | | | | | so that we can provide asm labels for the memcpy/memset/__stack_smash_handler calls that it generates ab initio. Eliminate direct #includes of it. Make sure it's a dependency of all objects (unnecessary for asm, but close enough). ok deraadt@
* reduce .Nd to one line and kill .Tn while hereschwarze2015-09-105-25/+15
|
* missing commas at the end of .Nm lines in the NAME sectionschwarze2015-09-101-3/+3
|
* Move the __rand48_* declarations into rand48.h, and then hide both themguenther2015-08-277-25/+13
| | | | | | and __dorand48() and __rand48_deterministic ok deraadt@
* All these files include <stdlib.h>, so do not need to castderaadt2015-08-202-5/+5
| | | | malloc/calloc/realloc* returns.
* Just return if nmemb is 0. Avoids a NULL dereference and ismillert2015-06-211-1/+4
| | | | | consistent with the behavior of the other libc sort functions. OK deraadt@
* Add dlclose(3) to SEE ALSOguenther2015-05-121-2/+3
| | | | ok millert@ jmc@ schwarze@
* When checking flags that will be passed to open(), test the O_ACCMODE portionguenther2015-05-111-2/+3
| | | | | | separately to avoid false negatives. ok miod@ millert@
* Another couple of commas in the wrong place, ok jmcnicm2015-04-141-3/+3
|
* Make pthread_atfork() track the DSO that called it like atexit() does,guenther2015-04-071-1/+19
| | | | | | | | | | unregistering callbacks if the DSO is unloaded. Move the callback handling from libpthread to libc, though libpthread still overrides the inner call to handle locking and thread-library reinitialization. Major version bump for both libc and libpthread. verification that this fixes various ports ajacoutot@ asm assistance miod@; ok millert@ deraadt@
* improve realloc. when expanding a region, actually use the free page cachetedu2015-04-061-7/+16
| | | | | instead of simply zapping it. this can save many syscalls in a program that repeatedly grows and shrinks a buffer, as observed in the wild.
* remove incorrect statement. the standard *does* require calloc to checktedu2015-03-141-7/+2
| | | | | for overflow. stop talking about old broken systems, there's little use for such info.
* lsearch and lfind return void *tedu2015-02-151-4/+4
|
* Use .Rv where appropriate, and move it to RETURN VALUES;schwarze2015-01-292-18/+7
| | | | | remove .Tn, and a few minor macro adjustments. Patch from Kaspars at Bankovskis dot net.
* Improve wording in alloca.tedu2015-01-171-7/+5
| | | | | | | 1. it's not a bug; it's a caveat. 2. "slightly unsafe" gives me the willies. 3. one .Xr to malloc should suffice ok deraadt jmc
* Move to the <limits.h> universe.deraadt2015-01-163-9/+6
| | | | review by millert, binary checking process with doug, concept with guenther
* missing , found by Dongsheng Songderaadt2015-01-081-3/+3
|
* rename kern enter/exit macros to malloc enter/leave to better reflecttedu2015-01-051-7/+7
| | | | what's going on.
* typo; ok deraadtsthen2014-12-162-3/+3
|
* warn for correct symbolderaadt2014-12-161-2/+2
|
* Xr and Ox fixes;jmc2014-12-093-12/+18
|
* random seed buffer must be unsignedderaadt2014-12-091-2/+2
|
* fix NAME;jmc2014-12-091-3/+3
|
* improve warnings from rand_r(), rand(), and random()libressl-v2.1.2deraadt2014-12-092-3/+8
| | | | | It may take a few iterations to get the tone right. previously discussed with millert
* more standardsier: cast to int to make sure we keep the negative numbers.tedu2014-12-091-2/+2
| | | | observed by jonas termansen
* Oops, got the sense of the test backwards. Hilarious that we didn't spot it.deraadt2014-12-081-1/+1
|
* Change rand(), random(), drand48(), lrand48(), mrand48(), and srand48()deraadt2014-12-0813-159/+267
| | | | | | | | | | | | | | | | | to returning strong random by default, source from arc4random(3). Parameters to the seeding functions are ignored, and the subsystems remain in strong random mode. If you wish the standardized deterministic mode, call srand_deterministic(), srandom_determistic(), srand48_deterministic(), seed48_deterministic() or lcong48_deterministic() instead. The re-entrant functions rand_r(), erand48(), nrand48(), jrand48() are unaffected by this change and remain in deterministic mode (for now). Verified as a good roadmap forward by auditing 8800 pieces of software. Roughly 60 pieces of software will need adaptation to request the deterministic mode. Violates POSIX and C89, which violate best practice in this century. ok guenther tedu millert
* remove cfree from documentationtedu2014-12-081-19/+3
|
* delete obsolete sunos cfree function. ok deraadt millert naddytedu2014-12-082-42/+3
|
* avoid left shift overflow in reallocarray.bcook2014-12-081-2/+2
| | | | | | | | Some 64-bit platforms (e.g. Windows 64) have a 32-bit long. So, shifting 1UL 32-bits to the left causes an overflow. This replaces the constant 1UL with (size_t)1 so that we get the correct constant size for the platform. discussed with tedu@ & deraadt@
* malloc(3) is in the "comp" install set, malloc.conf(5) in "man",schwarze2014-12-062-128/+10
| | | | | | breaking the hardlink between file system entries, confusing apropos(1). Split malloc.conf(5) out of malloc(3) as suggested by deraadt@. Feedback and OK jmc@, OK deraadt@ tedu@ jasper@.
* Replace all 14 instances of .St -ansiC-99 in our tree with .St -isoC-99.schwarze2014-11-3010-30/+30
| | | | | | The former is not used anywhere in NetBSD, FreeBSD, or DragonFly and not supported by groff, so i'm going to delete it from mandoc(1). We don't need two macros for the same thing.
* obvious STANDARDS updateschwarze2014-11-302-14/+10
|
* rand() is a pseudo-random number generatormillert2014-11-251-3/+3
|
* Don't describe random() as "better".millert2014-11-251-5/+5
| | | | | Remove the bug about rand() being faster. Add a bug about historical implementations seeding very poorly.
* Warn people to use arc4random() in DESCRIPTION so they see it usingmillert2014-11-251-5/+8
| | | | the same text from random.3.
* Document behavior of atexit() when called in a DSO that is later unloaded.guenther2014-11-201-2/+14
| | | | | | | | Would be nice to document when/where this originated (in glibc?) if anyone knows... tweaks by schwarze@ ok jmc@ espie@ kettenis@ schwarze@ dimitry(at)google.com
* Reduce instances of `` '' in manuals.bentley2014-11-151-5/+5
| | | | | | | | | | | | troff displays these as typographic quotes, but nroff implementations almost always print them literally, which rarely has the intended effect with modern fonts, even in stock xterm. These uses of `` '' can be replaced either with more semantic alternatives or with Dq, which prints typographic quotes in a UTF-8 locale (but will automatically fall back to `` '' in an ASCII locale). improvements and ok schwarze@
* clean up verbiage around the calculations; ok ingo jmc ottoderaadt2014-10-301-5/+5
|
* Don't mention old systems where realloc(NULL, n) didn't work as wemillert2014-10-301-11/+7
| | | | | don't want to give people the idea that this is non-portable (it has been present since C89). OK deraadt@ schwarze@
* Save space in man page: err() -> errc() and combine vars.doug2014-10-231-18/+11
| | | | | | Suggested by millert@ and schwarze@. OK schwarze@, millert@
* Avoid writing in second person in malloc.3doug2014-10-221-13/+12
| | | | ok deraadt@
* List extensions in the STANDARDS section, replacing some text below CAVEATS.schwarze2014-10-201-33/+30
| | | | | Remove excessive technicalities on zero-sized objects as suggested by deraadt@. contributions and ok deraadt@, ok jmc@ on an earlier version
* make RETURN VALUES more conciseschwarze2014-10-191-77/+28
| | | | | and fix two instances of "new sentence, new line" while here feedback and ok jmc@, ok doug@