aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/include
Commit message (Collapse)AuthorAgeFilesLines
* Copy releng/8.2 to release/8.2.0 for 8.2-RELEASE.release/8.2.0_cvsKen Smith2011-02-1614-14/+14
| | | | | | Approved by: re (implicit) This commit was manufactured to restore the state of the 8.2-RELEASE image.
* MFC 199606, 199614:John Baldwin2009-12-171-0/+7
| | | | | | | | | | | | Add an internal _once() method. This works identical to pthread_once(3) with the additional property that it is safe for routines in libc to use in both single-threaded and multi-threaded processes. Multi-threaded processes use the pthread_once() implementation from the threading library while single-threaded processes use a simplified "stub" version internal to libc. Notes: svn path=/stable/8/; revision=200648
* Change the ABI of some of the structures used by the SYSV IPC API:John Baldwin2009-06-241-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - The uid/cuid members of struct ipc_perm are now uid_t instead of unsigned short. - The gid/cgid members of struct ipc_perm are now gid_t instead of unsigned short. - The mode member of struct ipc_perm is now mode_t instead of unsigned short (this is merely a style bug). - The rather dubious padding fields for ABI compat with SV/I386 have been removed from struct msqid_ds and struct semid_ds. - The shm_segsz member of struct shmid_ds is now a size_t instead of an int. This removes the need for the shm_bsegsz member in struct shmid_kernel and should allow for complete support of SYSV SHM regions >= 2GB. - The shm_nattch member of struct shmid_ds is now an int instead of a short. - The shm_internal member of struct shmid_ds is now gone. The internal VM object pointer for SHM regions has been moved into struct shmid_kernel. - The existing __semctl(), msgctl(), and shmctl() system call entries are now marked COMPAT7 and new versions of those system calls which support the new ABI are now present. - The new system calls are assigned to the FBSD-1.1 version in libc. The FBSD-1.0 symbols in libc now refer to the old COMPAT7 system calls. - A simplistic framework for tagging system calls with compatibility symbol versions has been added to libc. Version tags are added to system calls by adding an appropriate __sym_compat() entry to src/lib/libc/incldue/compat.h. [1] PR: kern/16195 kern/113218 bin/129855 Reviewed by: arch@, rwatson Discussed with: kan, kib [1] Notes: svn path=/head/; revision=194910
* Revert unnecessary memset after calloc.Zachary Loafman2009-05-281-1/+0
| | | | | | | | Suggested by: jhb Approved by: dfr (mentor) Notes: svn path=/head/; revision=192976
* Fix an issue when nss fallback routines are used in a multithreaded application.Zachary Loafman2009-05-271-0/+1
| | | | | | | | Reviewed by: bushman Approved by: dfr (mentor) Notes: svn path=/head/; revision=192911
* Add support for the FPA floating-point format on ARM. TheMarcel Moolenaar2008-12-231-0/+9
| | | | | | | | | | | | FPA floating-point format is identical to the VFP format, but is always stored in big-endian. Introduce _IEEE_WORD_ORDER to describe the byte-order of the FP representation. Obtained from: Juniper Networks, Inc Notes: svn path=/head/; revision=186461
* Merge the resolver part of BIND 9.4.3 into HEAD.Hajimu UMEMOTO2008-12-142-1/+40
| | | | | | | | | | | | | 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> Notes: svn path=/head/; revision=186090
* Add thread-specific caching for small size classes, based on magazines.Jason Evans2008-08-271-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | This caching allows for completely lock-free allocation/deallocation in the steady state, at the expense of likely increased memory use and fragmentation. Reduce the default number of arenas to 2*ncpus, since thread-specific caching typically reduces arena contention. Modify size class spacing to include ranges of 2^n-spaced, quantum-spaced, cacheline-spaced, and subpage-spaced size classes. The advantages are: fewer size classes, reduced false cacheline sharing, and reduced internal fragmentation for allocations that are slightly over 512, 1024, etc. Increase RUN_MAX_SMALL, in order to limit fragmentation for the subpage-spaced size classes. Add a size-->bin lookup table for small sizes to simplify translating sizes to size classes. Include a hard-coded constant table that is used unless custom size class spacing is specified at run time. Add the ability to disable tiny size classes at compile time via MALLOC_TINY. Notes: svn path=/head/; revision=182225
* Turn execvpe() into an internal libc routine.Ed Schouten2008-06-231-0/+3
| | | | | | | | | | | | | | | Adding exevpe() has caused some ports to break. Even though execvpe() is a useful routine, it does not conform to any standards. This patch is a little bit different from the patch sent to the mailing list. I forgot to remove execvpe from the Symbol.map (which does not seem to miscompile libc, though). Reviewed by: davidxu Approved by: philip Notes: svn path=/head/; revision=179947
* Make pthread_cleanup_push() and pthread_cleanup_pop() as a pair of macros,David Xu2008-06-092-4/+0
| | | | | | | | | | use stack space to keep cleanup information, this eliminates overhead of calling malloc() and free() in thread library. Discussed on: thread@ Notes: svn path=/head/; revision=179662
* Add some compatibility code so that software which is built to use the newDoug Rabson2008-04-041-0/+3
| | | | | | | | | | struct flock with l_sysid member can work properly on an an old kernel which doesn't support l_sysid. Sponsored by: Isilon Systems Notes: svn path=/head/; revision=177911
* Add pthread_setaffinity_np and pthread_getaffinity_np to libc namespace.David Xu2008-04-022-0/+4
| | | | Notes: svn path=/head/; revision=177855
* Compile libthr with warnings.Ruslan Ermilov2008-03-251-0/+3
| | | | | | | (Somehow this file sneaked from initial commit.) Notes: svn path=/head/; revision=177607
* Compile libthr with warnings.Ruslan Ermilov2008-03-251-0/+3
| | | | Notes: svn path=/head/; revision=177605
* Add pthread_mutex_isowned_np() so there is no need for an additionalDag-Erling Smørgrav2008-02-062-0/+2
| | | | | | | | | prototype next to the implementation. MFC after: 2 weeks Notes: svn path=/head/; revision=176058
* Change the C wrappers for mmap/lseek/pread/pwrite/truncate/ftruncate toPeter Wemm2007-07-041-0/+23
| | | | | | | | | | | | call the pad-less versions of the corresponding syscalls if the running kernel supports it. Check kern.osreldate once per program and cache the result to select the appropriate syscall. This maintains userland compatability with kernel.old's from quite a while back. Approved by: re (kensmith) Notes: svn path=/head/; revision=171219
* Merge BIND 9.4.1 into main chunk.Hajimu UMEMOTO2007-06-031-2/+7
| | | | | | | MFC after: 2 weeks Notes: svn path=/head/; revision=170247
* This commit was generated by cvs2svn to compensate for changes in r170242,Hajimu UMEMOTO2007-06-031-1/+3
|\ | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=170243
| * Vendor import of BIND 9.4.1Hajimu UMEMOTO2007-06-031-1/+3
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=170242
* | Remove 3rd clause, renumber, ok per emailWarner Losh2007-01-122-8/+2
| | | | | | | | Notes: svn path=/head/; revision=165968
* | Upgrade res_update(3) and the friends to BIND9's one excluding TSIGHajimu UMEMOTO2006-05-211-0/+7
| | | | | | | | | | | | | | | | | | support. X-MFC after: never Notes: svn path=/head/; revision=158787
* | This commit was generated by cvs2svn to compensate for changes in r158782,Hajimu UMEMOTO2006-05-211-0/+112
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=158783
| * Vendor import of BIND 9.3.2Hajimu UMEMOTO2006-05-211-0/+112
| | | | | | | | Notes: svn path=/vendor/resolver/dist/; revision=158782
* | - Extend the nsswitch to support Services, Protocols and RpcHajimu UMEMOTO2006-04-282-0/+304
| | | | | | | | | | | | | | | | | | | | | | databases. - Make nsswitch support caching. Submitted by: Michael Bushkov <bushman__at__rsu.ru> Sponsored by: Google Summer of Code 2005 Notes: svn path=/head/; revision=158115
* | Add semaphore functions, and remove some dupes from the #if 0 section.Dag-Erling Smørgrav2006-03-282-4/+20
| | | | | | | | Notes: svn path=/head/; revision=157223
* | Add a bunch of missing pthread functions, and move out-of-order functions.Dag-Erling Smørgrav2006-03-282-13/+128
| | | | | | | | Notes: svn path=/head/; revision=157218
* | We have gmtime_r(3).Hajimu UMEMOTO2006-03-211-0/+1
| | | | | | | | Notes: svn path=/head/; revision=156964
* | - Merge our local changes.Hajimu UMEMOTO2006-03-212-0/+32
| | | | | | | | | | | | | | - Exclude unnecessary functions for us. Notes: svn path=/head/; revision=156956
* | This commit was generated by cvs2svn to compensate for changes in r156952,Hajimu UMEMOTO2006-03-212-0/+249
|\| | | | | | | | | | | | | which included commits to RCS files with non-trunk default branches. Notes: svn path=/head/; revision=156953
| * Vendor import of BIND 9.3.2Hajimu UMEMOTO2006-03-212-0/+249
| | | | Notes: svn path=/vendor/resolver/dist/; revision=156952
* Add entries for new pthread stubs.David Xu2006-03-101-0/+30
| | | | Notes: svn path=/head/; revision=156530
* Add some more pthread stubs so that librt can use them.Daniel Eischen2006-03-052-3/+63
| | | | | | | | | | The thread jump table has been resorted, so you need to keep libc, libpthread, and libthr in sync. Submitted by: xu Notes: svn path=/head/; revision=156319
* In preparation for a new malloc implementation:Jason Evans2006-01-121-3/+4
| | | | | | | | | | | | | | | | * 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) Notes: svn path=/head/; revision=154248
* Move the declaration of __cleanup to libc_private.h as it is used in bothStefan Farfeleder2005-09-121-0/+5
| | | | | | | stdio/ and stdlib/. Don't define __cleanup twice. Notes: svn path=/head/; revision=150040
* Add namespace #defines for usleep.Daniel Eischen2005-08-032-0/+2
| | | | Notes: svn path=/head/; revision=148655
* Update my email address.David Schultz2005-02-061-1/+1
| | | | Notes: svn path=/head/; revision=141379
* Add support for TLS in statically linked programs.Doug Rabson2004-08-151-0/+9
| | | | Notes: svn path=/head/; revision=133754
* When a dynamic NSS module is built and linked against a threadJacques Vidrine2004-03-301-1/+1
| | | | | | | | | | | | | | | | library, it may pull in that thread library at run time. If the process started out single-threaded, this could cause attempts to release locks that do not exist. Guard against this possibility by checking __isthreaded before invoking thread primitives. A similar problem remains if the process is linked against one thread library, but the NSS module is linked against another. This can only be avoided by careful design of the NSS module. Submitted by: Sean McNeil <sean@mcneil.com> (mostly; bugs are mine) Notes: svn path=/head/; revision=127625
* Make the resolver(3) and many associated interfaces much more reentrant.Brian Feldman2004-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The getaddrinfo(3), getipnodebyname(3) and resolver(3) can coincide now with what should be totally reentrant, and h_errno values will now be preserved correctly, but this does not affect interfaces such as gethostbyname(3) which are still mostly non-reentrant. In all of these relevant functions, the thread-safety has been pushed down as far as it seems possible right now. This means that operations that are selected via nsdispatch(3) (i.e. files, yp, dns) are protected still under global locks that getaddrinfo(3) defines, but where possible the locking is greatly reduced. The most noticeable improvement is that multiple DNS lookups can now be run at the same time, and this shows major improvement in performance of DNS-lookup threaded programs, and solves the "Mozilla tab serialization" problem. No single-threaded applications need to be recompiled. Multi-threaded applications that reference "_res" to change resolver(3) options will need to be recompiled, and ones which reference "h_errno" will also if they desire the correct h_errno values. If the applications already understood that _res and h_errno were not thread-safe and had their own locking, they will see no performance improvement but will not actually break in any way. Please note that when NSS modules are used, or when nsdispatch(3) defaults to adding any lookups of its own to the individual libc _nsdispatch() calls, those MUST be reentrant as well. Notes: svn path=/head/; revision=126243
* Add a delta accidentally omitted from the previous commit:David Schultz2004-01-181-0/+3
| | | | | | | | Define DBL_MANH_SIZE and DBL_MANL_SIZE to be the sizes of the high and low words of the mantissa in bits, respectively. Notes: svn path=/head/; revision=124655
* Remove #include of spinlock.h from libc_private.h. Declare spinlocks asDaniel Eischen2003-11-052-5/+4
| | | | | | | | | | struct _spinlock. Keep the typedef in for now; another set of changes may come around to clean up consumers of spinlocks. Requested by: bde Notes: svn path=/head/; revision=122129
* Externalize malloc's spinlock so that a thread library can takeDaniel Eischen2003-11-041-0/+8
| | | | | | | | | | | | | | it around an application's fork() call. Our new thread libraries (libthr, libpthread) can now have threads running while another thread calls fork(). In this case, it is possible for malloc to be left in an inconsistent state in the child. Our thread libraries, libpthread in particular, need to use malloc internally after a fork (in the child). Reviewed by: davidxu Notes: svn path=/head/; revision=122069
* Back out the `hiding' of strlcpy and strlcat. Several peopleJacques Vidrine2003-05-012-4/+0
| | | | | | | vocally objected to this safety belt. Notes: svn path=/head/; revision=114443
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referenceJacques Vidrine2003-04-292-0/+4
| | | | | | | | | | technique) so that we don't wind up calling into an application's version if the application defines them. Inspired by: qpopper's interfering and buggy version of strlcpy Notes: svn path=/head/; revision=114256
* Correct a bug that was somehow both obvious and hard-to-see. :-)Jacques Vidrine2003-04-211-1/+1
| | | | | | | | | | | | | | | An incorrectly-sized allocation was being made due to an incorrect argument to the `sizeof' operator. Obvious, because it violated the `foo = malloc(sizeof(*foo))' idiom. Hard-to-see, because it was a missing `*' (`*p' versus `**p'). Resulting failure was Reported by: ache Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113798
* = Implement name service switch modules (NSS modules). NSS modulesJacques Vidrine2003-04-173-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | may be built into libc (`static NSS modules') or dynamically loaded via dlopen (`dynamic NSS modules'). Modules are loaded/initialized at configuration time (i.e. when nsdispatch is called and nsswitch.conf is read or re-read). = Make the nsdispatch(3) core thread-safe. = New status code for nsdispatch(3) `NS_RETURN', currently used to signal ERANGE-type issues. = syslog(3) problems, don't warn/err/abort. = Try harder to avoid namespace pollution. = Implement some shims to assist in porting NSS modules written for the GNU C Library nsswitch interface. Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=113595
* - Define a _spinunlock() function so that threading implementations may doJeff Roberson2003-03-261-1/+2
| | | | | | | | | more complicated things than just setting the lock to 0. - Implement stubs for this function in libc and the two threading libraries that are currently in the tree. Notes: svn path=/head/; revision=112665
* Eliminate 19 warnings in libc (at level WARNS=2) of theJacques Vidrine2003-02-271-0/+8
| | | | | | | `implicit declaration of function' variety. Notes: svn path=/head/; revision=111618
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).Jacques Vidrine2003-02-162-2/+2
| | | | | | | | | | Only warnings that could be fixed without changing the generated object code and without restructuring the source code have been handled. Reviewed by: /sbin/md5 Notes: svn path=/head/; revision=111010
* Implement fpclassify():Mike Barcroft2003-02-081-0/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a MD header private to libc called _fpmath.h; this header contains bitfield layouts of MD floating-point types. o Add a MI header private to libc called fpmath.h; this header contains bitfield layouts of MI floating-point types. o Add private libc variables to lib/libc/$arch/gen/infinity.c for storing NaN values. o Add __double_t and __float_t to <machine/_types.h>, and provide double_t and float_t typedefs in <math.h>. o Add some C99 manifest constants (FP_ILOGB0, FP_ILOGBNAN, HUGE_VALF, HUGE_VALL, INFINITY, NAN, and return values for fpclassify()) to <math.h> and others (FLT_EVAL_METHOD, DECIMAL_DIG) to <float.h> via <machine/float.h>. o Add C99 macro fpclassify() which calls __fpclassify{d,f,l}() based on the size of its argument. __fpclassifyl() is never called on alpha because (sizeof(long double) == sizeof(double)), which is good since __fpclassifyl() can't deal with such a small `long double'. This was developed by David Schultz and myself with input from bde and fenner. PR: 23103 Submitted by: David Schultz <dschultz@uclink.Berkeley.EDU> (significant portions) Reviewed by: bde, fenner (earlier versions) Notes: svn path=/head/; revision=110566