summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Add an implementation of the RPCSEC_GSS authentication protocol for RPC. ThisDoug Rabson2008-08-0645-92/+4739
| | | | | | | | | | | is based on an old implementation from the University of Michigan with lots of changes and fixes by me and the addition of a Solaris-compatible API. Sponsored by: Isilon Systems Reviewed by: alfred Notes: svn path=/head/; revision=181344
* Cleanup for WARNS 6.Marcel Moolenaar2008-08-067-47/+50
| | | | Notes: svn path=/head/; revision=181341
* Add EPERM to the ERRORS section.Tom Rhodes2008-08-041-1/+3
| | | | | | | PR: 125746 Notes: svn path=/head/; revision=181312
* Initialize "nconv" to a reasonable value in all code paths. Prior toColin Percival2008-08-041-1/+3
| | | | | | | | | | this commit, sprintf("%s", "") could fail depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker Notes: svn path=/head/; revision=181281
* Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. PriorColin Percival2008-08-041-0/+1
| | | | | | | | | | | | to this commit, "env BLOCKSIZE=4X df" prints not only "4X: unknown blocksize" as expected, but sometimes also "maximum blocksize is 1G" and "minimum blocksize is 512" depending on what happened to be on the stack. Found by: LLVM/Clang Static Checker Notes: svn path=/head/; revision=181280
* Mark functions as __dead2 in order to help the LLVM static checkerColin Percival2008-08-041-1/+1
| | | | | | | | | | understand which code paths aren't possible. This commit eliminates 117 false positive bug reports of the form "allocate memory; error out if pointer is NULL; use pointer". Notes: svn path=/head/; revision=181269
* Restructure and use different variables in the tests that involveSean Farley2008-08-031-13/+15
| | | | | | | | | | | | environ[0] to be more obvious that environ is not NULL before environ[0] is tested. Although I believe the previous code worked, this change improves code maintainability. Reviewed by: ache MFC after: 3 days Notes: svn path=/head/; revision=181266
* Add EAGAIN to the ERRORS list, as found in kern_jail.c.Tom Rhodes2008-08-031-1/+3
| | | | | | | | PR: 125253 Submitted by: Mateusz Guzik <mjguzik@gmail.com> (original version) Notes: svn path=/head/; revision=181265
* Restored from previous backing out (because that is OpenBSD way, soAndrey A. Chernov2008-08-031-12/+16
| | | | | | | | | | | | assumed to be reviewd by them): Stir directly from the kernel PRNG, without taking less random pid & time bytes too (when it is possible). The difference with OpenBSD code is that they have KERN_ARND sysctl for that task, while we need to read /dev/random Notes: svn path=/head/; revision=181261
* Fix some style bogosity from fdlibm.David Schultz2008-08-032-12/+12
| | | | Notes: svn path=/head/; revision=181258
* Minor improvements:David Schultz2008-08-033-20/+20
| | | | | | | | | | - Improve the order of some tests. - Fix style. Submitted by: bde Notes: svn path=/head/; revision=181257
* A few minor corrections, including some from bde:David Schultz2008-08-023-17/+16
| | | | | | | | | | - When y/x is huge, it's faster and more accurate to return pi/2 instead of pi - pi/2. - There's no need for 3 lines of bit fiddling to compute -z. - Fix a comment. Notes: svn path=/head/; revision=181204
* remove whitespace bug (8 spaces into one tab)Remko Lodder2008-08-021-1/+1
| | | | | | | Submitted by: ed Notes: svn path=/head/; revision=181182
* Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, andDavid Schultz2008-08-022-37/+99
| | | | | | | | | | | | wide string arguments. Also simplify the code that handles length modifiers and make it more conservative. For instance, be explicit about the modifiers allowed for %d, rather than assuming that anything other than L, q, t, or z implies an int argument. Notes: svn path=/head/; revision=181154
* On i386, gcc truncates long double constants to double precisionDavid Schultz2008-08-024-8/+127
| | | | | | | | | | | | | | | | | | | at compile time regardless of the dynamic precision, and there's no way to disable this misfeature at compile time. Hence, it's impossible to generate the appropriate tables of constants for the long double inverse trig functions in a straightforward way on i386; this change hacks around the problem by encoding the underlying bits in the table. Note that these functions won't pass the regression test on i386, even with the FPU set to extended precision, because the regression test is similarly damaged by gcc. However, the tests all pass when compiled with a modified version of gcc. Reported by: bde Notes: svn path=/head/; revision=181152
* Detect if the application has cleared the environ variable by settingSean Farley2008-08-021-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | the first value (environ[0]) to NULL. This is in addition to the current detection of environ being replaced, which includes being set to NULL. Without this fix, the environment is not truly wiped, but appears to be by getenv() until an *env() call is made to alter the enviroment. This change is necessary to support those applications that use this method for clearing environ such as Dovecot and Postfix. Applications such as Sendmail and the base system's env replace environ (already detected). While neither of these methods are defined by SUSv3, it is best to support them due to historic reasons and in lieu of a clean, defined method. Add extra units tests for clearing environ using four different methods: 1. Set environ to NULL pointer. 2. Set environ[0] to NULL pointer. 3. Set environ to calloc()'d NULL-terminated array. 4. Set environ to static NULL-terminated array. Noticed by: Timo Sirainen MFC after: 3 days Notes: svn path=/head/; revision=181150
* Fix some problems with asinf(), acosf(), atanf(), and atan2f():David Schultz2008-08-014-71/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Adjust several constants for float precision. Some thresholds that were appropriate for double precision were never changed when these routines were converted to float precision. This has an impact on performance but not accuracy. (Submitted by bde.) - Reduce the degrees of the polynomials used. A smaller degree suffices for float precision. - In asinf(), use double arithmetic in part of the calculation to avoid a corner case and some complicated arithmetic involving a division and some buggy constants. This improves performance and accuracy. Max error (ulps): asinf acosf atanf before 0.925 0.782 0.852 after 0.743 0.804 0.852 As bde points out, it's cheaper for asin*() and acos*() to use polynomials instead of rational functions, but that's a task for another day. Notes: svn path=/head/; revision=181100
* In function pthread_condattr_getpshared, store result correctly.David Xu2008-08-011-1/+1
| | | | | | | PR: kern/126128 Notes: svn path=/head/; revision=181099
* Add implementations of acosl(), asinl(), atanl(), atan2l(),David Schultz2008-07-3120-69/+900
| | | | | | | | | | and cargl(). Reviewed by: bde sparc64 testing resources from: remko Notes: svn path=/head/; revision=181074
* Add thr_pread_{int,long,ptr} and thr_pwrite_{int,long,ptr} toMarcel Moolenaar2008-07-312-0/+179
| | | | | | | | help abstract the sizes and endianness of the primary types of the target. These currently use the native characteristics. Notes: svn path=/head/; revision=181065
* Set WARNS=1.David Schultz2008-07-311-0/+1
| | | | | | | | I believe I've committed all the bits necessary to make this compile on all supported architectures. :crosses fingers: Notes: svn path=/head/; revision=181064
* The high part of the mantissa is 64 bits on sparc64.David Schultz2008-07-312-2/+2
| | | | Notes: svn path=/head/; revision=181063
* As in other parts of libm, mark a few constants as volatile to preventDavid Schultz2008-07-316-12/+20
| | | | | | | | | spurious optimizations. gcc doesn't support FENV_ACCESS, so when it folds constants, it assumes that the rounding mode is always the default and floating point exceptions never matter. Notes: svn path=/head/; revision=181062
* Cleanup for WARNS 3.Marcel Moolenaar2008-07-319-16/+23
| | | | Notes: svn path=/head/; revision=181059
* Cleanup for WARNS 2.Marcel Moolenaar2008-07-314-4/+3
| | | | Notes: svn path=/head/; revision=181044
* Change the type of psaddr_t from void* to uintptr_t. A pointerMarcel Moolenaar2008-07-305-27/+25
| | | | | | | | type cannot be made wider to allow ILP32 platforms to target LP64 platforms. Notes: svn path=/head/; revision=180982
* Convert popen()'s `pidlist' to a SLIST, for consistency.Ed Schouten2008-07-291-11/+13
| | | | | | | | | | | | | | | | I guess the original author of the popen() code didn't want to use our <sys/queue.h> macro's, because the single linked list macro's didn't offer O(1) deletion. Because I introduced SLIST_REMOVE_NEXT() some time ago, we can now use the macro's here. By converting the code to an SLIST, it is more consistent with other parts of the C library and the operating system. Reviewed by: csjp Approved by: philip (mentor, implicit) Notes: svn path=/head/; revision=180963
* Fix a few bugs with the _gettemp() routine which implements mkstemp(),John Baldwin2008-07-281-11/+26
| | | | | | | | | | | | | | | | | | mkstemps(), and mkdtemp(). - Add proper range checking for the 'slen' parameter passed to mkstemps(). - Try all possible permutations of a template if a collision is encountered. Previously, once a single template character reached 'z', it would not wrap around to '0' and keep going until it encountered the original starting letter. In the edge case that the randomly generated starting name used all 'z' characters, only that single name would be tried before giving up. PR: standards/66531 Submitted by: Jim Luther Obtained from: Apple MFC after: 1 week Notes: svn path=/head/; revision=180938
* Fix the email address formats in some posix_spawn(3) manpages.Ed Schouten2008-07-282-2/+2
| | | | | | | | | | | It seems I made a small bug when writing some of the posix_spawn(3) manpages. Remove the redundant "Ed Schouten", which broke the AUTHORS section. Approved by: philip (mentor, implicit) Notes: svn path=/head/; revision=180876
* Add manual pages for posix_spawn() functions.David Xu2008-07-2811-1/+1483
| | | | | | | PR: standards/122051 Notes: svn path=/head/; revision=180867
* Add support for a new login capability, cpumask which allows loginBrooks Davis2008-07-254-1/+132
| | | | | | | sessions to be pinned to cpus by login class. Notes: svn path=/head/; revision=180815
* Per rwatson's request:Andrey A. Chernov2008-07-251-29/+17
| | | | | | | | | | | | | | | "If you don't get a review within a day or two, I would firmly recommend backing out the changes" back out all my changes, i.e. not comes from merging from OpenBSD as unreviewed by secteam@ yet. (OpenBSD changes stays in assumption they are reviewd by OpenBSD) Yes, it means some old bugs returned, like not setted rs_stired = 1 in arc4random_stir(3) causing double stirring. Notes: svn path=/head/; revision=180804
* Fix cut-n-paste-oJulian Elischer2008-07-251-1/+1
| | | | | | | Submitted by: Kostik Belousov Notes: svn path=/head/; revision=180792
* First cut at doing the kvm file needed for mips.Warner Losh2008-07-231-0/+90
| | | | | | | Obtained from: gonzo@ Notes: svn path=/head/; revision=180734
* Fixes based on bde's feedback.Andrey A. Chernov2008-07-221-9/+9
| | | | | | | | | | | | | 1) Unindent and sort variables. 2) Indent struct members. 3) Remove _packed, use guaranteed >128 bytes size and only first 128 bytes from the structure. 4) Reword comment. Obtained from: bde Notes: svn path=/head/; revision=180713
* Change /dev/urandom to /dev/random since urandom marked asAndrey A. Chernov2008-07-221-1/+1
| | | | | | | | XXX Deprecated alias in /sys/dev/random/randomdev.c Notes: svn path=/head/; revision=180700
* Use arc4random_uniform(3) since modulo size is not power of 2Andrey A. Chernov2008-07-221-1/+1
| | | | Notes: svn path=/head/; revision=180696
* In arc4random_uniform() detect simple "power of two" case andAndrey A. Chernov2008-07-221-1/+5
| | | | | | | return just (arc4random() % upper_bound) Notes: svn path=/head/; revision=180690
* Add arc4random_uniform() function (to avoid "modulo bias")Andrey A. Chernov2008-07-224-1/+58
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=180688
* Increase initially dropped bytes from 512 to 768 (768 is alsoAndrey A. Chernov2008-07-221-3/+3
| | | | | | | | | | | suggested in the Ilya Mironov's article). 768 taken from another research where it treats as default for RC4-drop(768): http://www.users.zetnet.co.uk/hopwood/crypto/scan/cs.html#RC4-drop Minor style tweak. Notes: svn path=/head/; revision=180687
* Add feature_present(3) to the FBSD 1.1 symbol map.John Baldwin2008-07-211-0/+1
| | | | Notes: svn path=/head/; revision=180677
* 1) Use __packed attr on rdat structure to make it exact 128 bytes.Andrey A. Chernov2008-07-211-10/+17
| | | | | | | | | | | | | 2) Use gettimeofday() and getpid() only if reading from /dev/urandom fails or impossible. 3) Discard N bytes on very first initialization only (i.e. don't discard on re-stir). 4) Reduce N from 1024 to 512 as really suggested in the "(Not So) Random Shuffles of RC4" paper: http://research.microsoft.com/users/mironov/papers/rc4full.pdf Notes: svn path=/head/; revision=180676
* 1) Update copyright notice.Andrey A. Chernov2008-07-211-43/+53
| | | | | | | | | | | | 2) Eliminate "struct arc4_stream *as" arg since only single arg is possible. 3) Set rs.j = rs.i after arc4random key schedule to be more like arc4 stream cipher. Obtained from: OpenBSD Notes: svn path=/head/; revision=180672
* Add arc4random_buf to FBSD_1.1 spaceAndrey A. Chernov2008-07-211-0/+1
| | | | Notes: svn path=/head/; revision=180665
* Add arc4random_buf.3 to MLINKSAndrey A. Chernov2008-07-211-1/+2
| | | | Notes: svn path=/head/; revision=180659
* Implement arc4random_buf() functionAndrey A. Chernov2008-07-212-4/+28
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=180657
* Decrease arc4_count only when needed and with proper bytes amount.Andrey A. Chernov2008-07-211-1/+2
| | | | | | | Obtained from: OpenBSD Notes: svn path=/head/; revision=180656
* 1) Set stired flag after forced initialization.Andrey A. Chernov2008-07-211-1/+2
| | | | | | | | | | 2) Increase arc4_count to the limit OpenBSD use. Submitted by: Thorsten Glaser <tg@mirbsd.de> (1) Obtained from: OpenBSD (2) Notes: svn path=/head/; revision=180655
* Enhance arena_chunk_map_t to directly support run coalescing, and useJason Evans2008-07-181-394/+338
| | | | | | | | | | the chunk map instead of red-black trees where possible. Remove the red-black trees and node objects that are obsoleted by this change. The net result is a ~1-2% memory savings, and a substantial allocation speed improvement. Notes: svn path=/head/; revision=180599
* Sort the .PATH entries to give a more reasonable order of precedence:David Schultz2008-07-181-4/+5
| | | | | | | | | | | | | | | | 1. architecture-specific files 2. long double format-specific files 3. bsdsrc 4. src 5. man The original order was virtually the opposite of this. This should not cause any functional changes at this time. The difference is only significant when one wants to override, say, a generic foo.c with a more specialized foo.c (as opposed to foo.S). Notes: svn path=/head/; revision=180581