summaryrefslogtreecommitdiffstats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Return NULL if there is an OOM error during initialization, rather thanjasone2006-01-191-35/+50
| | | | | | | | allowing the error to be fatal. Move a label in order to make sure to properly handle errors in malloc(0). Reported by: Alastair D'Silva, Saneto Takanori
* Disable "tp" support until I figure out why it's breaking the build. <sigh>kientzle2006-01-181-1/+0
|
* Fix an 11 year old mistake: Let the hash functions take a void* insteadphk2006-01-1714-28/+35
| | | | of unsigned char* argument.
* If the attempt to open the archive fails (either the client openkientzle2006-01-172-14/+38
| | | | | | | | | | | | routine fails or the first read fails), invoke the client close routine immediately so the client can clean up. Also, don't store the client pointers in this case, so that the client close routine can't accidentally get called more than once. A minor style fix to archive_read_open_fd.c while I'm here. PR: 86453 Thanks to: Andrew Turner for reporting this and suggesting a fix.
* Add support for "tp" format. tp was the standard systemkientzle2006-01-174-1/+631
| | | | | | | | | | | | | | | | | | | | | | | | | archiver for Fourth Edition through Sixth Edition Unix; it was replaced by tar in Seventh Edition. (First Edition through Third Edition used "tap.") Unfortunately, tp was not so very standard; there were a few different variants. The code here attempts to support what I believe were the most common variants. tp support is not yet enabled by archive_read_support_format_all(), as I'm not yet entirely comfortable with the detection heuristics. People interested in experimenting can add archive_read_support_format_tp() just after any calls to archive_read_support_format_all() in bsdtar to see how well this works. TODO: tp format is roughly similar in structure to dump/restore archive formats used by many systems. It should be possible to generalize this code to handle many dump/restore variants. Format detection heuristics are going to be rough, though. Thanks to: Warren Toomey, whose very basic tp extraction programs and documentation made this possible.
* Restore use of strncpy(), as there is later unconditional terminationrwatson2006-01-161-1/+1
| | | | | | of the string, and reliance on the returned pointer. Found by: bde (tm)
* Eliminate unused code.davidxu2006-01-161-7/+1
|
* Add a separate simple internal base allocator and remove base_arena, so thatjasone2006-01-161-151/+175
| | | | | | | | | | there is never any need to recursively call the main allocation functions. Remove recursive spinlock support, since it is no longer needed. Allow chunks to be as small as the page size. Correctly propagate OOM errors from arena_new().
* 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
|
OpenPOWER on IntegriCloud