summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Add phraseAndrey A. Chernov2007-04-301-1/+2
| | | | | | | | "so altering the argument shall change the environment." into putenv description. Notes: svn path=/head/; revision=169142
* Make putenv() fully conforms to Open Group specs Issue 6Andrey A. Chernov2007-04-304-26/+58
| | | | | | | | | | | | | | (also IEEE Std 1003.1-2001) The specs explicitly says that altering passed string should change the environment, i.e. putenv() directly puts its arg into environment (unlike setenv() which just copies it there). It means that putenv() can't be implemented via setenv() (like we have before) at all. Putenv() value lives (allows modifying) up to the next putenv() or setenv() call. Notes: svn path=/head/; revision=169138
* Remove special case skipping initial '=' of the setenv() value "forAndrey A. Chernov2007-04-302-7/+0
| | | | | | | | | | | | compatibility with the different environment conventions" (man page). With the standards, we don't have them different anymore and IEEE Std 1003.1-2001 says that "The values that the environment variables may be assigned are not restricted except that they are considered to end with a null byte" Notes: svn path=/head/; revision=169111
* Make setenv, putenv, getenv and unsetenv conforming to Open Group specsAndrey A. Chernov2007-04-304-19/+48
| | | | | | | | | | | | Issue 6 (also IEEE Std 1003.1-2001) in following areas: args, return, errors. Putenv still needs rewriting because specs explicitly says that altering passed string later should change the environment (currently we copy the string so can't provide that). Notes: svn path=/head/; revision=169109
* Add missing links and sort.Pawel Jakub Dawidek2007-04-291-3/+9
| | | | Notes: svn path=/head/; revision=169104
* Make sure FBSDprivate_1.0 is located at the end of the versionAlexander Kabaev2007-04-291-1/+1
| | | | | | | inheritance chain. Notes: svn path=/head/; revision=169096
* Use C comments since we now preprocess these files with CPP.Daniel Eischen2007-04-2930-166/+242
| | | | Notes: svn path=/head/; revision=169092
* Number the private version namespace in case we ever want to haveDaniel Eischen2007-04-291-1/+1
| | | | | | | compatibility between versions (as we do for the public namespace). Notes: svn path=/head/; revision=169091
* Remove the MSG_PEEK flag from the documentation of the send(2) syscall -Peter Pentchev2007-04-271-1/+0
| | | | | | | | | | | it is only relevant to receiving data from sockets, not to sending. PR: 109667 Submitted by: Jari Kirma <kirma@cs.hut.fi> Approved by: wollman Notes: svn path=/head/; revision=169066
* Make inet6_rth_* family of functions more compliant with RFC3542:Mike Makonnen2007-04-191-1/+9
| | | | | | | | | | | | | | 1. CMSG_NXTHDR(mhdr, cmsg) is supposed to dereference cmsg and return the next header in the chain. If cmsg is NULL it should return the first header, behaving essentially like CMSG_FIRSTHDR(). 2. inet6_rth_(space|init|add) should do basic checking on their input to verify that the number of headers (segments) is between 0 and 127 inclusive. MFC-After: 1 month Notes: svn path=/head/; revision=168867
* Grammer correction from: emastePoul-Henning Kamp2007-04-191-1/+1
| | | | Notes: svn path=/head/; revision=168862
* Loosen return value spec for fputs to be standards compliant so peoplePoul-Henning Kamp2007-04-191-5/+2
| | | | | | | don't program against our more restrictive behaviour. Notes: svn path=/head/; revision=168858
* Cleanup sysconf(3) a bit. sysconf(3) assumes in some places it operatesPawel Jakub Dawidek2007-04-141-21/+18
| | | | | | | | | | | | | on int, but in fact it should operate on long. - Introduce 'lvalue' variable, which is long. - Fix _SC_XOPEN_SHM for 64bit archs. - Fix _SC_PHYS_PAGES for 64bit archs. Reported by: simokawa - Use lvalue for pathconf(3), as it returns long. - Cast value explicitly to long on return. Notes: svn path=/head/; revision=168718
* Belatedly bump Dd for my recent changes.Ed Maste2007-04-111-1/+1
| | | | Notes: svn path=/head/; revision=168634
* Expand the description of the host's UUID.Ruslan Ermilov2007-04-101-3/+3
| | | | | | | OK'ed by: pjd Notes: svn path=/head/; revision=168579
* Swap "underflow"/"overflow" in the table header.Ruslan Ermilov2007-04-101-2/+2
| | | | | | | | Submitted by: Ricardo Nabinger Sanchez MFC after: 3 days Notes: svn path=/head/; revision=168578
* Clean-ip TLS symbol versions. [_]__tls_get_addr function is part ofAlexander Kabaev2007-04-092-6/+2
| | | | | | | | | | the platform ABI and as such does not belong in FBSDprivate. __libc_tls_* functions do not have to be visible to outside world at all. Notes: svn path=/head/; revision=168556
* Document KERN_HOSTUUID.Pawel Jakub Dawidek2007-04-091-1/+4
| | | | | | | Reminded by: ru Notes: svn path=/head/; revision=168551
* Document PT_GETNUMLWPS.Ed Maste2007-04-091-0/+3
| | | | Notes: svn path=/head/; revision=168537
* Describe PT_GETLWPLIST's arguments.Ed Maste2007-04-071-0/+9
| | | | Notes: svn path=/head/; revision=168447
* __p_rcode_syms is declared as external in resolv.conf, so it cannot beAlexander Kabaev2007-04-062-1/+2
| | | | | | | | | | | | | redeclared as static in res_debug.c. Make __p_rcode_syms global and add it to Symbol map. The rest of __p_??_syms are already global. Choice of FBSD_1.0 version for these debug symbols seems strange and should be revisited before symbol versioning is enabled for libc.so.7. Notes: svn path=/head/; revision=168441
* Bump date.Pawel Jakub Dawidek2007-04-053-3/+3
| | | | Notes: svn path=/head/; revision=168398
* Implement SEEK_DATA and SEEK_HOLE extensions to lseek(2) as found inPawel Jakub Dawidek2007-04-052-1/+65
| | | | | | | | | OpenSolaris. For more information please refer to: http://blogs.sun.com/bonwick/entry/seek_hole_and_seek_data Notes: svn path=/head/; revision=168397
* Add security.jail.mount_allowed sysctl, which allows to mount andPawel Jakub Dawidek2007-04-051-0/+7
| | | | | | | | | | | | | | | | | | | | | unmount jail-friendly file systems from within a jail. Precisely it grants PRIV_VFS_MOUNT, PRIV_VFS_UNMOUNT and PRIV_VFS_MOUNT_NONUSER privileges for a jailed super-user. It is turned off by default. A jail-friendly file system is a file system which driver registers itself with VFCF_JAIL flag via VFS_SET(9) API. The lsvfs(1) command can be used to see which file systems are jail-friendly ones. There currently no jail-friendly file systems, ZFS will be the first one. In the future we may consider marking file systems like nullfs as jail-friendly. Reviewed by: rwatson Notes: svn path=/head/; revision=168396
* Avoid using intermediate variables by just comparing betweenXin LI2007-04-051-27/+15
| | | | | | | | | | | | | | | two values, the latter does not tend to have sign extension and/or overflow bugs, and makes the code more obvious. While I'm there, make use of a macro which is derived from bin/ps/ps.c: ps_compat() to improve the readability of the code. Suggested by: bde MFC after: 1 week Notes: svn path=/head/; revision=168377
* Import amd64 assembly implementations of div(3) family from NetBSD.Jung-uk Kim2007-04-044-0/+51
| | | | | | | Obtained from: NetBSD Notes: svn path=/head/; revision=168336
* Add entry for dl_iterate_phdr.Alexander Kabaev2007-04-031-0/+1
| | | | Notes: svn path=/head/; revision=168316
* Add stub for dl_iterate_phdr.Alexander Kabaev2007-04-031-0/+10
| | | | Notes: svn path=/head/; revision=168314
* Use size_t instead of unsigned for pagesize-related values, in order toJason Evans2007-03-291-4/+8
| | | | | | | | | | | | avoid downcasting issues. In particular, this change fixes posix_memalign(3) for alignments greater than 2^31 on LP64 systems. Make sure that NDEBUG is always set to be compatible with MALLOC_DEBUG. [1] Reported by: [1] Lee Hyo geol <hyogeollee@gmail.com> Notes: svn path=/head/; revision=168029
* Remove the run promotion/demotion machinery. Replace it with red-blackJason Evans2007-03-281-430/+219
| | | | | | | | | | | | | | | | | | | | | | | | | | trees that track all non-full runs for each bin. Use the red-black trees to be able to guarantee that each new allocation is placed in the lowest address available in any non-full run. This change completes the transition to allocating from low addresses in order to reduce the retention of sparsely used chunks. If the run in current use by a bin becomes empty, deallocate the run rather than retaining it for later use. The previous behavior had the tendency to spread empty runs across multiple chunks, thus preventing the release of chunks that were completely unused. Generalize base_chunk_alloc() (and rename it to base_pages_alloc()) to handle allocation sizes larger than the chunk size, so that it is possible to support chunk sizes that are smaller than an arena object. Reduce the minimum chunk size from 64kB to 8kB. Optimize tracking of addresses for deleted chunks. Fix a statistics bug for huge allocations. Notes: svn path=/head/; revision=168003
* Change macro in order to refer to FreeBSD 7.0 instead of 7.0BSD.Jason Evans2007-03-281-2/+2
| | | | | | | Reported by: Michal Mertl <mime@traveller.cz> Notes: svn path=/head/; revision=168001
* Update the IMPLEMENTATION NOTES section to reflect recent mallocJason Evans2007-03-281-13/+30
| | | | | | | enhancements. Notes: svn path=/head/; revision=167969
* Remove some stray roff formatting that caused incorrect rendering.Jason Evans2007-03-281-1/+0
| | | | Notes: svn path=/head/; revision=167968
* Add a HISTORY section.Jason Evans2007-03-281-0/+5
| | | | Notes: svn path=/head/; revision=167967
* Fix some subtle bugs for posix_memalign() having to do with integerJason Evans2007-03-241-18/+43
| | | | | | | | | | | rounding and overflow. Carefully document what the various overflow tests actually detect. The bugs mostly canceled out, such that the worst possible failure cases resulted in non-fatal over-allocations. Notes: svn path=/head/; revision=167872
* Fix posix_memalign() for large objects. Now that runs are extents ratherJason Evans2007-03-231-151/+297
| | | | | | | | | | | than binary buddies, the alignment guarantees are weaker, which requires a more complex aligned allocation algorithm, similar to that used for alignment greater than the chunk size. Reported by: matteo Notes: svn path=/head/; revision=167853
* Use extents rather than binary buddies to track free pages withinJason Evans2007-03-231-323/+332
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | chunks. This allows runs to be any multiple of the page size. The primary advantage is that large objects are no longer constrained to be 2^n pages, which can dramatically decrease internal fragmentation for large objects. This also allows the sizes for runs that back small objects to be more finely tuned. Free runs are searched for linearly using the chunk page map (with the help of some heuristic optimizations). This changes the allocation policy from "first best fit" to "first fit". A prototype red-black tree implementation for tracking free runs that implemented "first best fit" did not cause a measurable speed or memory usage difference for realistic chunk sizes (though of course it is possible to construct benchmarks that favor one allocation policy over another). Refine the handling of fullness constraints for small runs to be more tunable. Restructure the per chunk page map to contain only two fields per entry, rather than four. Also, increase each entry from 4 to 8 bytes, since it allows for 32-bit integers, without increasing the number of chunk header pages. Relax the maximum chunk size constraint. This is of no practical interest; it is merely fallout from the chunk page map restructuring. Revamp statistics gathering and reporting to be faster, clearer and more informative. Statistics gathering is fast enough now to have little to no impact on application speed, but it still requires approximately two extra pages of memory per arena (per process). This memory overhead may be acceptable for most systems, but we still need to leave statistics gathering disabled by default in RELENG branches. Rename NO_MALLOC_EXTRAS to MALLOC_PRODUCTION in order to make its intent clearer (i.e. it should be defined in RELENG branches). Notes: svn path=/head/; revision=167828
* Let people in on the magic of INET[6]_ADDRSTRLEN which comes quite handy inMax Laier2007-03-211-1/+6
| | | | | | | | | combination with inet_ntop(). Reviewed by: trhodes "works for me" Notes: svn path=/head/; revision=167759
* Avoid using vsnprintf(3) unless MALLOC_STATS is defined, in order toJason Evans2007-03-201-152/+233
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | avoid substantial potential bloat for static binaries that do not otherwise use any printf(3)-family functions. [1] Rearrange arena_run_t so that the region bitmask can be minimally sized according to constraints related to each bin's size class. Previously, the region bitmask was the same size for all run headers, which wasted a measurable amount of memory. Rather than making runs for small objects as large as possible, make runs as small as possible such that header overhead stays below a certain bound. There are two exceptions that override the header overhead bound: 1) If the bound is impossible to honor, it is relaxed on a per-size-class basis. Since there is one bit of header overhead per object (plus a constant), it is impossible to achieve a header overhead less than or equal to 1/(# of bits per object). For the current setting of maximum 0.5% header overhead, this relaxation comes into play for {2, 4, 8, 16}-byte objects, for which header overhead is (on 64-bit systems) {7.1, 4.3, 2.2, 1.2}%, respectively. 2) There is still a cap on small run size, still set to 64kB. This comes into play for {1024, 2048}-byte objects, for which header overhead is {1.6, 3.1}%, respectively. In practice, this reduces the run sizes, which makes worst case low-water memory usage due to fragmentation less bad. It also reduces worst case high-water run fragmentation due to non-full runs, but this is only a constant improvement (most important to small short-lived processes). Reduce the default chunk size from 2MB to 1MB. Benchmarks indicate that the external fragmentation reduction makes 1MB the new sweet spot (as small as possible without adversely affecting performance). Reported by: [1] kientzle Notes: svn path=/head/; revision=167733
* o Add ENVIRONMENT section and mention there that TMPDIR is ignoredMaxim Konovalov2007-03-161-1/+14
| | | | | | | | | | | when issetugid(3) is true. PR: docs/108346 Obtained from: OpenBSD MFC after: 1 week Notes: svn path=/head/; revision=167652
* - Sysctl's move to seperate fileRandall Stewart2007-03-151-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - moved away from ifn/ifa access to sctp_ifa/sctp_ifn built and managed by the add-ip code. - cleaned up add-ip code to use the iterator - made iterator be a thread, which enables auto-asconf now. - rewrote and cleaned up source address selection (also made it use new structures). - Fixed a couple of memory leaks. - DACK now settable as to how many packets to delay as well as time. - connectx() to latest socket API, new associd arg. - Fixed issue with revoking and loosing potential to send when we inflate the flight size. We now inflate the cwnd too and deflate it later when the revoked chunk is sent or acked. - Got rid of some temp debug code - src addr selection moved to a common file (sctp_output.c) - Support for simple VRF's (we have support for multi-vfr via compile switch that is scrubbed from BSD but we won't need multi-vrf until we first get VRF :-D) - Rest of mib work for address information now done - Limit number of addresses in INIT/INIT-ACK to a #def (30). Reviewed by: gnn Notes: svn path=/head/; revision=167598
* Wordsmithery.Bruce M Simpson2007-03-091-1/+1
| | | | | | | Pointed out by: ru Notes: svn path=/head/; revision=167380
* Document SO_ACCEPTCONN.Bruce M Simpson2007-03-081-1/+9
| | | | | | | | Submitted by: Vlad GALU (with changes) MFC after: 3 days Notes: svn path=/head/; revision=167335
* Fix license. Clause 4 is still required (UCB materiel).Bruce M Simpson2007-03-071-6/+5
| | | | | | | | Submitted by: rwatson Pointy hat to: bms Notes: svn path=/head/; revision=167292
* use 2-clause BSD license as per hoskins strike-off july 22 1999.Bruce M Simpson2007-03-071-4/+6
| | | | | | | use wording of FreeBSD License. Notes: svn path=/head/; revision=167287
* Only reject file descriptors higher than FD_SETSIZE if we are not usingJohn Baldwin2007-03-051-7/+5
| | | | | | | | | | | | | | | | poll(2) or kqueue(2). Previously we rejected fd's higher than FD_SETSIZE for kevent(2), and larger than sysconf(_SC_OPEN_MAX) for poll(2). However, the check for poll(2) wasn't really needed. open(2) and socket(2) won't return an fd you can't pass to either poll(2) or kevent(2). This fixes a but where gethostbyname() would fail if you had more than 1023 files open in a process. MFC after: 1 week Reviewed by: ume Found by: ps Notes: svn path=/head/; revision=167246
* Apply my patch properly.Ruslan Ermilov2007-03-051-1/+1
| | | | Notes: svn path=/head/; revision=167237
* Fix markup.Bruce M Simpson2007-03-051-22/+36
| | | | | | | | Submitted by: ru MFC after: 2 days Notes: svn path=/head/; revision=167235
* .Xr nit.Bruce M Simpson2007-03-051-2/+2
| | | | | | | Submitted by: brueffer Notes: svn path=/head/; revision=167231
* Update shutdown() manual page to reflect actual behaviour of code.Bruce M Simpson2007-03-051-10/+82
| | | | | | | | | | | Add IMPLEMENTATION NOTES section explaining in detail the effect this system call has in common use cases involving PF_INET and PF_INET6 sockets. PR: kern/84761 MFC after: 2 days Notes: svn path=/head/; revision=167228