summaryrefslogtreecommitdiffstats
path: root/lib/libc/include/un-namespace.h
Commit message (Collapse)AuthorAgeFilesLines
* MFC r315526vangyzen2017-05-011-0/+1
| | | | | | | | | | | | | | | | | | | | | | Add clock_nanosleep() Add a clock_nanosleep() syscall, as specified by POSIX. Make nanosleep() a wrapper around it. Attach the clock_nanosleep test from NetBSD. Adjust it for the FreeBSD behavior of updating rmtp only when interrupted by a signal. I believe this to be POSIX-compliant, since POSIX mentions the rmtp parameter only in the paragraph about EINTR. This is also what Linux does. (NetBSD updates rmtp unconditionally.) Copy the whole nanosleep.2 man page from NetBSD because it is complete and closely resembles the POSIX description. Edit, polish, and reword it a bit, being sure to keep any relevant text from the FreeBSD page. Regenerate syscall files. Relnotes: yes Sponsored by: Dell EMC
* MFC r314179 r314206 r314424vangyzen2017-03-141-0/+1
| | | | | | | | | | | | | | | | | Add sem_clockwait_np() This function allows the caller to specify the reference clock and choose between absolute and relative mode. In relative mode, the remaining time can be returned. The API is similar to clock_nanosleep(3). Thanks to Ed Schouten for that suggestion. While I'm here, reduce the sleep time in the semaphore "child" test to greatly reduce its runtime. Also add a reasonable timeout. Relnotes: yes Sponsored by: Dell EMC
* Add implementations of sendmmsg(3) and recvmmsg(3) functions whichkib2016-01-291-0/+2
| | | | | | | | | | | | | | | | | | wraps sendmsg(2) and recvmsg(2) into batch send and receive operation. The goal of this implementation is only to provide API compatibility with Linux. The cancellation behaviour of the functions is not quite right, but due to relative rare use of cancellation it is considered acceptable comparing with the complexity of the correct implementation. If functions are reimplemented as syscalls, the fix would come almost trivial. The direct use of the syscall trampolines instead of libc wrappers for sendmsg(2) and recvmsg(2) is to avoid data loss on cancellation. Submitted by: Boris Astardzhiev <boris.astardzhiev@gmail.com> Discussed with: jilles (cancellation behaviour) MFC after: 1 month
* Implement the waitid() SUSv4 function using wait6() system call.kib2012-11-131-0/+1
| | | | | | PR: standards/170346 Submitted by: "Jukka A. Ukkonen" <jau@iki.fi> MFC after: 1 month
* Introduce a non-portable function pthread_getthreadid_np(3) to retrievejkim2011-02-071-0/+1
| | | | | | | calling thread's unique integral ID, which is similar to AIX function of the same name. Bump __FreeBSD_version to note its introduction. Reviewed by: kib
* Revert revision 214007, I realized that MySQL wants to resolvedavidxu2010-10-201-2/+0
| | | | | | | a silly rwlock deadlock problem, the deadlock is caused by writer waiters, if a thread has already locked a reader lock, and wants to acquire another reader lock, it will be blocked by writer waiters, but we had already fixed it years ago.
* Unbreak buildworld by including pthread_rwlockattr_setkind_np anddavidxu2010-10-181-0/+2
| | | | pthread_rwlockattr_getkind_np.
* Make openat(2) a cancellation point.jilles2009-10-111-0/+1
| | | | | | | This is required by POSIX and matches open(2). Reviewed by: kib, jhb MFC after: 1 month
* Make pthread_cleanup_push() and pthread_cleanup_pop() as a pair of macros,davidxu2008-06-091-2/+0
| | | | | | | use stack space to keep cleanup information, this eliminates overhead of calling malloc() and free() in thread library. Discussed on: thread@
* Add pthread_setaffinity_np and pthread_getaffinity_np to libc namespace.davidxu2008-04-021-0/+2
|
* Compile libthr with warnings.ru2008-03-251-0/+3
|
* Add pthread_mutex_isowned_np() so there is no need for an additionaldes2008-02-061-0/+1
| | | | | | prototype next to the implementation. MFC after: 2 weeks
* Add semaphore functions, and remove some dupes from the #if 0 section.des2006-03-281-2/+10
|
* Add a bunch of missing pthread functions, and move out-of-order functions.des2006-03-281-7/+64
|
* Add entries for new pthread stubs.davidxu2006-03-101-0/+30
|
* Add namespace #defines for usleep.deischen2005-08-031-0/+1
|
* Back out the `hiding' of strlcpy and strlcat. Several peoplenectar2003-05-011-2/+0
| | | | vocally objected to this safety belt.
* `Hide' strlcpy and strlcat (using the namespace.h / __weak_referencenectar2003-04-291-0/+2
| | | | | | | 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
* = Implement name service switch modules (NSS modules). NSS modulesnectar2003-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | 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
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).nectar2003-02-161-1/+1
| | | | | | | 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
* Add waitpid to the list of hidden names for use by wordexp.c and grantpt.c.tjr2003-01-071-1/+1
|
* Use a jump table (a la Solaris) for pthread routines with defaultdeischen2002-11-131-8/+17
| | | | | | | | | | 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.
* Do not use __progname directly (except in [gs]etprogname(3)).markm2002-03-291-0/+1
| | | | | | 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.
* Fixed namespace pollution related to `err' in libc in the same way as forbde2001-11-111-0/+1
| | | | | | | | `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.
* signanosleep(2) hasn't existed since 1998.ru2001-10-191-1/+0
|
* Fixed namespace pollution related to `warn' in libc (but not in otherbde2001-08-291-0/+2
| | | | | | libraries or for other members of the err() family). This fixes world breakage in bc and rcs/* for NOSHARED worlds.
* Add entries for the posix1e functions that will be overridden in libc_r.tmm2001-04-041-0/+6
| | | | | Approved by: rwatson Obtained from: TrustedBSD Project
* libc MT-safety, part 2.deischen2001-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove _THREAD_SAFE and make libc thread-safe by default bydeischen2001-01-241-0/+134
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
OpenPOWER on IntegriCloud