summaryrefslogtreecommitdiff
path: root/src/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* 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.
* use pgfree pool like other code does to reserve free list slots.otto2008-02-201-6/+6
| | | | | prevents a few "cannot free mem because i need mem to free mem" scenarios (one found by weingart@). ok weingart@ millert@ miod@
* - make arc4random*() functions thread safe. Use a custom spinlock functionkurt2008-01-012-42/+69
| | | | | | | | | | | instead of the generic pthread macros since free(3) uses __arc4_getbyte() when freeing small sized allocations and the generic pthread macros call malloc(3). - eliminate passing pointers to a static variable with global scope (rs) for additional code clarity and reduction. - shlib minor bumps for libc and libpthread due to new functions. From andreas@ with some bits from me. okay tedu@ marc@ w/some spot checking from millert@
* typos; ok jmc@martynas2007-11-271-2/+2
| | | | sys/dev/pci/pciide.c from naddy@
* fix misleading comment; the _MUTEX_LOCK/_MUTEX_UNLOCK macros work withkurt2007-11-191-2/+2
| | | | both static and non-static mutexs.
* Put limits.h in front of stdlib.h as style(9) recommends.tobias2007-11-132-8/+8
| | | | OK millert@
* strtod may return HUGE_VAL on overflow, which is defined in math.h.tobias2007-11-111-2/+3
| | | | | | Therefore added math.h to SYNPOSIS. OK millert@
* Add parentheses to avoid warning:chl2007-10-311-2/+2
| | | | | | "suggest parentheses around && within ||" ok millert@
* Make sure to use unique target names so that make -j does not break;miod2007-10-251-25/+25
| | | | feedback and ok espie@
* use RRSIG instead of SIG for DNSSEC. ok djm@jakob2007-10-113-6/+7
|
* add a RETURN VALUES section.pyr2007-10-081-9/+9
| | | | ok jmc@
* add HISTORY; shortened version of diff from Ilya A. Kovalenkojmc2007-09-191-2/+7
| | | | ok millert
* Check snprintf(3) return value for error or truncation.moritz2007-09-171-1/+5
| | | | | | Mostly path construction, where truncation could be bad. ok and input from deraadt@ millert@ ray@
* Add missing header to avoid warningchl2007-09-051-1/+2
| | | | ok millert@ ray@
* no need to talk about bits; ok millert jmcderaadt2007-09-051-3/+3
|
* Update free(3) section--we use mmap()/munmap(), not brk().millert2007-09-031-4/+6
| | | | Based on a diff from Mike Belopuhov. OK jmc@
* remove trailing whitespace;jmc2007-09-031-2/+2
|
* Add __cxa_atexit() support for gcc3. This provides support for shared ↵millert2007-09-034-30/+108
| | | | object destructors called at dlclose() time. Inspired by similar changes in FreeBSD and NetBSD.
* add recaloc(3)millert2007-09-033-20/+62
|
* add memrchr(3)millert2007-09-033-5/+63
|
* use calloc() to avoid malloc(n * m) overflows; checked by djm canacar jsgderaadt2007-09-026-12/+12
|
* Clarify the example about avoiding overflow. OK ray@ deraadt@millert2007-08-081-3/+3
|
* Show how to use strcspn(3) to trim newlines.ray2007-08-081-2/+14
| | | | OK jmc and millert.
* /*FALLTHRU*/ -> /* FALLTHROUGH */ray2007-08-051-2/+2
|
* Reference limits.h, not sys/param.h since we document using PATH_MAXmillert2007-07-061-3/+3
| | | | OK otto@
* from ginsbach@netbsd, -r1.18:jmc2007-07-031-2/+7
| | | | | | | | Document that getopt_long(3) can and will accept unique abbreviated long option names. This feature has been present since getopt_long(3) was first released in NetBSD 1.5. This is also standard GNU getopt_long(3) behavior. ok millert
* Document behavior when no conversion could be performed. Adaptedmillert2007-06-292-5/+17
| | | | from FreeBSD. With help from jmc@.
* ``dot'' notationjmc2007-06-121-19/+9
| | | | | | | is more readable than `.' notation zap some silly .Tn whilst here;
* _FD_LOCK/UNLOCK() is libpthread specific and not needed for librthread, sokurt2007-06-051-21/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | isolate its usage to libpthread only and replace with generic non-static mutex support in the one place it is needed: - remove _FD_LOCK/UNLOCK from lseek and ftruncate in libc and make the functions weak so that libpthread can override with its own new versions that do the locking. - remove _thread_fd_lock/unlock() weak functions from libc and adjust libpthread for the change. - add generic _thread_mutex_lock/unlock/destroy() weak functions in libc to support non-static mutexes in libc and add libpthread and librthread implementations for them. libc can utilize non-static mutexes via the new _MUTEX_LOCK/UNLOCK/DESTROY() macros. Actually these new macros can support both static and non-static mutexes but currently only using them for non-static. - make opendir/closedir/readdir/readdir_r/seekdir/telldir() thread-safe for both thread libraries by using a non-static mutex in the struct _dirdesc (typedef DIR), utilizing it in the *dir functions and remove remaining and incorrect _FD_LOCK/UNLOCK() use in libc. - add comments to both thread libraries to indicate libc depends on the current implementation of static mutex initialization. suggested by marc@ - major bump libc and libpthread due to function removal, structure change and weak symbol conversions. okay marc@, tedu@
* remove ipx-related stuff. objections nobody. major bump by kurt in a fewhenning2007-06-054-385/+3
|
* convert to new .Dd format;jmc2007-05-31103-206/+206
|
* Typos.ray2007-05-201-3/+3
| | | | OK jmc@.
* Remove no-op code. From tbert.ray2007-05-181-3/+1
| | | | OK moritz@ and jaredy@
* Improve reentrancy by not using global variable. Removes tworay2007-05-171-31/+11
| | | | | | wrappers around fopen/fclose. From tbert. OK millert@, tedu@, and itojun@.
* Wrap some functions, labels, and variables in #ifdefs correspondingray2007-05-162-2/+8
| | | | | | | to #ifdefs where they are used. Found by lint by bret dot lambert at gmail. OK deraadt@.
* Use size_t for strlen results.ray2007-05-121-4/+6
| | | | OK moritz@.
* Clean up macros according to style. From tbert <bret dot lambert at gmail>.ray2007-05-121-27/+27
| | | | OK moritz@ and jaredy@.
* Use syslog_r instead of syslog in getaddrinfo. Slowly makingray2007-05-101-4/+9
| | | | | | getaddrinfo reentrant. OK millert@ and deraadt@.
* macros at start of line require a `.';jmc2007-05-021-2/+2
|
* Document the lack of error return value in arc4random.pyr2007-05-021-1/+4
| | | | Sync the documentation in getpid with arc4random's format.
* Support for optional args separated with whitespace was removedmillert2007-04-101-17/+1
| | | | some time ago--it caused too many problems.