summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bug related to sbrk() calls that could cause address space leaks.Jason Evans2007-12-311-186/+268
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a long-standing bug, but until recent changes it was difficult to trigger, and even then its impact was non-catastrophic, with the exception of revision 1.157. Optimize chunk_alloc_mmap() to avoid the need for unmapping pages in the common case. Thanks go to Kris Kennaway for a patch that inspired this change. Do not maintain a record of previously mmap'ed chunk address ranges. The original intent was to avoid the extra system call overhead in chunk_alloc_mmap(), which is no longer a concern. This also allows some simplifications for the tree of unused DSS chunks. Introduce huge_mtx and dss_chunks_mtx to replace chunks_mtx. There was no compelling reason to use the same mutex for these disjoint purposes. Avoid memset() for huge allocations when possible. Maintain two trees instead of one for tracking unused DSS address ranges. This allows scalable allocation of multi-chunk huge objects in the DSS. Previously, multi-chunk huge allocation requests failed if the DSS could not be extended. Notes: svn path=/head/; revision=175004
* - Update build glue for 5.6-20071222Rong-En Fan2007-12-302-23/+54
| | | | Notes: svn path=/head/; revision=174999
* Update libarchive to 2.4.10. This includes a number of improvementsTim Kientzle2007-12-3031-245/+2118
| | | | | | | | | | | | | | | | | | | | | | | | | | | that I've been working on but put off committing until after the RELENG_7 branch, including: * New manpages: cpio.5 mtree.5 * New archive_entry_strmode() * New archive_entry_link_resolver() * New read support: mtree format * Internal API change: read format auction only runs once * Running the auction only once allowed simplifying a lot of bid logic. * Cpio robustness: search for next header after a sync error * Support device nodes on ISO9660 images * Eliminate a lot of unnecessary copies for uncompressed archives * Corrected handling of new GNU --sparse --posix formats * Correctly handle a zero-byte write to a compressed archive * Fixed memory leaks Many of these improvements were motivated by the upcoming bsdcpio front-end. There have also been extensive improvements to the libarchive_test test harness, which I'll commit separately. Notes: svn path=/head/; revision=174991
* - Update kvm_deadfiles to be compatible with the new system which has noJeff Roberson2007-12-301-44/+87
| | | | | | | | | | | global list of all files. - Mark kvm_getfiles() as broken since the live version exports struct xfile with no filelist at the head and does so incorrectly and the deadfiles version exports struct file with a filelist at the head. It is not known if either version works or complies to the manpage. Notes: svn path=/head/; revision=174989
* Back out premature commit of previous version.Jason Evans2007-12-281-183/+113
| | | | Notes: svn path=/head/; revision=174957
* Maintain two trees instead of one (old_chunks --> old_chunks_{ad,szad}) inJason Evans2007-12-281-113/+183
| | | | | | | | | | | | order to support re-use of multi-chunk unused regions within the DSS for huge allocations. This generalization is important to correct function when mmap-based allocation is disabled. Avoid zeroing re-used memory in the DSS unless it really needs to be zeroed. Notes: svn path=/head/; revision=174956
* Release chunks_mtx for all paths through chunk_dealloc().Jason Evans2007-12-281-1/+4
| | | | | | | Reported by: kris Notes: svn path=/head/; revision=174953
* Add the 'D' and 'M' run time options, and use them to control whetherJason Evans2007-12-272-315/+492
| | | | | | | | | | | | | | | | | | | | | memory is acquired from the system via sbrk(2) and/or mmap(2). By default, use sbrk(2) only, in order to support traditional use of resource limits. Additionally, when both options are enabled, prefer the data segment to anonymous mappings, in order to coexist better with large file mappings in applications on 32-bit platforms. This change has the potential to increase memory fragmentation due to the linear nature of the data segment, but from a performance perspective this is mitigated by the use of madvise(2). [1] Add the ability to interpret integer prefixes in MALLOC_OPTIONS processing. For example, MALLOC_OPTIONS=lllllllll can now be specified as MALLOC_OPTIONS=9l. Reported by: [1] rwatson Design review: [1] alc, peter, rwatson Notes: svn path=/head/; revision=174950
* Fix a typo in regards to the ENOENT error.John Baldwin2007-12-271-1/+1
| | | | | | | | | PR: docs/118929 Submitted by: mymtom of hotmail MFC after: 3 days Notes: svn path=/head/; revision=174945
* Clean up some of the pts(4) vs pty(4) stuff in grantpt(3) and friends:John Baldwin2007-12-211-22/+23
| | | | | | | | | | | | | - Use PTY* for all pty(4) related constants. - Use PTMX* for all pts(4) related constants. - Consistently use _PATH_DEV PTMX rather than "/dev/ptmx". - Revert 1.7 and properly fix it by using the correct prefix string for pts(4) masters. MFC after: 3 days Notes: svn path=/head/; revision=174842
* Adjust for OpenPAM Hydrangea.Dag-Erling Smørgrav2007-12-214-7/+8
| | | | Notes: svn path=/head/; revision=174837
* Invoke revoke(2) on the slave pty in the pts(4) case (new_openpty()) toJohn Baldwin2007-12-201-1/+13
| | | | | | | | | | | kick off any other users on the device line before using it since openpty(3) is documented to do this. Note that grantpt(3) does not call revoke(2), it only adjusts permissions and ownership. MFC after: 3 days Notes: svn path=/head/; revision=174818
* call underscore version of pthread_cleanup_pop instead.David Xu2007-12-201-1/+1
| | | | Notes: svn path=/head/; revision=174806
* Remove vfork() overloading, it is no longer needed.David Xu2007-12-202-11/+0
| | | | Notes: svn path=/head/; revision=174805
* Grumble. DO declare logbl(), DON'T declare logl() just yet.David Schultz2007-12-201-0/+2
| | | | | | | | | | bde is going to commit logl() Real Soon Now. I'm just trying to slow him down with merge conflicts. Noticed by: bde Notes: svn path=/head/; revision=174804
* Remove the declaration of logl(). The relevant bits haven't beenDavid Schultz2007-12-201-2/+0
| | | | | | | | | | committed yet, but the declaration leaked in when I added nan() and friends. Reported by: pav Notes: svn path=/head/; revision=174801
* Add missing dependencies on Makefile (fixes NO_CLEAN builds).Ruslan Ermilov2007-12-191-4/+4
| | | | Notes: svn path=/head/; revision=174767
* Reduce lock contention for simple cases.Warner Losh2007-12-191-16/+22
| | | | | | | | | # this really should be done with pthread_once, but I've debugged this code. Reviewed by: arch@ Notes: svn path=/head/; revision=174766
* Add note about other systems.Warner Losh2007-12-191-0/+3
| | | | Notes: svn path=/head/; revision=174765
* As several people pointed out, I did all the ctype casts the wrongDag-Erling Smørgrav2007-12-194-28/+36
| | | | | | | | | | way (not for the first time...) Noticed by: bde, ru ++ MFC after: 1 week Notes: svn path=/head/; revision=174761
* Move all the xprintf-related symbols to FBSDprivate_1.0.David Schultz2007-12-181-9/+13
| | | | | | | Discussed with: deischen, kan, phk Notes: svn path=/head/; revision=174760
* Since nan() is supposed to work the same as strtod("nan(...)", NULL),David Schultz2007-12-188-50/+85
| | | | | | | | | | | | | | | my original implementation made both use the same code. Unfortunately, this meant libm depended on a vendor header at compile time and previously- unexposed vendor bits in libc at runtime. Hence, I just wrote my own version of the relevant vendor routine. As it turns out, mine has a factor of 8 fewer of lines of code, and is a bit more readable anyway. The strtod() and *scanf() routines still use vendor code. Reviewed by: bde Notes: svn path=/head/; revision=174759
* Document NO_PROXY / no_proxy.Dag-Erling Smørgrav2007-12-181-1/+17
| | | | | | | MFC after: 3 weeks Notes: svn path=/head/; revision=174753
* Add support for the NO_PROXY / no_proxy environment variable as used byDag-Erling Smørgrav2007-12-184-8/+63
| | | | | | | | | | | | lynx, curl etc. Note that this patch differs significantly from that in the PR, as the submitter refined it after submitting the PR. PR: 110388 Submitted by: Alexander Pohoyda <alexander.pohoyda@gmx.net> MFC after: 3 weeks Notes: svn path=/head/; revision=174752
* Old patch I had lying around: correctly cast the argument to is*().Dag-Erling Smørgrav2007-12-183-24/+25
| | | | | | | | | IWBNI gcc could warn about this the way it warns about printf() abuse. MFC after: 1 week Notes: svn path=/head/; revision=174751
* Use fixed point integer math instead of floating point math whenJason Evans2007-12-181-42/+47
| | | | | | | | | | | | | calculating run sizes. Use of the floating point unit was a potential pessimization to context switching for applications that do not otherwise use floating point math. [1] Reformat cpp macro-related comments to improve consistency. Submitted by: das Notes: svn path=/head/; revision=174745
* Fix logical bug in the bzip2 reading code, which results in bogus EIOMaxim Sobolev2007-12-182-2/+48
| | | | | | | | | | | | | | | | | | | | | | | | returned on a perfectly valid bzip2 stream whose decompressed size is multiple of read-ahead buffer size. Reproduce the problem is easy: create some power-of-two sized file (truncate -s 1m file will do), bzip2 it and try to load it as md_image from loader. See how it fails. The bug doesn't affect gzip code (which most of bzip2-reading code was copied from) probably due to the fact that libgzip doesn't report Z_STREAM_END with the last block, but requires extra call to inflate() to retrieve it and has some extra data in the input stream at that time. However, apply similar fix to gzipfs.c just in the case the API will change in the future to do what bzip2 code does. Add some ifdef'ed code to enable testing bzipfs.c from witin normal FreeBSD environment as opposed to the restricted loader one, so that one can use gdb and whatnot. Sponsored by: Sippy Software, Inc., http://www.sippysoft.com/ MFC in: 7 days Notes: svn path=/head/; revision=174741
* Catch up with vfprintf.c,v 1.77.David Schultz2007-12-181-0/+1
| | | | Notes: svn path=/head/; revision=174733
* Remove z_abs(). The z_*() functions were in libf77, and for some reasonDavid Schultz2007-12-182-8/+0
| | | | | | | | | | | someone thought it would be a good idea to copy z_abs() to libm in 1994. However, it's never been declared or documented anywhere, and I'm reasonably confident that nobody uses it. Discussed with: bde, deischen, kan Notes: svn path=/head/; revision=174732
* Oops, the previous commit was not needed -- the file was committed butBruce Evans2007-12-171-1/+1
| | | | | | | not checked out due to my checkout error. Notes: svn path=/head/; revision=174720
* Translate from the i386 so that this compiles and runs.Bruce Evans2007-12-171-1/+1
| | | | | | | | | | I hope that this and the i386 version of it will not be needed, but this is currently about 16 cycles or 36% faster than the C version, and the i386 version is about 8 cycles or 19% faster than the C version, due to poor optimization of the C version. Notes: svn path=/head/; revision=174719
* Moved logging out of the nss_method_lookup() in order not toMichael Bushkov2007-12-171-9/+13
| | | | | | | flood logs with failed fallback method lookup attempts. Notes: svn path=/head/; revision=174716
* Don't try to build s_nanl.c before it is committed.Bruce Evans2007-12-171-1/+1
| | | | Notes: svn path=/head/; revision=174715
* Add logbl(3) to libm.David Schultz2007-12-179-32/+184
| | | | Notes: svn path=/head/; revision=174698
* Add function prototypes.David Xu2007-12-171-1/+7
| | | | Notes: svn path=/head/; revision=174696
* Refactor features a bit in order to make it possible to disable lazyJason Evans2007-12-171-52/+127
| | | | | | | | | | | | deallocation and dynamic load balancing via the MALLOC_LAZY_FREE and MALLOC_BALANCE knobs. This is a non-functional change, since these features are still enabled when possible. Clean up a few things that more pedantic compiler settings would cause complaints over. Notes: svn path=/head/; revision=174695
* Document the fact that we have nan(3) now, and make some minor clarificationsDavid Schultz2007-12-171-10/+14
| | | | | | | in other places. Notes: svn path=/head/; revision=174694
* Remove hacks to allow libkse to export its symbols in the LIBTHREAD_1_0Daniel Eischen2007-12-16102-481/+0
| | | | | | | | version namespace which was needed before the library version was bumped. Notes: svn path=/head/; revision=174689
* Implement and document nan(), nanf(), and nanl(). This commitDavid Schultz2007-12-168-8/+302
| | | | | | | | | | adds two new directories in msun: ld80 and ld128. These are for long double functions specific to the 80-bit long double format used on x86-derived architectures, and the 128-bit format used on sparc64, respectively. Notes: svn path=/head/; revision=174684
* Export gdtoa's __ULto{x,Q}_D2A routine in a private namespace soDavid Schultz2007-12-165-0/+17
| | | | | | | libm can use it. Notes: svn path=/head/; revision=174681
* Arrange so that the NaN returned by strtod("nan", NULL) is the same asDavid Schultz2007-12-165-27/+27
| | | | | | | the NaN returned by strtod("nan()", NULL). Notes: svn path=/head/; revision=174680
* Add a berase() function which uses ioctl(DIOCGDELETE) to erase a slabPoul-Henning Kamp2007-12-164-8/+42
| | | | | | | of the disk. Notes: svn path=/head/; revision=174668
* 1. Add csqrt{,f}(3).David Schultz2007-12-151-2/+10
| | | | | | | | 2. Put carg{,f}(3) under the FBSD_1.1 namespace where it belongs (requested by kan@) Notes: svn path=/head/; revision=174618
* Implement and document csqrt(3) and csqrtf(3).David Schultz2007-12-154-2/+290
| | | | Notes: svn path=/head/; revision=174617
* Increment the version namespace for 8.0-current. New symbols andDaniel Eischen2007-12-141-0/+5
| | | | | | | symbols whose ABI has changed should be added to FBSD_1.1. Notes: svn path=/head/; revision=174595
* Clean up namespace violations.Dag-Erling Smørgrav2007-12-147-314/+314
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=174588
* Update the standards section, and make a minor clarification about theDavid Schultz2007-12-141-5/+10
| | | | | | | return value of sqrt. Notes: svn path=/head/; revision=174586
* 1. Add function pthread_mutex_setspinloops_np to turn a mutex's spinDavid Xu2007-12-143-29/+114
| | | | | | | | | | | loop count. 2. Add function pthread_mutex_setyieldloops_np to turn a mutex's yield loop count. 3. Make environment variables PTHREAD_SPINLOOPS and PTHREAD_YIELDLOOPS to be only used for turnning PTHREAD_MUTEX_ADAPTIVE_NP mutex. Notes: svn path=/head/; revision=174585
* Typo in previous commitDavid Schultz2007-12-141-2/+2
| | | | Notes: svn path=/head/; revision=174584
* Symbol.map additions for carg and cargf. (They're in C99, so I didn'tDavid Schultz2007-12-141-0/+2
| | | | | | | add a new version for them.) Notes: svn path=/head/; revision=174583