summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Replace strncpy() with strlcpy() when parsing login time limit stringsrwatson2006-01-161-1/+1
| | | | | | | | | | | from /etc/login.conf, or an unterminated string buffer could result. Probably, login_times.c should reject excessively long time strings as unparseable, rather than truncating, which might render an invalid string valid. Found with: Coverity Prevent (tm) Reviewed by: csjp MFC after: 3 days
* Remove unnecessary and undesirable 'static' from function-local kegrwatson2006-01-161-1/+1
| | | | | | | | list, which could cause problems for multi-threaded applications using libmemstat to monitor UMA in more than one thread simultaneously. MFC after: 3 days
* Define NO_TLS on ia64. The dynamic TLS implementation on ia64 ismarcel2006-01-161-0/+1
| | | | | | | | | broken for non-threaded shared processes in that __tls_get_addr() assumes the thread pointer is always initialized. This is not the case. When arenas_map is referenced in choose_arena() and it is defined as a thread-local variable, it will result in a SIGSEGV. PR: ia64/91846 (describes the TLS/ia64 bug).
* Fix typo in comment.rwatson2006-01-161-1/+1
| | | | MFC after: 3 days
* Validate that the supplied file is not empty before trying mmap(2) itcsjp2006-01-151-0/+5
| | | | | | | | and access the pages associated with it. Submitted by: Wojciech A. Koszek PR: bin/91411 MFC after: 1 week
* Enable mutex inheritance code in mutex_fork, I forgot to turn on it.davidxu2006-01-141-1/+11
| | | | while here, add some comments about process shared mutex.
* Replace malloc(), calloc(), posix_memalign(), realloc(), and free() withjasone2006-01-132-1107/+4597
| | | | | | | a scalable concurrent allocator implementation. Reviewed by: current@ Approved by: phk, markm (mentor)
* Increase the number of spinlocks, since libc's malloc implementation isjasone2006-01-133-3/+3
| | | | | | about to significantly increase the number of spinlocks used. Approved by: markm (mentor)
* In the splnet(9) times netgraph(4) was synchronous and if a messageglebius2006-01-121-0/+16
| | | | | | | | | | | | | | | | | | had been replied, the reply was always delivered to the originator synchronously. With introduction of netgraph item callbacks and a wait channel with mutex in ng_socket(4), we have fixed the problem with ngctl(8) returning earlier than the command has been proceeded by target node. But still ngctl(8) can return prior to the reply has arrived to its node. To fix this: - Introduce a new flag for netgraph(4) messages - NGM_HASREPLY. This flag is or'ed with message like NGM_READONLY. - In netgraph userland library if we have sent a message with NGM_HASREPLY flag, then select(2) until reply comes. - Mark appropriate generic commands with NGM_HASREPLY flag, gathering them into one enum {}. Bump generic cookie.
* Fix a bitwise logic error in posix_memalign().jasone2006-01-121-2/+2
| | | | Reported by: glebius
* Use posix_memalign() in valloc() rather than making assumptions aboutjasone2006-01-122-20/+20
| | | | | | the alignment of malloc()ed memory. Approved by: markm (mentor)
* In preparation for a new malloc implementation:jasone2006-01-128-82/+170
| | | | | | | | | | | | | * Add posix_memalign(). * Move calloc() from calloc.c to malloc.c. Add a calloc() implementation in rtld-elf in order to make the loader happy (even though calloc() isn't used in rtld-elf). * Add _malloc_prefork() and _malloc_postfork(), and use them instead of directly manipulating __malloc_lock. Approved by: phk, markm (mentor)
* Build shared library on behalf of bsnmpd.ru2006-01-121-1/+0
|
* I wrote getnetconfig where I meant getnetpath in the previous revision.ceri2006-01-111-2/+2
|
* The thr_new sysscall was already in libc, don't generate it.davidxu2006-01-111-1/+0
|
* Add references to fhopen, fhstat, getfh, lgetfh and fhstatfs.grog2006-01-103-0/+6
| | | | Pointed out by: Antony Curtis <antony@mysql.com>
* Use macro STATIC_LIB_REQUIRE to declare a symbol should be linked intodavidxu2006-01-102-95/+74
| | | | static binary.
* Rescue pthread_set_name_np for compatible reason, remove unused code.davidxu2006-01-092-151/+10
|
* Tweak macro THR_LOCK_RELEASE a bit for non-PTHREAD_INVARIANTS case.davidxu2006-01-091-7/+14
|
* Return real detached state.davidxu2006-01-091-0/+2
|
* Fix a bug recently introduced, the _thread_active_count should bedavidxu2006-01-081-0/+1
| | | | decreased if thread can not be created.
* Allow background threads to be suspended.davidxu2006-01-081-1/+4
|
* Try to reduce total time needed for suspending all threads,davidxu2006-01-081-4/+17
| | | | first broadcast signals to all threads, then enter a wait loop.
* Remove functions i386_get_gsbase and i386_set_gsbase, they were alreadydavidxu2006-01-071-14/+0
| | | | in libc.
* o Document the possibility of putting 'b' in the flag field.ceri2006-01-061-5/+11
| | | | | | | While we don't use the NC_BROADCAST value of nc_flag anywhere in the RPC code, it is parseable by getnetconfigent(3) from /etc/netconfig. o Clean up some "see below"'s that were cut and pasted from netconfig.h.
* Refine thread suspension code, now thread suspension is a blockabledavidxu2006-01-057-68/+177
| | | | | | | operation, the caller is blocked util target threads are really suspended, also avoid suspending a thread when it is holding a critical lock. Fix a bug in _thr_ref_delete which tests a never set flag.
* Oops, on amd64 (and probably on all non-i386 systems), the previousbde2006-01-051-6/+11
| | | | | | | | | | | | | | commit broke the 2**24 cases where |x| > DBL_MAX/2. There are exponent range problems not just for denormals (underflow) but for large values (overflow). Doubles have more than enough exponent range to avoid the problems, but I forgot to convert enough terms to double, so there was an x+x term which was sometimes evaluated in float precision. Unfortunately, this is a pessimization with some combinations of systems and compilers (it makes no difference on Athlon XP's, but on Athlon64's it gives a 5% pessimization with gcc-3.4 but not with gcc-3.3). Exlain the problem better in comments.
* Document the recently-added EINVAL behavior.dds2006-01-051-1/+7
| | | | MFC after: 1 week
* Use double precision internally to optimize cbrtf(), and change thebde2006-01-051-28/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | algorithm for the second step significantly to also get a perfectly rounded result in round-to-nearest mode. The resulting optimization is about 25% on Athlon64's and 30% on Athlon XP's (about 25 cycles out of 100 on the former). Using extra precision, we don't need to do anything special to avoid large rounding errors in the third step (Newton's method), so we can regroup terms to avoid a division, increase clarity, and increase opportunities for parallelism. Rearrangement for parallelism loses the increase in clarity. We end up with the same number of operations but with a division reduced to a multiplication. Using specifically double precision, there is enough extra precision for the third step to give enough precision for perfect rounding to float precision provided the previous steps are accurate to 16 bits. (They were accurate to 12 bits, which was almost minimal for imperfect rounding in the old version but would be more than enough for imperfect rounding in this version (9 bits would be enough now).) I couldn't find any significant time optimizations from optimizing the previous steps, so I decided to optimize for accuracy instead. The second step needed a division although a previous commit optimized it to use a polynomial approximation for its main detail, and this division dominated the time for the second step. Use the same Newton's method for the second step as for the third step since this is insignificantly slower than the division plus the polynomial (now that Newton's method only needs 1 division), significantly more accurate, and simpler. Single precision would be precise enough for the second step, but doesn't have enough exponent range to handle denormals without the special grouping of terms (as in previous versions) that requires another division, so we use double precision for both the second and third steps.
* 1. Add SIGEV_THREAD notification for mq_notify.davidxu2006-01-042-198/+343
| | | | | 2. Reuse current timer code and abstract some common code to to support both timer and mqueue.
* For the ``#ifdef NOTYET'' code that allows calling non-async-safebrian2006-01-032-2/+2
| | | | | | | | | | functions in the child after a fork() from a threaded process, use __sys_setprocmask() rather than setprocmask() to keep our signal handling sane. Without this fix, signals are essentially ignored in said child and things such as protection violations result in an endless busy loop. Reviewed by: deischen
* Remove in-progress wait code to sync with libpthread's behavior.davidxu2006-01-031-30/+8
|
* Use the correct shared-library version number (the same as the one useddfr2006-01-011-1/+1
| | | | | by the standalone version of heimdal GSS-API). If any compat issues arise, I may increment the version number once more.
* Document the LOGIN_SETMAC setusercontext(3) flag. While we are here, dropcsjp2005-12-301-0/+5
| | | | in an external reference to mac_set_proc(3).
* Add a new extensible GSS-API layer which can support GSS-API plugins,dfr2005-12-2986-1/+10705
| | | | | | | | | similar the the Solaris implementation. Repackage the krb5 GSS mechanism as a plugin library for the new implementation. This also includes a comprehensive set of manpages for the GSS-API functions with text mostly taken from the RFC. Reviewed by: Love Hörnquist Åstrand <lha@it.su.se>, ru (build system), des (openssh parts)
* Updated versions of header files generated per the instructionsdougb2005-12-296-14/+61
| | | | in src/contrib/bind9/FREEBSD-Upgrade for the 9.2.3 import
* gmon now supported on powerpcgrehan2005-12-291-2/+0
|
* The minbrk symbol is hidden the same on powerpc as other FreeBSD platforms.grehan2005-12-291-1/+1
|
* Add a64l(), l64a(), and l64a_r() XSI extentions. These functions converttrhodes2005-12-244-5/+290
| | | | | | | | between a 32-bit integer and a radix-64 ASCII string. The l64a_r() function is a NetBSD addition. PR: 51209 (based on submission, but very different) Reviewed by: bde, ru
* Add abort2 manual page.phk2005-12-232-1/+100
| | | | | Submitted by: "Wojciech A. Koszek" <dunstan@freebsd.czest.pl> Edited by: phk
* Explicitely use a "signed char" instead of a "char", for those archs wherecognet2005-12-221-2/+2
| | | | char defaults to unsigned.
* Let _mutex_cv_lock call internal functiona mutex_lock_common.davidxu2005-12-211-1/+2
|
* Hide umtx API symbols as well.davidxu2005-12-212-6/+9
|
* 1. Retire macro SCLASS, instead simply use language keyword anddavidxu2005-12-212-109/+124
| | | | | put variables in thr_init.c. 2. Hide all global symbols which won't be exported.
* Follow the mistake in libpthread, the first version name in libpthreaddavidxu2005-12-211-1/+1
| | | | | | is LIBTHREAD_1_0, but really it should be LIBPTHREAD_1_0. Fix it so libmap.conf works again (it was broken by recent versioning code in rtld_elf).
* Extract the high and low words together. With gcc-3.4 on uniformlybde2005-12-201-8/+6
| | | | | | | | | | | | | | | | | | | | distributed non-large args, this saves about 14 of 134 cycles for Athlon64s and about 5 of 199 cycles for AthlonXPs. Moved the check for x == 0 inside the check for subnormals. With gcc-3.4 on uniformly distributed non-large args, this saves another 5 cycles on Athlon64s and loses 1 cycle on AthlonXPs. Use INSERT_WORDS() and not SET_HIGH_WORD() when converting the first approximation from bits to double. With gcc-3.4 on uniformly distributed non-large args, this saves another 4 cycles on both Athlon64s and and AthlonXPs. Accessing doubles as 2 words may be an optimization on old CPUs, but on current CPUs it tends to cause extra operations and pipeline stalls, especially for writes, even when only 1 of the words needs to be accessed. Removed an unused variable.
* Clear return code to zero if joiner successfully waited joinee.davidxu2005-12-191-0/+1
| | | | | Bug reported by: jasone at connonware when using ports lang/onyx MFC after: 3 days
* Use a minimax polynomial approximation instead of a Pade rationalbde2005-12-192-37/+30
| | | | | | | | | | | | | | | | | function approximation for the second step. The polynomial has degree 2 for cbrtf() and 4 for cbrt(). These degrees are minimal for the final accuracy to be essentially the same as before (slightly smaller). Adjust the rounding between steps 2 and 3 to match. Unfortunately, for cbrt(), this breaks the claimed accuracy slightly although incorrect rounding doesn't. Claim less accuracy since its not worth pessimizing the polynomial or relying on exhaustive testing to get insignificantly more accuracy. This saves about 30 cycles on Athlons (mainly by avoiding 2 divisions) so it gives an overall optimization in the 10-25% range (a larger percentage for float precision, especially in 32-bit mode, since other overheads are more dominant for double precision, surprisingly more in 32-bit mode).
* Fixed code to match comments and the algorithm:bde2005-12-182-20/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - in preparing for the third approximation, actually make t larger in magnitude than cbrt(x). After chopping, t must be incremented by 2 ulps to make it larger, not 1 ulp since chopping can reduce it by almost 1 ulp and it might already be up to half a different-sized-ulp smaller than cbrt(x). I have not found any cases where this is essential, but the think-time error bound depends on it. The relative smallness of the different-sized-ulp limited the bug. If there are cases where this is essential, then the final error bound would be 5/6+epsilon instead of of 4/6+epsilon ulps (still < 1). - in preparing for the third approximation, round more carefully (but still sloppily to avoid branches) so that the claimed error bound of 0.667 ulps is satisfied in all cases tested for cbrt() and remains satisfied in all cases for cbrtf(). There isn't enough spare precision for very sloppy rounding to work: - in cbrt(), even with the inadequate increment, the actual error was 0.6685 in some cases, and correcting the increment increased this a little. The fix uses sloppy rounding to 25 bits instead of very sloppy rounding to 21 bits, and starts using uint64_t instead of 2 words for bit manipulation so that rounding more bits is not much costly. - in cbrtf(), the 0.667 bound was already satisfied even with the inadequate increment, but change the code to almost match cbrt() anyway. There is not enough spare precision in the Newton approximation to double the inadequate increment without exceeding the 0.667 bound, and no spare precision to avoid this problem as in cbrt(). The fix is to round using an increment of 2 smaller-ulps before chopping so that an increment of 1 ulp is enough. In cbrt(), we essentially do the same, but move the chop point so that the increment of 1 is not needed. Fixed comments to match code: - in cbrt(), the second approximation is good to 25 bits, not quite 26 bits. - in cbrt(), don't claim that the second approximation may be implemented in single precision. Single precision cannot handle the full exponent range without minor but pessimal changes to renormalize, and although single precision is enough, 25 bit precision is now claimed and used. Added comments about some of the magic for the error bound 4/6+epsilon. I still don't understand why it is 4/6+ and not 6/6+ ulps. Indent comments at the right of code more consistently.
* Implement ELF symbol versioning using GNU semantics. This code aimskan2005-12-181-0/+9
| | | | | | | | | to be compatible with symbol versioning support as implemented by GNU libc and documented by http://people.redhat.com/~drepper/symbol-versioning and LSB 3.0. Implement dlvsym() function to allow lookups for a specific version of a given symbol.
OpenPOWER on IntegriCloud