summaryrefslogtreecommitdiff
path: root/lib/libc/stdlib
Commit message (Collapse)AuthorAgeFilesLines
* Since we drop NSHUFF values now, set default seed to what it becomesAndrey A. Chernov2003-02-051-3/+3
| | | | | | | after srand(1) Notes: svn path=/head/; revision=110421
* For rand(3) and random(3) TYPE_0 drop NSHUFF values right after srand{om}()Andrey A. Chernov2003-02-042-6/+15
| | | | | | | | | | to remove part of seed -> 1st value correlation. Correlation still remains because of algorithm limits. Note that old algorithm have even stronger correlation, especially in the lower bits area, but not eye-visible, as current one. Notes: svn path=/head/; revision=110321
* Park & Miller PRNG can be safely initialized with any value but 0 and stuckAndrey A. Chernov2003-02-032-2/+8
| | | | | | | | | | at 0 as designed. Its BSD adaptation tries to fight it by mapping 0 to 2147483647 after calculation, but this method not works since 2147483647 seed returns to 0 again on the next interation. Instead of after calculation mapping, map 0 to another value _before_ calculation, so it never stucks. Notes: svn path=/head/; revision=110280
* For some combinations of variable sizes and RAND_MAX value rand_r()Andrey A. Chernov2003-02-021-2/+4
| | | | | | | may store less amount bits for seed, than available. Fix it. Notes: svn path=/head/; revision=110236
* Catch some cases where asking for ridiculously large allocations couldPoul-Henning Kamp2003-01-301-0/+4
| | | | | | | result in a segfault. Instead just return NULL. Notes: svn path=/head/; revision=110103
* Add an MLINK malloc.conf(5) -> malloc(3).Mike Barcroft2003-01-241-1/+2
| | | | Notes: svn path=/head/; revision=109803
* For "sensitive" processes, we always set the 'A' flag which causes abort()Poul-Henning Kamp2003-01-231-0/+7
| | | | | | | | | | | | | | | | to be called on first sight of trouble. "sensitive" is somewhat arbitrarily defined as "setuid, setgid, uid == root or gid == wheel". The 'A' option carries no performance penalty. It is not possible to override this setting: fix the program instead. Absentmindedly nodded OK to by: various Notes: svn path=/head/; revision=109754
* realpath(3) should use PATH_MAX instead of MAXPATHLEN according to POSIX.Johan Karlsson2003-01-152-9/+9
| | | | | | | | | | | This also reverts the PATH_MAX -> MAXPATHLEN part of rev 1.3 of src/bin/realpath/realpath.c Requested by: imp Reviewed by: imp, bde Notes: svn path=/head/; revision=109331
* strfmon(3) does not correctly handle multibyte characters in theTim J. Robbins2003-01-061-0/+6
| | | | | | | format string. Notes: svn path=/head/; revision=108776
* No need to include <assert.h> here.Tim J. Robbins2003-01-054-4/+0
| | | | Notes: svn path=/head/; revision=108694
* Fix three warnings:Tim J. Robbins2003-01-041-2/+2
| | | | | | | | | o #include <stdio.h> to make sprintf()'s prototype visible. o Remove unused variable: sbuf. o Don't use assignment as truth value. Notes: svn path=/head/; revision=108646
* style(9): return type on separate line from function name.Tim J. Robbins2003-01-042-2/+4
| | | | Notes: svn path=/head/; revision=108644
* Add missing #include "namespace.h".Tim J. Robbins2003-01-031-0/+1
| | | | Notes: svn path=/head/; revision=108625
* Remove unused variable: ntmp.Tim J. Robbins2003-01-031-1/+0
| | | | Notes: svn path=/head/; revision=108624
* #include <string.h> for strcmp()'s prototype.Tim J. Robbins2003-01-031-1/+2
| | | | Notes: svn path=/head/; revision=108623
* Implement POSIX grantpt(3) functionality, and add a pt_chown utility (akinJuli Mallett2003-01-023-7/+491
| | | | | | | | | | | to Solaris, it is in /usr/libexec) to perform the handing over of tty nodes to the user being granted the pty. Submitted by: Ryan Younce <ryany@pobox.com> Reviewed by: security-officer@, standards@, mike@ Notes: svn path=/head/; revision=108574
* Correct typos, mostly s/ a / an / where appropriate. Some whitespace cleanup,Jens Schweikhardt2003-01-011-1/+1
| | | | | | | especially in troff files. Notes: svn path=/head/; revision=108533
* mdoc(7) police: Deal with self-xrefs.Ruslan Ermilov2002-12-241-1/+1
| | | | Notes: svn path=/head/; revision=108257
* Document what really occurs when we obtain an error.Tom Rhodes2002-12-201-6/+9
| | | | | | | | PR: 43357 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> Notes: svn path=/head/; revision=108113
* mdoc(7) police: "The .Fa argument.".Ruslan Ermilov2002-12-192-1/+5
| | | | Notes: svn path=/head/; revision=108087
* mdoc(7) police: Fixed abuses of the .Ar and .Em macros.Ruslan Ermilov2002-12-1810-31/+32
| | | | Notes: svn path=/head/; revision=108040
* mdoc(7) police: "The .Fn function".Ruslan Ermilov2002-12-187-10/+34
| | | | Notes: svn path=/head/; revision=108037
* mdoc(7) police: sort xrefs in SEE ALSO.Ruslan Ermilov2002-12-131-1/+1
| | | | Notes: svn path=/head/; revision=107826
* Uniformly refer to a file system as "file system".Ruslan Ermilov2002-12-121-1/+1
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107788
* mdoc(7) police: overhaul.Ruslan Ermilov2002-12-091-109/+232
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107705
* mdoc(7) police: nits.Ruslan Ermilov2002-12-091-15/+18
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107704
* Consistently mark std(in|out|err) with .Dv, because that's how theyRuslan Ermilov2002-12-042-3/+7
| | | | | | | | | | are marked up in stdio(3), and because they are defined expressions of type "FILE *". Approved by: re Notes: svn path=/head/; revision=107619
* mdoc(7) police: sweep.Ruslan Ermilov2002-11-291-11/+13
| | | | Notes: svn path=/head/; revision=107391
* mdoc(7) police: formatting nits.Ruslan Ermilov2002-11-293-12/+32
| | | | | | | Approved by: re Notes: svn path=/head/; revision=107387
* libc_r wasn't so tied to libc for 22 months.Ruslan Ermilov2002-11-181-5/+3
| | | | Notes: svn path=/head/; revision=107052
* Define `Sudden_Underflow' when compiling for the AlphaRobert Drehmel2002-11-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | architecture, mainly to avoid getting a SIGFPE signal sent when calling strtod(3) with certain input. The SIGFPE has been sent because the code was not aware that a Gradual Underflow is handled in software via traps on the Alpha architecture, but is not implemented in our Alpha kernel layer. With `Sudden_Underflow' defined, strtod(3) should not depend on Gradual Underflow and adjust its calculations accordingly, which means that other, more subtle errors than the sending of SIGFPE could be solved by this. Discussed with: bde PR: alpha/12623 PR: alpha/17032 PR: alpha/43567 MFC after: 7 days Notes: svn path=/head/; revision=106918
* de-__P()Alfred Perlstein2002-10-161-3/+3
| | | | Notes: svn path=/head/; revision=105299
* - Remove the lsearch() and lfind() functions and their manpage fromRobert Drehmel2002-10-163-2/+165
| | | | | | | | | | | | the compatibility library libcompat. - Add new implementations of lsearch() and lfind() which conform to IEEE Std 1003.1-2001 to libc. Add a new manual page for them and add them to the makefile. - Add function prototypes for lsearch() and lfind() to the search.h header. Notes: svn path=/head/; revision=105250
* Remove unneeded $FreeBSD$ tags.Robert Drehmel2002-10-162-4/+0
| | | | Notes: svn path=/head/; revision=105246
* - Remove the old insque() and remque() functions and their manualRobert Drehmel2002-10-164-5/+144
| | | | | | | | | | | | page from the compatibility library. - Add new implementations of insque() and remque() which conform to IEEE Std 1003.1-2001 to libc. Add a new manual page for them and connect them to the build. - Add the prototypes of insque() and remque() to the search.h header. Notes: svn path=/head/; revision=105245
* Fix a typo causing incorrect formatting for negative values in some localesTim J. Robbins2002-10-121-3/+5
| | | | | | | | | (at least the French ones), a memory leak upon successful termination, a pointer arithmetic error causing heap corruption, and an off-by-one bug causing incorrect amounts of padding at the right of the value. Notes: svn path=/head/; revision=104963
* Save errno around calls to free(); at least some code paths clobber itTim J. Robbins2002-10-111-0/+3
| | | | | | | and we are not interested in any errors it may report. Notes: svn path=/head/; revision=104946
* Document the kind of format string strfmon() expects. Sync the ErrorsTim J. Robbins2002-10-111-5/+74
| | | | | | | section with reality. Notes: svn path=/head/; revision=104945
* Use the new struct lconv members to determine how to format internationalTim J. Robbins2002-10-111-1/+12
| | | | | | | monetary values. Notes: svn path=/head/; revision=104944
* Non-negative amounts should not have an extra space in front of themTim J. Robbins2002-10-111-6/+2
| | | | | | | when the `(' flag is used. Notes: svn path=/head/; revision=104943
* "Left precision" and "right precision" are not flags, but separate partsTim J. Robbins2002-10-111-13/+15
| | | | | | | of the format string that appear after the field width. Notes: svn path=/head/; revision=104942
* Add cross-references to wide character versions of these functions.Tim J. Robbins2002-10-103-3/+6
| | | | Notes: svn path=/head/; revision=104751
* Add missing const qualifier in tfind().Mike Barcroft2002-10-032-2/+2
| | | | Notes: svn path=/head/; revision=104400
* Add getopt_long(3).Eric Melville2002-09-293-2/+771
| | | | | | | | Obtained from: NetBSD Sponsored by: Apple Notes: svn path=/head/; revision=104128
* Add restrict type-qualifier.Mike Barcroft2002-09-202-2/+3
| | | | Notes: svn path=/head/; revision=103668
* Implement C99's _Exit() interface.Garrett Wollman2002-09-106-55/+158
| | | | | | | | | Implement a version of qsort that provides a thunk to the comparison function. Update manual pages. Notes: svn path=/head/; revision=103165
* Include some verbage about not calling exit() from functions registeredGarrett Wollman2002-09-062-2/+24
| | | | | | | by atexit(). Notes: svn path=/head/; revision=103036
* Style: One space between "restrict" qualifier and "*".Tim J. Robbins2002-09-0612-17/+17
| | | | Notes: svn path=/head/; revision=103012
* s/EDOFUS/EDOOFUS/Poul-Henning Kamp2002-08-211-3/+3
| | | | | | | Persuaded by: Google Notes: svn path=/head/; revision=102229
* - Add the 'restrict' qualifier to the function prototypes andRobert Drehmel2002-08-1512-41/+17
| | | | | | | | | | | definitions of the functions that convert strings to numbers and are defined by IEEE Std 1003-1.2001. - Use ANSI-C function definitions for all of the functions mentioned above plus strtouq and strtoq. - Update the prototypes in the manual pages. Notes: svn path=/head/; revision=101912