summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* atomic_fetchadd_int works on unsigned quantities - changekmacy2008-08-151-1/+1
| | | | | | sigev_generation to be unsigned MFC after: 1 month
* Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() andemax2008-08-143-2/+148
| | | | | | | | | uuid_dec_be() functions. These routines are not part of the DCE RPC API. They are provided for convenience. Reviewed by: marcel Obtained from: NetBSD MFC after: 1 week
* Move CPU_SPINWAIT into the innermost spin loop, in order to allow fasterjasone2008-08-141-2/+3
| | | | | | preemption while busy-waiting. Submitted by: Mike Schuster <schuster@adobe.com>
* Re-order the terms of an expression in arena_run_reg_dalloc() to correctlyjasone2008-08-141-2/+2
| | | | | | detect whether the integer division table is large enough to handle the divisor. Before this change, the last two table elements were never used, thus causing the slow path to be used for those divisors.
* Import handy shorthand Bluetooth address (BD_ADDR) utility functionsemax2008-08-133-2/+67
| | | | | | | from NetBSD and document them. Obtained from: NetBSD MFC after: 1 week
* Change bpf(4) to use the cdevpriv API.ed2008-08-131-1/+1
| | | | | | | | | | | | | | | | | | Right now the bpf(4) driver uses the cloning API to generate /dev/bpf%u. When an application such as tcpdump needs a BPF, it opens /dev/bpf0, /dev/bpf1, etc. until it opens the first available device node. We used this approach, because our devfs implementation didn't allow per-descriptor data. Now that we can, make it use devfs_get_cdevpriv() to obtain the private data. To remain compatible with the existing implementation, add a symlink from /dev/bpf0 to /dev/bpf. I've already changed libpcap to compile with HAVE_CLONING_BPF, which makes it use /dev/bpf. There may be other applications in the base system (dhclient) that use the loop to obtain a valid bpf. Discussed on: src-committers Approved by: csjp
* Change the type of ti_traceme from a char to an int as itsmarcel2008-08-131-1/+1
| | | | address is passed to ps_pread for reading sizeof(int) bytes.
* Fix up test suite so it works again with the libarchive 1.x API.kientzle2008-08-115-2/+38
| | | | | | In particular, FreeBSD 6 still uses the libarchive 1.x API and this correction will permit MFCing new libarchive features back to FreeBSD 6.
* Correct test_tar_large so it works correctly with the libarchive 1.x API.kientzle2008-08-101-1/+1
|
* Explain why two apparently-identical archive_read_data() callskientzle2008-08-101-0/+2
| | | | really should have different return values.
* MfP4: Joerg Sonnenberger's fixes to make 'ar' and 'pax' writerskientzle2008-08-102-0/+6
| | | | robust against multiple calls to their destroy() functions.
* Add sbuf_new_auto as a shortcut for the very common case of creating ades2008-08-091-1/+1
| | | | | | | completely dynamic sbuf. Obtained from: Varnish MFC after: 2 weeks
* Add prototype defination for setfib(2) to sys/socket.h.delphij2008-08-081-1/+2
|
* Remove variables which are assigned values and never used thereafter.cperciva2008-08-081-5/+1
| | | | | Found by: LLVM/Clang Static Checker Approved by: jasone
* Remove some unused variables.das2008-08-084-4/+1
| | | | Reported by: Intel C Compiler
* In the linedas2008-08-083-3/+3
| | | | | | | #pragma STDC CX_LIMITED_RANGE ON the "ON" needs to be in caps. gcc doesn't understand this pragma anyway and assumes it is always on in any case, but icc supports it and cares about the case.
* Implement cproj{,f,l}().das2008-08-076-7/+170
|
* Use cpack() and the gcc extension __imag__ to implement cimag() anddas2008-08-076-6/+18
| | | | | | | | | | | | conj() instead of using expressions like z * I. The latter is bad for several reasons: 1. It is implemented using arithmetic, which is unnecessary, and can generate floating point exceptions, contrary to the requirements on these functions. 2. gcc implements complex multiplication using a formula that breaks down for infinities, e.g., it gives INFINITY * I == nan + inf I.
* Fix ia64 build.dfr2008-08-061-3/+3
|
* Fix 64bt build.dfr2008-08-061-1/+3
|
* Add an implementation of the RPCSEC_GSS authentication protocol for RPC. Thisdfr2008-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
* Cleanup for WARNS 6.marcel2008-08-067-47/+50
|
* Add EPERM to the ERRORS section.trhodes2008-08-041-1/+3
| | | | PR: 125746
* Initialize "nconv" to a reasonable value in all code paths. Prior tocperciva2008-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
* Set "max" to a reasonable value if BLOCKSIZE has a bogus unit. Priorcperciva2008-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
* Mark functions as __dead2 in order to help the LLVM static checkercperciva2008-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".
* Restructure and use different variables in the tests that involvescf2008-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
* Add EAGAIN to the ERRORS list, as found in kern_jail.c.trhodes2008-08-031-1/+3
| | | | | PR: 125253 Submitted by: Mateusz Guzik <mjguzik@gmail.com> (original version)
* Restored from previous backing out (because that is OpenBSD way, soache2008-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
* Fix some style bogosity from fdlibm.das2008-08-032-12/+12
|
* Minor improvements:das2008-08-033-20/+20
| | | | | | | - Improve the order of some tests. - Fix style. Submitted by: bde
* A few minor corrections, including some from bde:das2008-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.
* remove whitespace bug (8 spaces into one tab)remko2008-08-021-1/+1
| | | | Submitted by: ed
* Teach fmtcheck() about wint_t, intmax_t, char *, intmax_t *, anddas2008-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.
* On i386, gcc truncates long double constants to double precisiondas2008-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
* Detect if the application has cleared the environ variable by settingscf2008-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
* Fix some problems with asinf(), acosf(), atanf(), and atan2f():das2008-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.
* In function pthread_condattr_getpshared, store result correctly.davidxu2008-08-011-1/+1
| | | | PR: kern/126128
* Add implementations of acosl(), asinl(), atanl(), atan2l(),das2008-07-3120-69/+900
| | | | | | | and cargl(). Reviewed by: bde sparc64 testing resources from: remko
* Add thr_pread_{int,long,ptr} and thr_pwrite_{int,long,ptr} tomarcel2008-07-312-0/+179
| | | | | help abstract the sizes and endianness of the primary types of the target. These currently use the native characteristics.
* Set WARNS=1.das2008-07-311-0/+1
| | | | | I believe I've committed all the bits necessary to make this compile on all supported architectures. :crosses fingers:
* The high part of the mantissa is 64 bits on sparc64.das2008-07-312-2/+2
|
* As in other parts of libm, mark a few constants as volatile to preventdas2008-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.
* Cleanup for WARNS 3.marcel2008-07-319-16/+23
|
* Cleanup for WARNS 2.marcel2008-07-314-4/+3
|
* Change the type of psaddr_t from void* to uintptr_t. A pointermarcel2008-07-305-27/+25
| | | | | type cannot be made wider to allow ILP32 platforms to target LP64 platforms.
* Convert popen()'s `pidlist' to a SLIST, for consistency.ed2008-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)
* Fix a few bugs with the _gettemp() routine which implements mkstemp(),jhb2008-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
* Fix the email address formats in some posix_spawn(3) manpages.ed2008-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)
* Add manual pages for posix_spawn() functions.davidxu2008-07-2811-1/+1483
| | | | PR: standards/122051
OpenPOWER on IntegriCloud