summaryrefslogtreecommitdiff
path: root/lib/libc/include
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Add waitpid to the list of hidden names for use by wordexp.c and grantpt.c.Tim J. Robbins2003-01-072-2/+2
| | | | Notes: svn path=/head/; revision=108864
* Argh, change declaration of two-dimensional array so that it actuallyDaniel Eischen2002-11-131-1/+2
| | | | | | | builds. Notes: svn path=/head/; revision=106880
* Make this compile with whatever error-checking is enabled in buildworldDaniel Eischen2002-11-131-2/+2
| | | | | | | and/or beast. Notes: svn path=/head/; revision=106870
* Use a jump table (a la Solaris) for pthread routines with defaultDaniel Eischen2002-11-133-14/+70
| | | | | | | | | | | | | entries in the table being stubs. While I'm here, add macros to auto-generate the stubs. A conforming threads library can override the stub routines by filling in the jump table. Add some entries to namespace.h and sync un-namespace.h to it. Also add a comment to remind folks to update un-namespace.h when changing namespace.h. Notes: svn path=/head/; revision=106866
* * Add stubs for pthread_cond_broadcast.Doug Rabson2002-11-012-0/+3
| | | | | | | | | | | | | * Fix typos in rwlock stubs. * Add pthread_XXX counterparts to the _pthread_XXX stubs which libraries like libX11 can use to ensure thread-safety without requiring the use of a thread library. Submitted by: Terry Lambert (pthread_cond_broadcast) Reviewed by: deischen Notes: svn path=/head/; revision=106288
* Do not use __progname directly (except in [gs]etprogname(3)).Mark Murray2002-03-293-0/+8
| | | | | | | | | Also, make an internal _getprogname() that is used only inside libc. For libc, getprogname(3) is a weak symbol in case a function of the same name is defined in userland. Notes: svn path=/head/; revision=93399
* Fix the style of the SCM ID's.David E. O'Brien2002-03-221-1/+0
| | | | | | | I believe have made all of libc .h's as consistent as possible. Notes: svn path=/head/; revision=92991
* Remove __P() usage.David E. O'Brien2002-03-211-3/+3
| | | | Notes: svn path=/head/; revision=92905
* Fixed namespace pollution related to `err' in libc in the same way as forBruce Evans2001-11-112-0/+2
| | | | | | | | | | | `warn'. Now a whole 2 members of the err() family don't cause pollution. This fixes world breakage in awk for NOSHARED worlds. contrib/awk/msg.c has had its own version of err() for a long time, but this somehow didn't cause problems until the update to awk-3.1.0. Notes: svn path=/head/; revision=86250
* signanosleep(2) hasn't existed since 1998.Ruslan Ermilov2001-10-192-2/+0
| | | | Notes: svn path=/head/; revision=85159
* Fixed namespace pollution related to `warn' in libc (but not in otherBruce Evans2001-08-292-0/+12
| | | | | | | | | libraries or for other members of the err() family). This fixes world breakage in bc and rcs/* for NOSHARED worlds. Notes: svn path=/head/; revision=82496
* Add entries for the posix1e functions that will be overridden in libc_r.Thomas Moestl2001-04-042-0/+12
| | | | | | | | Approved by: rwatson Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=75186
* Bring in a hybrid of SunSoft's transport-independent RPC (TI-RPC) andAlfred Perlstein2001-03-192-5/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | associated changes that had to happen to make this possible as well as bugs fixed along the way. Bring in required TLI library routines to support this. Since we don't support TLI we've essentially copied what NetBSD has done, adding a thin layer to emulate direct the TLI calls into BSD socket calls. This is mostly from Sun's tirpc release that was made in 1994, however some fixes were backported from the 1999 release (supposedly only made available after this porting effort was underway). The submitter has agreed to continue on and bring us up to the 1999 release. Several key features are introduced with this update: Client calls are thread safe. (1999 code has server side thread safe) Updated, a more modern interface. Many userland updates were done to bring the code up to par with the recent RPC API. There is an update to the pthreads library, a function pthread_main_np() was added to emulate a function of Sun's threads library. While we're at it, bring in NetBSD's lockd, it's been far too long of a wait. New rpcbind(8) replaces portmap(8) (supporting communication over an authenticated Unix-domain socket, and by default only allowing set and unset requests over that channel). It's much more secure than the old portmapper. Umount(8), mountd(8), mount_nfs(8), nfsd(8) have also been upgraded to support TI-RPC and to support IPV6. Umount(8) is also fixed to unmount pathnames longer than 80 chars, which are currently truncated by the Kernel statfs structure. Submitted by: Martin Blapp <mb@imp.ch> Manpage review: ru Secure RPC implemented by: wpaul Notes: svn path=/head/; revision=74462
* libc MT-safety, part 2.Daniel Eischen2001-02-112-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a lock to FILE. flockfile and friends are now implemented (for the most part) in libc. flockfile_debug is implemented in libc_r; I suppose it's about time to kill it but will do it in a future commit. Fix a potential deadlock in _fwalk in a threaded environment. A file flag (__SIGN) was added to stdio.h that, when set, tells _fwalk to ignore it in its walk. This seemed to be needed in refill.c because each file needs to be locked when flushing. Add a stub for pthread_self in libc. This is needed by flockfile which is allowed by POSIX to be recursive. Make fgetpos() error return value (-1) match man page. Remove recursive calls to locked functions (stdio); I think I've got them all, but I may have missed a couple. A few K&R -> ANSI conversions along with removal of a few instances of "register". $Id$ -> $FreeBSD$ in libc/stdio/rget.c Not objected to: -arch, a few months ago Notes: svn path=/head/; revision=72373
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-01-243-2/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | adding (weak definitions to) stubs for some of the pthread functions. If the threads library is linked in, the real pthread functions will pulled in. Use the following convention for system calls wrapped by the threads library: __sys_foo - actual system call _foo - weak definition to __sys_foo foo - weak definition to __sys_foo Change all libc uses of system calls wrapped by the threads library from foo to _foo. In order to define the prototypes for _foo(), we introduce namespace.h and un-namespace.h (suggested by bde). All files that need to reference these system calls, should include namespace.h before any standard includes, then include un-namespace.h after the standard includes and before any local includes. <db.h> is an exception and shouldn't be included in between namespace.h and un-namespace.h namespace.h will define foo to _foo, and un-namespace.h will undefine foo. Try to eliminate some of the recursive calls to MT-safe functions in libc/stdio in preparation for adding a mutex to FILE. We have recursive mutexes, but would like to avoid using them if possible. Remove uneeded includes of <errno.h> from a few files. Add $FreeBSD$ to a few files in order to pass commitprep. Approved by: -arch Notes: svn path=/head/; revision=71579
* $Id$ -> $FreeBSD$Peter Wemm1999-08-282-2/+2
| | | | Notes: svn path=/head/; revision=50476
* Implement compile time debug support for spinlocks.John Birrell1998-06-091-5/+24
| | | | | | | | | Simplify the atomic lock prototype, removing the lock value. Delete the unlock prototypes that are not required. Notes: svn path=/head/; revision=36803
* Remove leading underscores from the FILE lock functions that POSIXJohn Birrell1998-05-051-3/+3
| | | | | | | specifies. Notes: svn path=/head/; revision=35759
* In a threaded library, expect the lock field to be declared volatile,John Birrell1998-05-051-5/+5
| | | | | | | | so provide function prototypes that respect that, avoiding a gcc warning that `volatile' is being thrown away. Notes: svn path=/head/; revision=35753
* Add a private header file for libc/libc_r/libpthread to containJohn Birrell1998-04-111-0/+66
| | | | | | | definitions for things like locking etc. Notes: svn path=/head/; revision=35124
* Add a private (to libc, libc_r and libpthread) header file containingJohn Birrell1998-03-091-0/+52
prototypes for the spinlock functions that will be used for thread locks. libc will have stubs declared with weak symbols. libpthread and libc_r will have functions that really do something. Notes: svn path=/head/; revision=34365