summaryrefslogtreecommitdiff
path: root/src/lib/libc (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* from wiz@netbsd:jmc2006-10-041-8/+1
| | | | | | Log Message: Switch from 4-clause to 2-clause BSD license. Ok dillo@, board@.
* Make a var volatile, which forces a mem write at the right spot, andotto2006-10-011-2/+7
| | | | | | detctecion of underflow where it would otherwise not happen for FPUs that have a larger register size than sizeof double (i386, m68k). ok deraadt@ weingart@ kettenis@
* Part 2 of file descriptor race and deadlock corrections.kurt2006-09-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adjust design of file descriptor table to eliminate races with both opening and closing of file descriptor entries and eliminates one class of deadlocks. One nice side effect of this change in design should be better performance for applications that open and close many file descriptors due to reduced fd_table_lock contention and fd entry reuse. - Add entry states to manage use of entry and eliminate some closing races. fd entries are not deallocated upon close() now. - Call _thread_fd_table_init with one of five discreet modes to properly initialize an entry and manage the state transition to open. - When closing an entry hold the entry spinlock locked across the state transition and the _thread_sys_close call to close another race. - Introduce a new lock type FD_RDWR_CLOSE that transitions either a closed entry or an open entry into closing state and then waits for a RDWR lock so that the lock queue can unwind normally. All subsequent fd lock attempts for that entry are rejected with EBADF until the fd is fully closed, or reopened by dup2(). Once a thread holds the FD_RDWR_LOCK it is safe to close() it or dup2() on it. - When a thread creates a new fd there is a window of time when another thread could attempt to use the fd before the creating thread has initialized the entry for it. This can result in improper status_flags for the entry, so record the entries init mode, detect when this has happened and correct the status_flags when needed. reviewed by marc@ & brad@, tested by several, okay brad@
* Remove unnecessary /* NOTREACHED */ comments because our lint isray2006-09-252-20/+8
| | | | | | cool and recognizes __dead, and because shorter examples are clearer. OK otto@.
* If fgetln() != NULL, len == 0 is impossible, so remove check.ray2006-09-231-3/+3
| | | | OK otto@ and jaredy@.
* Back out change in rev 1.15 of to allow whitespace to separate amillert2006-09-221-10/+1
| | | | | | | | | flag from its optional argument if permutation is disabled. The idea was that since "r:" would match "-r foo" then "r::" should match "-r foo" too as long as we know that things have not been reshuffled. Unfortunately, this causes incompatibilities with GNU getopt_long when the POSIXLY_CORRECT environment variable is set. OK deraadt@
* no point mentioning functions if we have nothing useful to sayjmc2006-08-051-13/+1
| | | | | | about them; ok djm
* wording/grammar tweaks;jmc2006-07-261-3/+4
|
* better macros;jmc2006-07-261-6/+6
|
* document `iv';jmc2006-07-261-1/+4
| | | | | from eren elci; tweaked by djm ok djm
* updates from nicholas marriott;jmc2006-07-251-5/+9
| | | | re-worded and ok djm
* allocate gsalt large enough; from Matthew R. Dempsky <mrd at alkemiootto2006-07-041-2/+2
| | | | dot org>; ok djm@ deraadt@
* Fix 'double by a factor of two' and make cache options a bit morepedro2006-06-061-4/+4
| | | | descriptive while at it, input and okay jmc@
* fix a !foo & bar.thib2006-05-191-2/+2
| | | | ok miod@, tedu@, pedro@
* Fix the second malloc_ulimit regression: maintaining the free listotto2006-05-141-3/+12
| | | | | | requires memory; try to make sure we have it. If all fails, leak instead of crash. Test case originally found by cloder@, fix tested by many.
* Convert do {} while loop -> while {} for clarity. No binary changemillert2006-05-052-10/+10
| | | | on most architectures. From Oliver Smith. OK deraadt@ and henning@
* strtonum does not require limits.htedu2006-04-251-2/+1
| | | | spotted by ray some time ago
* Do not leave an hole in the directory list if allocation of theotto2006-04-241-11/+32
| | | | | | | region succeeds, but allocation a required page dir failed. This can happen if we're really close to ulimit after allocation the region of the size requested. See malloc_ulimit1 regress test. Tested by many; thanks.
* delint; original from deraadt@ with fixes from tdeval@ and me;otto2006-04-181-43/+60
| | | | tested by quite a few developers. ok deraadt@
* Clarify strlcpy code by explicitly naming variable `len' andray2006-04-181-5/+6
| | | | | | | separating out each step. Inspired during miscommunication with tedu@. OK deraadt@
* fix badly broken code. okay millert@, deraadt@espie2006-04-171-7/+7
|
* Remove str2number(), use strtonum(3) instead.ray2006-04-141-44/+20
| | | | | | | | Fix some type mismatches. Replace magic numbers. Remove superfluous strlen(3) calls. Earlier diff OK kjell@, OK deraadt@
* POSIX says tdelete() returns the parent of the deleted node. Sadly theotto2006-04-041-1/+9
| | | | | | root node doesn't have a parent, and POSIX does not say what should be done in that case. Warn developers that different implementations may do different things.
* When tdelete() is used to delete the root node, don't return amoritz2006-04-042-3/+5
| | | | | | | | | | pointer to the freed root node, but return a pointer to the new root node. POSIX does not define, what should be returned in that case. Fixes Coverity CID 2528. ok millert@ otto@
* be more careful with atoi() result; ok ottoderaadt2006-04-031-3/+5
|
* Use SIZE_MAX instead of SIZE_T_MAX, the latter is not POSIX andotto2006-04-022-4/+4
| | | | remove redundant check on size. ok millert@ deraadt@
* (char)to{upper,lower}()deraadt2006-03-312-6/+6
|
* oldmask = sigprocmask(SIG_BLOCK, &mask, &oldmask);deraadt2006-03-311-1/+1
| | | | is not valid code; found by lint
* Xr to strtonum(3), because vice versa is already the casegrunk2006-03-291-1/+2
| | | | ok jmc@ otto@
* Add warning about malloc(num * size) and recommend calloc() instead,ray2006-03-261-5/+40
| | | | | | | | or if malloc must be used suggest check. Get rid of "one". OK deraadt@ and jmc@, OK kjell@ to earlier version with "one"s.
* Pass size of correct variable to memset().ray2006-03-221-2/+2
| | | | | | From Alexey Dobriyan. OK otto@
* Removes extraneous variables from getopt(3). Inspired by one ofray2006-03-151-3/+1
| | | | | | David Hill's diffs. ok otto
* Avouid a race in atexit() handling by introducing a lock. Problemotto2006-02-222-10/+32
| | | | | originally reported by Gergely Kovacs; help from dhartmei@; ok tedu@ millert@
* quick path for free(0)espie2006-02-141-5/+5
| | | | `looks to be safe' millert, okay tedu.
* document posixness;jmc2006-01-302-9/+7
| | | | fixes pr #4996, from joachim schipper;
* missing auxillary verbjakemsr2006-01-181-2/+2
| | | | "yes, that is correct." jmc@ (a while back)
* Include limits.h directly instead of depending on another headermillert2006-01-172-2/+4
| | | | to include it for us.
* Include <sys/param.h> instead of <sys/types.h> so we get MAXHOSTNAMELENmillert2006-01-171-2/+2
|
* back out previous - imaxabs is already listed;jmc2006-01-151-2/+1
|
* Xr imaxabs()millert2006-01-141-1/+2
|
* fix the .Fn line; ok millertjmc2006-01-141-2/+2
|
* sort SEE ALSO;jmc2006-01-141-2/+2
|
* Add lldiv(), imaxabs(), imaxdiv(), strtoimax() and strtoumax()millert2006-01-1317-74/+685
|
* Return inf or nan as per printf() not Inf, Infinity or Nan (from dtoa)millert2006-01-102-11/+15
| | | | Remove an extraneous check for dtoa returning Inf/Nan
* Use localeconv() to get the locale-specific radix char like printf does.millert2006-01-101-3/+6
|
* Nan and Infinity can be negativemillert2006-01-101-6/+12
| | | | | | | Decimal point was missing for some exponential output Only divide sign by 10 once per loop Add a missing NUL terminator for one case If there is no whole number portion, print a leading zero (e.g. 0.1 not .1)
* Currently sys/socket.h needs sys/types.h so add #include <sys/types.h> toclaudio2005-12-303-3/+6
| | | | | the list of necessary includes. Now the manpages match reality. OK mpf@ millert@
* Prototypes live in <search.h>millert2005-12-231-1/+2
|
* handle chroot and res_init calls better. diagnosis assistance from otto.tedu2005-12-221-21/+18
| | | | ok deraadt otto.
* Use sysctl(KERN_ARND) to get n bytes, instead of just 4 at a timeotto2005-11-303-51/+16
| | | | | | | and remove fallback code. If somebody is dumb enough to make the sysctl fail using systrace, he deserves what he gets. Saves 7 syscalls on process startup. looks good miod@ ok deraadt@ tedu@