summaryrefslogtreecommitdiff
path: root/src/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* To allow for easier playing with more strict settings introduceotto2008-11-131-5/+14
| | | | | a separate symbolic constant for the leeway we allow when moving allocations towards the end of a page. No functional change.
* avoid a few strlen calls for constant strings; prompted by tg; ok djm@otto2008-11-121-10/+10
|
* if the freeprot flag (F) is set, do not do delayed frees for chunksotto2008-11-061-6/+10
| | | | | | (might catch errors closer to the trouble spot) and junk fill pages just before reuse instead of immediate (we can't access the page anyway) since we set PROT_NONE in the F case. ok djm@
* fix markup of example line and description of G flag; partly from andotto2008-11-021-5/+4
| | | | ok jmc@
* remove distinction between warnings and errors, ok deraadt@ djm@otto2008-11-022-73/+38
|
* if MALLOC_STATS is defined, record how many "cheap reallocs" wereotto2008-10-291-1/+8
| | | | tried and how many actually succeeded.
* oops, assign errno the right way. caught by david running regress testsotto2008-10-201-2/+2
|
* reduce rbyte cache to 512 bytes, no measurable slowdown (even in theotto2008-10-031-2/+2
| | | | threaded case) but much smaller working set; prompted by and ok deraadt@
* save and restore errno on success. while it is not stricly needed forotto2008-10-031-4/+14
| | | | | non-syscalls, there's just too much code not doing the right thing on error paths; prompted by and ok deraadt@
* zap __arc4_getbyte(), it was only used by the old malloc; ok millert@otto2008-10-031-14/+1
| | | | kurt@
* when increasing the size of a larger than a page allocation tryotto2008-10-031-3/+41
| | | | | mapping the region next to the existing one first; there's a pretty high chance there's a hole there we can use; ok deraadt@ tedu@
* avoid spitting up regions when purging stuff from the cache, it putsotto2008-10-031-17/+10
| | | | too much pressure on the amaps. ok tedu@ deraadt@
* document strtold. ok millert@martynas2008-09-132-11/+25
|
* strtof has been introduced in c99martynas2008-09-131-4/+6
| | | | from Thomas Pfaff. ok millert@
* - replace dtoa w/ David's gdtoa, version 2008-03-15martynas2008-09-073-2500/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - provide proper dtoa locks - use the real strtof implementation - add strtold, __hdtoa, __hldtoa - add %a/%A support - don't lose precision in printf, don't round to double anymore - implement extended-precision versions of libc functions: fpclassify, isnan, isinf, signbit, isnormal, isfinite, now that the ieee.h is fixed - separate vax versions of strtof, and __hdtoa - add complex math support. added functions: cacos, casin, catan, ccos, csin, ctan, cacosh, casinh, catanh, ccosh, csinh, ctanh, cexp, clog, cabs, cpow, csqrt, carg, cimag, conj, cproj, creal, cacosf, casinf, catanf, ccosf, csinf, ctanf, cacoshf, casinhf, catanhf, ccoshf, csinhf, ctanhf, cexpf, clogf, cabsf, cpowf, csqrtf, cargf, cimagf, conjf, cprojf, crealf - add fdim, fmax, fmin - add log2. (adapted implementation e_log.c. could be more acruate & faster, but it's good enough for now) - remove wrappers & cruft in libm, supposed to work-around mistakes in SVID, etc.; use ieee versions. fixes issues in python 2.6 for djm@ - make _digittoint static - proper definitions for i386, and amd64 in ieee.h - sh, powerpc don't really have extended-precision - add missing definitions for mips64 (quad), m{6,8}k (96-bit) float.h for LDBL_* - merge lead to frac for m{6,8}k, for gdtoa to work properly - add FRAC*BITS & EXT_TO_ARRAY32 definitions in ieee.h, for hdtoa&ldtoa to use - add EXT_IMPLICIT_NBIT definition, which indicates implicit normalization bit - add regression tests for libc: fpclassify and printf - arith.h & gd_qnan.h definitions - update ieee.h: hppa doesn't have quad-precision, hppa64 does - add missing prototypes to gdtoaimp - on 64-bit platforms make sure gdtoa doesn't use a long when it really wants an int - etc., what i may have forgotten... - bump libm major, due to removed&changed symbols - no libc bump, since this is riding on djm's libc major crank from a day ago discussed with / requested by / testing theo, sthen@, djm@, jsg@, merdely@, jsing@, tedu@, brad@, jakemsr@, and others. looks good to millert@ parts of the diff ok kettenis@ this commit does not include: - man page changes
* remove now obsolete calloc implementation; prompted by miodotto2008-09-031-50/+0
|
* do not overflow for large prefix len (e.g. 2147483649)markus2008-09-011-3/+3
| | | | report Maksymilian Arciemowicz; ok djm, deraadt
* Make all combinations of G, P, J and zero-fill work with as littleotto2008-08-251-5/+20
| | | | effort as possible in most cases; ok djm@
* unbreak MALLOC_OPTIONS=G that I broke in my last commit;djm2008-08-231-3/+3
| | | | slightly kludgey solution for until otto fixes it properly; ok otto@
* fix calloc() for MALLOC_OPTIONS=J case: SOME_JUNK was being filled intodjm2008-08-231-2/+2
| | | | | the freshly mmaped pages disrupting their pure zeroness; ok otto@ deraadt@
* unbreak wcschr(string, L'\0') which was incorrectly returning NULLdjm2008-08-231-3/+5
| | | | rather than a pointer to the terminating nul; ok deraadt@
* make sure we always map and unmap multiples of MALLOC_PAGESIZE;otto2008-08-221-5/+14
| | | | case spotted by beck, one by me; ok deraadt@ beck@
* Smarter implementation of calloc(3), which uses the fact that mmap(2)otto2008-08-222-8/+57
| | | | | returns zero filled pages; remember to replace this function as well if you provide your own malloc implementation; ok djm@ deraadt@
* Add resolv.conf(5) option to force lookups by TCP: "options tcp"djm2008-08-151-18/+20
| | | | | | | | | | | | | | Also Extend "nameserver" declaration syntax to support port numbers. To avoid ambiguity these are only parsed when the address is enclosed in square brackets, e.g. "nameserver [127.0.0.1]:5353" Together these changes make forwarding DNS over a SSH tunnel very easy, but unfortunately some programs in ports/ implement their own resolvers (e.g. firefox). These will need to be modified to support these options separately. fixes jsing@ reyk@ ok deraadt@ millert@ krw@ + "I like it" from lots
* small cleanup of error/warning stringsotto2008-08-072-7/+7
|
* man page bits for new malloc; ok jmc@otto2008-07-281-43/+33
|
* Almost complete rewrite of malloc, to have a more efficient dataotto2008-07-281-1443/+835
| | | | | | structure of tracking pages returned by mmap(). Lots of testing by lots of people, thanks to you all. ok djm@ (for a slighly earlier version) deraadt@
* First pass at removing clauses 3 and 4 from NetBSD licenses.ray2008-06-262-18/+4
| | | | | | | | | Not sure what's more surprising: how long it took for NetBSD to catch up to the rest of the BSDs (including UCB), or the amount of code that NetBSD has claimed for itself without attributing to the actual authors. OK deraadt@
* remove _thread_malloc_init prototypeotto2008-06-141-2/+1
|
* grammar fixes;jmc2008-06-131-3/+3
|
* remove _MALLOC_LOCK_INIT; major bump; ok deraadt@otto2008-06-132-8/+2
|
* Add strtof() to libc, some ports seem to like it. Currently it's a simplelandry2008-06-133-9/+64
| | | | | | | call to strtod() with bounding check. Discussed with pyr@ and otto@ ok otto@ deraadt@
* fix an Xr, and use a more appropriate macro;jmc2008-06-091-4/+4
|
* arc4random_stir() does not use /dev/arandom anymore, but sysctl kern.arandomderaadt2008-06-081-4/+6
|
* fix math screwup that reintroduced a bias for upper_bounds in rangedjm2008-06-041-2/+2
| | | | | | | (2^30,2^31). Nothing in the tree yet requests random numbers bounded by this range. report jakob!deraadt; ok deraadt@
* kill an Xr to a non-existent man page, ulimit(1);jmc2008-05-201-5/+3
|
* remove recalloc(3); it is buggy and impossible to repair without bigotto2008-05-193-62/+20
| | | | costs; ok jmc@ for the man page bits; ok millert@ deraadt@
* garbage collect the portability bits for the removed select() support.brad2008-05-111-11/+1
| | | | ok djm@ deraadt@
* convert select() => poll(), saves a runtime malloc+free per retrydjm2008-04-181-23/+16
| | | | feedback deraadt@ drahn@; ok deraadt@
* permit _ in the middle of a DNS name componentderaadt2008-04-161-2/+3
|
* Improve the libc DNS resolver ID generation algorithm to be moredjm2008-04-131-43/+79
| | | | | | | resistant to prediction atacks by wrapping the existing LCG in a random permutation generator based on a Luby-Rackoff block cipher. lots of discussion and final ok deraadt@
* Use arc4random_buf() when requesting more than a single word of outputdjm2008-04-131-2/+2
| | | | | | | Use arc4random_uniform() when the desired random number upper bound is not a power of two ok deraadt@ millert@
* - do not call pthread_atfork(3) handlers when a multithreaded programkurt2008-04-041-2/+7
| | | | | | calls vfork(2). "untested, but looks OK" marc@ - document vfork(2), popen(3) and system(3) don't call atfork handlers in multithreaded programs. okay jmc@
* Zero state buffers on return. OK deraadt@millert2008-04-021-1/+5
|
* bcmp(3) tries to return length, which is a size_t, as an int.ray2008-03-191-4/+4
| | | | | | | | Instead, just return 1 if there is a difference. Found by lint. OK millert.
* - add NAME entries for arc4random_buf and arc4random_uniformjmc2008-03-161-2/+4
| | | | - simplify a macro call (Do/Dc -> Dq)
* Add missing MLINKSderaadt2008-03-161-1/+2
|
* diff from djm@ committed at his request:otto2008-03-162-3/+84
| | | | | | | | | | | | | | introduce two new APIs for requesting strong random numbers: arc4random_buf() - fill an arbitrary memory range with random numbers arc4random_uniform() - return a uniformly distributed random number below a specified upper bound, avoiding the bias that comes from a naive "arc4random() % upper_bound" construction. these mirror similarly-named functions in the kernel; lots of discussion deraadt@ mcbride@
* - len is size_t, but n uses len and is an int. Matching those typesray2008-03-151-6/+12
| | | | | | | | | | | | | | | should be good, plus it prevents weird things from happening if len > INT_MAX. - Since n is now size_t, compare it against 0 instead of >= 0. - temp is used to store individual bytes, so use char instead (matches fp and tp). - millert noted that the comma operator may not guarantee order of execution, so replace with semicolons. Found by lint, OK millert.
* Convert c to unsigned char, like it says in the manual. Also addray2008-03-151-4/+3
| | | | | | cast to make it explicit. Found by lint, OK millert.