summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* Merge rev 185725 (184996 in head): Use correct names in END() macros.Peter Wemm2008-12-213-3/+3
| | | | | | | | Approved by: re (kib) Reminded by: kensmith Notes: svn path=/releng/7.1/; revision=186367
* MFC 186090Hajimu UMEMOTO2008-12-177-28/+182
| | | | | | | | | | | | | | | Update our resolver to BIND 9.4.3. It includes the following fix: 2426. [bug] libbind: inet_net_pton() can sometimes return the wrong value if excessively large netmasks are supplied. [RT #18512] Reported by: Maksymilian Arciemowicz <cxib__at__securityreason.com> Approved by: re (kib) Notes: svn path=/releng/7.1/; revision=186221
* MFC: Fix fread() to return a correct value on platforms where sizeof(int) !=Ruslan Ermilov2008-12-131-1/+1
| | | | | | | | | sizeof(size_t), i.e. on all 64-bit platforms. Approved by: re (kib) Notes: svn path=/releng/7.1/; revision=186042
* MFC: r185519Giorgos Keramidas2008-12-061-4/+9
| | | | | | | | | | | | The times(3) function returns the number of CLK_TCKs since the startup time of FreeBSD, not since the UNIX Epoch. PR: docs/122359 Submitted by: Viktor &#352;tujber Approved by: re (kib) Notes: svn path=/releng/7.1/; revision=185705
* MFC r184587:Konstantin Belousov2008-11-175-8/+122
| | | | | | | | | | Add the ffsll and flsll functions. These are ffs and fls operating on long long arguments. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=185025
* MFC: 184547,184548: add END() macros for Assembler code in libc. ThisPeter Wemm2008-11-1370-8/+105
| | | | | | | | | causes the symbol table to include the size of the function. Approved by: re (kib) Notes: svn path=/stable/7/; revision=184939
* MFC:Jason Evans2008-11-102-13/+18
| | | | | | | | | | | Revert to preferring mmap(2) over sbrk(2) when mapping memory, due to potential extreme contention in the kernel for multi-threaded applications on SMP systems. Approved by: re (kib) Notes: svn path=/stable/7/; revision=184819
* MFC r183565:Ed Schouten2008-10-262-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Small cleanups to openpty(). - Pass O_NOCTTY to posix_openpt(2). This makes the implementation work consistently on implementations that make the PTY the controlling TTY by default. - Call unlockpt() before opening the slave device. POSIX mentions that de slave device should only be opened after grantpt() and unlockpt() have been called. - Replace some redundant code by a label. As a safety net, add a call to revoke() to unlockpt(). All applications out there use openpty(), explicitly call revoke() or implement their own PTY allocation routines. Adding the call to unlockpt() won't hurt, but will prevent foot-shooting. Reviewed by: jhb, kib Approved by: re Notes: svn path=/stable/7/; revision=184300
* MFC: Note that support for CPU sets will first appear in 7.1.John Baldwin2008-10-022-2/+2
| | | | | | | Approved by: re (kib) Notes: svn path=/stable/7/; revision=183553
* MFC r182193 (libc part):Konstantin Belousov2008-09-191-2/+10
| | | | | | | | | Document WNOWAIT. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=183185
* Merge r180493 from head to stable/7:Robert Watson2008-08-311-8/+2
| | | | | | | | | | | | | The libc acl_valid(3) function validates the contents of a POSIX.1e ACL. This change removes the requirement that an ACL contain no ACL_USER entries with a uid the same as those of a file, or ACL_GROUP entries with a gid the same as those of a file. This requirement is not in the specification, and not enforced by the kernel's ACL implementation. Reported by: Iustin Pop <iusty at k1024 dot org> Notes: svn path=/stable/7/; revision=182534
* MFC r181281: Make swprintf("%s", "") not fail randomly depending onColin Percival2008-08-301-1/+3
| | | | | | | uninitialized variables. Notes: svn path=/stable/7/; revision=182495
* MFC r181280: Avoid printing bogus error messages if BLOCKSIZE is garbage.Colin Percival2008-08-301-0/+1
| | | | Notes: svn path=/stable/7/; revision=182494
* MFC r181312:Tom Rhodes2008-08-291-1/+3
| | | | | | | | | Add EPERM to the ERRORS section. PR: 125746 Notes: svn path=/stable/7/; revision=182420
* MFC SVN rev 181743Maksim Yevmenkin2008-08-283-2/+148
| | | | | | | | | | | | Import the uuid_enc_le(), uuid_dec_le(), uuid_enc_be() and 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 Notes: svn path=/stable/7/; revision=182409
* MFC allocator improvements and fixes:Jason Evans2008-08-161-400/+341
| | | | | | | | | | | | | | * Enhance the chunk map to support run coalescing, and substantially reduce the number of red-black tree operations performed. * Remove unused code. * Fix arena_run_reg_dalloc() to use the entire precomputed division table. * Improve lock preemption performance for hyperthreaded CPUs. Notes: svn path=/stable/7/; revision=181788
* MFC: r181150, r181266Sean Farley2008-08-081-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | Detect if the application has cleared the environ variable by setting 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 Reviewed by: ache Notes: svn path=/stable/7/; revision=181407
* MFC: Fix a few bugs with the _gettemp() routine which implements mkstemp(),John Baldwin2008-08-041-11/+26
| | | | | | | mkstemps(), and mkdtemp(). Notes: svn path=/stable/7/; revision=181306
* MFC r175798:Tom Rhodes2008-08-031-6/+13
| | | | | | | | | | | | Update this manual page to describe the extattr_list_file() and the extattr_list_fd() functions. PR: 108142 Submitted by: Richard Dawe <rich@phekda.gotadsl.co.uk> Reviewed by: kientzle Notes: svn path=/stable/7/; revision=181259
* Fix whitespace bug (8spaces into tab).Remko Lodder2008-08-021-1/+1
| | | | | | | Submitted by: ed Notes: svn path=/stable/7/; revision=181181
* MFC r180491Remko Lodder2008-08-021-4/+4
| | | | | | | | | | | Update the ktr_header structure, which changed over time. PR: 125546 Submitted by: Mateusz Guzik <mjguzik at gmail dot com> MFC after: 3 days Notes: svn path=/stable/7/; revision=181179
* MFC r178921 to stable/7:Antoine Brodin2008-07-281-4/+0
| | | | | | | | | | | | | Remove useless call to getdtablesize(2) in fdopen(3) and its useless variable nofile. PR: 123109 Submitted by: Christoph Mallon Approved by: rwatson (mentor) MFC after: 1 month Notes: svn path=/stable/7/; revision=180933
* MFC: Add cpuset, an api for thread to cpu binding and cpu resource groupingJohn Baldwin2008-07-254-2/+402
| | | | | | | | | | | | | | | | | | | | and assignment. This is mostly synched up with what is in HEAD with the following exceptions: - I didn't MFC any of the interrupt binding stuff as it requires other changes and I figured this change was large enough as it is. - The sched_affinity() implementation for ULE in HEAD depends on the newer CPU topology stuff as well as other changes in ULE. Rather than backport all of that, I implemented sched_affinity() using the existing CPU topology and ULE code in 7.x. Thus, any bugs in the ULE affinity stuff in 7 are purely my fault and not Jeff's. Note that, just as in HEAD, cpusets currently don't work on SCHED_4BSD (the syscalls will succeed, but they don't have any effect). Tested by: brooks, ps Notes: svn path=/stable/7/; revision=180808
* fix leftover reference to kill(2) (which was used as a template forJulian Elischer2008-07-251-1/+1
| | | | | | | | | this page). Submitted by: Kostik Belousov Notes: svn path=/stable/7/; revision=180793
* Add the appropriate entry to the Symbol map for the new setfib syscallJulian Elischer2008-07-241-0/+4
| | | | Notes: svn path=/stable/7/; revision=180789
* Commit ancillary parts of the MFC that I couldn't do last night becauseJulian Elischer2008-07-242-2/+81
| | | | | | | | | the SVN server went strange (repoman. crashed I believe). Obtained from: Cisco IronPort Notes: svn path=/stable/7/; revision=180783
* MFC an ABI compatible implementation of Multiple routing tables.Julian Elischer2008-07-242-0/+8
| | | | | | | | | | | See the commit message for http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/net/route.c version 1.129 (svn change # 178888) for more info. Obtained from: Ironport (Cisco Systems) Notes: svn path=/stable/7/; revision=180774
* MFC: r175565:Tom Rhodes2008-07-131-1/+2
| | | | | | | | | Xref flopen.3 which references this manual page. PR: 112650 Notes: svn path=/stable/7/; revision=180501
* MFC r180323:Daniel Gerzo2008-07-111-3/+3
| | | | | | | | - remove superfluous word - remove contractions Notes: svn path=/stable/7/; revision=180444
* MFC r180325 and r180329:Daniel Gerzo2008-07-111-3/+35
| | | | | | | | | | | | - This code was intially obtained from NetBSD, but it's missing licence statement. Add the one from the current NetBSD version. - Add description about a missing return value [1] PR: docs/75995 Submitted by: Tarc <tarc@po.cs.msu.su> Notes: svn path=/stable/7/; revision=180441
* MFC rev. 180024:Daniel Gerzo2008-06-301-1/+1
| | | | | | | | | | - Mark the section describing return values with an appropriate section flag. PR: docs/122818 Notes: svn path=/stable/7/; revision=180117
* - MFC rev. 180030 and 180113:Daniel Gerzo2008-06-301-1/+4
| | | | | | | | | | - add description of the MLINK error - bump a date PR: docs/123019 Notes: svn path=/stable/7/; revision=180114
* MFC r173182: remove extraneous .Ef requestGarrett Wollman2008-06-241-2/+1
| | | | Notes: svn path=/stable/7/; revision=179980
* MFC allocator improvements and fixes:Jason Evans2008-06-162-161/+1155
| | | | | | | | | | | | | | | | | | | | * Implement more compact red-black trees, thus reducing memory usage by ~0.5-1%. * Add a separate tree to track dirty-page-containing chunks, thus improving worst case allocation performance. * Fix a deadlock in base_alloc() for the error (OOM) path. * Catch integer overflow for huge allocations when using sbrk(2). * Fix bit vector initialization for run headers. This fix has no practical impact for correct programs. Incorrect programs will potentially experience allocation failures rather than memory corruption, both of which are "undefined behavior". Notes: svn path=/stable/7/; revision=179836
* MFC: r179358,179434 - make libc's fcntl symbol weak and extend the limitedDoug Rabson2008-06-062-1/+4
| | | | | | | forward ABI compatibility for fcntl to the thread libraries. Notes: svn path=/stable/7/; revision=179608
* Increment the version namespace for 8.0-current after MFC'ing aXin LI2008-05-271-0/+6
| | | | | | | | | FBSD_1.1 symbol back to RELENG_7 (MFC of rev. 1.4). Requested by: deischen Notes: svn path=/stable/7/; revision=179369
* MFC: Add memrchr(3).Xin LI2008-05-273-4/+34
| | | | | | | Obtained from: OpenBSD Notes: svn path=/stable/7/; revision=179367
* Merge mac.c:1.13, mac_exec.c:1.3, mac_get.c:1.6, mac_set.c:1.4 from HEADRobert Watson2008-05-204-8/+12
| | | | | | | | | to RELENG_7: Add __FBSDID() tags. Notes: svn path=/stable/7/; revision=179149
* MFCKonstantin Belousov2008-05-193-8/+9
| | | | | | | | | | | | | | | | | | | | rev. 1.15 of lib/libc/gen/readdir.c rev. 1.11 of lib/libc/gen/telldir.c rev. 1.3 of lib/libc/gen/telldir.h Do not read away the target directory entry when encountering deleted files after a seekdir(). The seekdir shall set the position for the next readdir operation. When the _readdir_unlocked() encounters deleted entry, dd_loc is already advanced. Continuing the loop leads to premature read of the target entry. Submitted by: Marc Balmer <mbalmer at openbsd org> Obtained from: OpenBSD Notes: svn path=/stable/7/; revision=179117
* Merge sctp_generic_recvmsg.2:1.4, sctp_peeloff.2:1.4 from HEAD toRobert Watson2008-05-102-2/+1
| | | | | | | | | RELENG_7: Correct minor typos in SCTP man pages. Notes: svn path=/stable/7/; revision=178919
* MFC scandir.c,v 1.9David Schultz2008-05-061-13/+3
| | | | | | | | | | | | | | | | | scandir(3) previously used st_size to obtain an initial estimate of the array length needed to store all the directory entries. Although BSD has historically guaranteed that st_size is the size of the directory file, POSIX does not, and more to the point, some recent filesystems such as ZFS use st_size to mean something else. The fix is to not stat the directory at all, set the initial array size to 32 entries, and realloc it in powers of 2 if that proves insufficient. PR: 113668 Notes: svn path=/stable/7/; revision=178805
* MFC: Include libc_private.h for the declaration of __isthreaded.John Baldwin2008-05-051-0/+1
| | | | Notes: svn path=/stable/7/; revision=178789
* MFC:Sean Farley2008-04-301-1/+0
| | | | | | | | | | | | | | Have the man page catch up with the namespace pollution cleanup that occurred between 2001-2003. Thanks to bde for the history lesson[1] concerning sys/types.h and the many system calls that at one time (pre-2001) were required by POSIX to include it. 1. http://lists.freebsd.org/pipermail/freebsd-arch/2008-April/008126.html src/lib/libc/sys/mkdir.2: rev 1.25 -> 1.26 Notes: svn path=/stable/7/; revision=178702
* MFC: Fix a resource leak in the recent fixes for file descriptors >John Baldwin2008-04-291-0/+1
| | | | | | | SHRT_MAX. Notes: svn path=/stable/7/; revision=178665
* MFC to RELENG_7:Antoine Brodin2008-04-261-1/+1
| | | | | | | | | | | | Don't allocate the constant array "props" on the stack in wctype. PR: 74743 Submitted by: knut st. osmundsen Approved by: rwatson (mentor) MFC after: 1 month Notes: svn path=/stable/7/; revision=178592
* MFC: 1.16: Use calloc() instead of zeroing memory ourselves.Ruslan Ermilov2008-04-221-3/+13
| | | | | | | | 1.17: Better strfmon(3) conversion specifiers sanity checking. 1.18: Fix memory leaks. Notes: svn path=/stable/7/; revision=178415
* MFC to RELENG_7:Antoine Brodin2008-04-201-1/+37
| | | | | | | | | | | | | | | | Introduce a new F_DUP2FD command to fcntl(2), for compatibility with Solaris and AIX. fcntl(fd, F_DUP2FD, arg) and dup2(fd, arg) are functionnaly equivalent. Document it. Add some regression tests (identical to the dup2(2) regression tests). PR: 120233 Submitted by: Jukka Ukkonen Approved by: rwaston (mentor) MFC after: 1 month Notes: svn path=/stable/7/; revision=178353
* MFC revision 1.43:David Xu2008-04-121-22/+63
| | | | | | | Reduce lock contention by replacing mutex with rwlock. Notes: svn path=/stable/7/; revision=178142
* MFC: Kernel mode Network Lock Manager.Doug Rabson2008-04-108-6/+23
| | | | Notes: svn path=/stable/7/; revision=178061
* This commit was manufactured by cvs2svn to create branch 'RELENG_7'.cvs2svn2008-04-102-0/+127
| | | | Notes: svn path=/stable/7/; revision=178052