summaryrefslogtreecommitdiff
path: root/lib/libc
Commit message (Collapse)AuthorAgeFilesLines
* MFC r191414Christian Brueffer2009-04-232-2/+2
| | | | | | | | | | Correct the information about when the respective functionality first appeared in FreeBSD. Approved by: re (kensmith) Notes: svn path=/releng/7.2/; revision=191427
* MFH r190382,190416,190525:Hajimu UMEMOTO2009-04-121-90/+197
| | | | | | | | | | | | | | | | | | - getaddrinfo(3) should accept numeric when ai_socktype is not specified in hint or hints is NULL. - Add support for SCTP to getaddrinfo(3). Now, getaddrinfo(3) returns two SOCK_STREAMs, IPPROTO_TCP and IPPROTO_SCTP. It confuses some programs. If getaddrinfo(3) returns IPPROTO_SCTP when SOCK_STREAM is specified by hints.ai_socktype, at least Apache doesn't work. So, I made getaddrinfo(3) to return IPPROTO_SCTP with SOCK_STREAM only when IPPROTO_SCTP is specified explicitly by hints.ai_protocol. - Query DNS only once per an address family. Approved by: re (kib) Notes: svn path=/stable/7/; revision=190972
* MFC r190482: zero out memory before use and free.Xin LI2009-04-115-28/+11
| | | | | | | | Approved by: re (kib) Security: Potential Information Leak Notes: svn path=/stable/7/; revision=190939
* MFC r190266:Konstantin Belousov2009-03-251-1/+1
| | | | | | | | | 7.2 will be the first release where strndup() appears. Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=190415
* Mostly synchronize lib/libthr and sys/kern/kern_umtx.c with the codeKonstantin Belousov2009-03-245-0/+32
| | | | | | | | | | | | | | | | | | | | | | from HEAD. Since libkse is still built on RELENG_7, pthread_cleanup_push/pop are left as the functions, but the support code in libthr is present for the macro versions. Malloc in RELENG_7 does not require thread exit hook, but I decided to add empty handler for it, instead of removing callback from thr_exit(). No mergeinfo since this change is prepared by patching libthr and then bringing in required missed bits. Requested by: bms Reviewed by: davidxu Tested by: bms, Mykola Dzham <i levsha org ua> Approved by: re (kensmith) Notes: svn path=/stable/7/; revision=190393
* Partial MFC of r189131:David Schultz2009-03-142-2/+2
| | | | | | | | | Make sure %zd treats negative arguments properly on 32-bit platforms. PR: 131880 Notes: svn path=/stable/7/; revision=189802
* MFC r189283:Konstantin Belousov2009-03-121-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Correct types of variables used to track amount of allocated SysV shared memory from int to size_t. Implement a workaround for current ABI not allowing to properly save size for and report more then 2GB sized segment of shared memory. This makes it possible to use > 2 GB shared memory segments on 64bit architectures. Please note the new BUGS section in shmctl(2) and UPDATING note for limitations of this temporal solution. MFC r189398: Systematically use vm_size_t to specify the size of the segment for VM KPI. Do not overload the local variable size in kern_shmat() due to vm_size_t change. Fix style bug by adding explicit comparision with 0. MFC r189399: Improve the grammar and wording in the changes to shmctl(2) manpage. Put an UPDATING entry and bump __FreeBSD_version for the change. Notes: svn path=/stable/7/; revision=189740
* MFC: Add support for "superpages" on amd64 and i386. This includes adding theJohn Baldwin2009-02-261-0/+2
| | | | | | | | | | | superpage reservation system to the machine-independent VM system as well as changes to the pmap code for amd64 and i386 to support superpages. Reviewed by: alc Tested by: ps Notes: svn path=/stable/7/; revision=189075
* MFC:Jamie Gritton2009-02-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r188144: Standardize the various prison_foo_ip[46] functions and prison_if to return zero on success and an error code otherwise. The possible errors are EADDRNOTAVAIL if an address being checked for doesn't match the prison, and EAFNOSUPPORT if the prison doesn't have any addresses in that address family. For most callers of these functions, use the returned error code instead of e.g. a hard-coded EADDRNOTAVAIL or EINVAL. Always include a jailed() check in these functions, where a non-jailed cred always returns success (and makes no changes). Remove the explicit jailed() checks that preceded many of the function calls. r188146: Don't allow creating a socket with a protocol family that the current jail doesn't support. This involves a new function prison_check_af, like prison_check_ip[46] but that checks only the family. With this change, most of the errors generated by jailed sockets shouldn't ever occur, at least until jails are changeable. r188148: Remove redundant calls of prison_local_ip4 in in_pcbbind_setup, and of prison_local_ip6 in in6_pcbbind. r188149: Call prison_if from rtm_get_jailed, instead of splitting it out into prison_check_ip4 and prison_check_ip6. As prison_if includes a jailed() check, remove that check before calling rtm_get_jailed. r188151: Don't bother null-checking the thread pointer before the prison checks in udp6_connect (td is already dereferenced elsewhere without such a check). This makes the conversion from a sockaddr to a sockaddr_in6 always happen, so convert once at the beginning of the function rather than twice in the middle. Approved by: bz (mentor) Notes: svn path=/stable/7/; revision=188761
* MFH 188316: Shutup warning for DNAME RR.Hajimu UMEMOTO2009-02-162-2/+3
| | | | | | | | PR: bin/127591 Submitted by: "Eugene M. Kim" <20080111.freebsd.org__at__ab.ote.we.lv> Notes: svn path=/stable/7/; revision=188690
* MFC r183058Maksim Yevmenkin2009-02-101-0/+7
| | | | | | | | | | | | | | Add uuid_enc,dec_le,be() functions to Symbol.map Pointy hat goes to me. MFC r183192 Move uuid_enc_le, uuid_dec_le, uuid_enc_be and uuid_dec_be symbols into FBSD_1.1 section where they should be (as Pointed out by: kib, deischen) Notes: svn path=/stable/7/; revision=188454
* MFC:Bjoern A. Zeeb2009-02-072-9/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | r185435: This enhances the current jail implementation to permit multiple addresses per jail. In addtion to IPv4, IPv6 is supported as well. Due to updated checks it is even possible to have jails without an IP address at all, which basically gives one a chroot with restricted process view, no networking,.. SCTP support was updated and supports IPv6 in jails as well. Cpuset support permits jails to be bound to specific processor sets after creation. Jails can have an unrestricted (no duplicate protection, etc.) name in addition to the hostname. The jail name cannot be changed from within a jail and is considered to be used for management purposes or as audit-token in the future. DDB 'show jails' command was added to aid debugging. Proper compat support permits 32bit jail binaries to be used on 64bit systems to manage jails. Also backward compatibility was preserved where possible: for jail v1 syscalls, as well as with user space management utilities. Both jail as well as prison version were updated for the new features. A gap was intentionally left as the intermediate versions had been used by various patches floating around the last years. Bump __FreeBSD_version for the afore mentioned and in kernel changes. r185441: Unbreak the no-networks (no INET/6) build. r185899: Correctly check the number of prison states to not access anything outside the prison_states array. When checking if there is a name configured for the prison, check the first character to not be '\0' instead of checking if the char array is present, which it always is. Note, that this is different for the *jailname in the syscall. Found with: Coverity Prevent(tm) CID: 4156, 4155 r186085: Make sure that the direct jls invocations prints something reasonable close to and in the same format as it had always. r186606: Make sure that unused j->ip[46] are cleared. r186834: Document the special loopback address behaviour of jails. PR: kern/103464 r186841: Put the devfs ruleset next to devfs enable, add a comment about the suggested ruleset[1]. While here use an IP from the 'test-net' prefix for docs. PR: kern/130102 r187059: Add a short section talking about jails and file systems; mention the mountand jail-aware file systems as well as quota. PR: kern/68192 r187092: Sort .Xr. r187365: s,unmount 8,umount 8, it is unmount(2) which I did not mean. r187669: Update the description of the '-h' option wrt to primary addresses per address family and add a reference to the ip-addresses option. r187670: New sentence starts on a new line. Notes: svn path=/stable/7/; revision=188281
* MFC r186887:David Schultz2009-01-281-0/+1
| | | | | | | | | Set the error indicator on an attempt to write to a read-only stream. PR: 127335 Notes: svn path=/stable/7/; revision=187810
* MFC r187098:Daniel Gerzo2009-01-181-2/+3
| | | | | | | | | | | - add missing include [2] - fix struct memeber's name [1] PR: docs/130413 [1] Submitted by: Thomas Mueller <tmueller@sysgo.com> [1], rink@ [2] Notes: svn path=/stable/7/; revision=187411
* MFC r187147:Konstantin Belousov2009-01-161-1/+1
| | | | | | | | Document that ffsll(3) and flsll(3) functions first appeared in FreeBSD 7.1. Notes: svn path=/stable/7/; revision=187329
* MFC 182795 from /headGiorgos Keramidas2009-01-151-0/+8
| | | | | | | | | | | Add two example regexps: (1) one for matching all the characters that belong in a character class, and (2) one for matching all the characters *not* in a character class. Submitted by: Mark B, mkbucc at gmail.com Notes: svn path=/stable/7/; revision=187278
* Sort MLINKS.Ruslan Ermilov2009-01-091-21/+32
| | | | Notes: svn path=/stable/7/; revision=186957
* MFC r185689:Konstantin Belousov2009-01-084-5/+77
| | | | | | | | | | | | | | | Order the str*.c files mostly alphabetical. MFC r185690: Import the strndup(3) function. MFC r185777: Add strndup(3) prototype to string.h. Manually change #undef HAVE_STRNDUP to #define HAVE_STRNDUP 1 for the configure.h files that need it. Notes: svn path=/stable/7/; revision=186890
* MFC r180162:Daniel Gerzo2009-01-061-1/+18
| | | | | | | | | | - AI_ALL and AI_V4MAPPED flags are currently not supported PR: docs/120248 Submitted by: Heiko Wundram <wundram (a) beenic.net> Notes: svn path=/stable/7/; revision=186818
* MFC r180534:Daniel Gerzo2009-01-061-3/+3
| | | | | | | | | | - Update the definition of modspecific structure PR: docs/125630 Submitted by: Mateusz Guzik <mjguzik@gmail.com> Notes: svn path=/stable/7/; revision=186811
* MFC 186090Hajimu UMEMOTO2008-12-177-28/+182
| | | | | | | | | | | | | | | | | Update our resolver to BIND 9.4.3. Merge the resolver part of BIND 9.4.3 into HEAD. 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=/stable/7/; revision=186220
* 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=/stable/7/; revision=186042
* MFC: 184996: use the correct syscall names in END() for three asm stubs.Peter Wemm2008-12-063-3/+3
| | | | | | | Approved by: re (kib) Notes: svn path=/stable/7/; revision=185725
* 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=/stable/7/; revision=185704
* 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-398/+339
| | | | | | | | | | | | | | * 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