summaryrefslogtreecommitdiff
path: root/lib/libc/include/un-namespace.h
Commit message (Collapse)AuthorAgeFilesLines
* Add pthread_getname_np() and pthread_setname_np() aliases forKonstantin Belousov2020-06-101-0/+2
| | | | | | | | | | | | | | | pthread_get_name_np() and pthread_set_name_np(). This re-applies r361770 after compatibility fixes. Reviewed by: antoine, jkim, markj Tested by: antoine (exp-run) Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D25117 Notes: svn path=/head/; revision=362032
* Add pthread_get_name_np(3).Konstantin Belousov2018-08-171-0/+1
| | | | | | | | | | | | | | | | The function retrieves the thread name previously set by pthread_set_name_np(3). The name is cached in the process memory. Requested by: Willem Jan Withagen <wjw@digiware.nl> Man page update: Yuri Pankov <yuripv@yuripv.net> Reviewed by: ian (previous version) Discussed with: arichardson, bjk (man page) Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Differential revision: https://reviews.freebsd.org/D16702 Notes: svn path=/head/; revision=337983
* libc: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-251-1/+3
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Notes: svn path=/head/; revision=326193
* Add clock_nanosleep()Eric van Gyzen2017-03-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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. Reviewed by: kib, ngie, jilles MFC after: 3 weeks Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D10020 Notes: svn path=/head/; revision=315526
* Add sem_clockwait_np()Eric van Gyzen2017-02-231-0/+1
| | | | | | | | | | | | | | | | | | | | | 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. Reviewed by: ed (userland) MFC after: 2 weeks Relnotes: yes Sponsored by: Dell EMC Differential Revision: https://reviews.freebsd.org/D9656 Notes: svn path=/head/; revision=314179
* Add implementations of sendmmsg(3) and recvmmsg(3) functions whichKonstantin Belousov2016-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 Notes: svn path=/head/; revision=295039
* Implement the waitid() SUSv4 function using wait6() system call.Konstantin Belousov2012-11-131-0/+1
| | | | | | | | | PR: standards/170346 Submitted by: "Jukka A. Ukkonen" <jau@iki.fi> MFC after: 1 month Notes: svn path=/head/; revision=242960
* Introduce a non-portable function pthread_getthreadid_np(3) to retrieveJung-uk Kim2011-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 Notes: svn path=/head/; revision=218414
* Revert revision 214007, I realized that MySQL wants to resolveDavid Xu2010-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. Notes: svn path=/head/; revision=214093
* Unbreak buildworld by including pthread_rwlockattr_setkind_np andDavid Xu2010-10-181-0/+2
| | | | | | | pthread_rwlockattr_getkind_np. Notes: svn path=/head/; revision=214015
* Make openat(2) a cancellation point.Jilles Tjoelker2009-10-111-0/+1
| | | | | | | | | | This is required by POSIX and matches open(2). Reviewed by: kib, jhb MFC after: 1 month Notes: svn path=/head/; revision=197968
* Make pthread_cleanup_push() and pthread_cleanup_pop() as a pair of macros,David Xu2008-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@ Notes: svn path=/head/; revision=179662
* Add pthread_setaffinity_np and pthread_getaffinity_np to libc namespace.David Xu2008-04-021-0/+2
| | | | Notes: svn path=/head/; revision=177855
* 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-061-0/+1
| | | | | | | | | prototype next to the implementation. MFC after: 2 weeks Notes: svn path=/head/; revision=176058
* Add semaphore functions, and remove some dupes from the #if 0 section.Dag-Erling Smørgrav2006-03-281-2/+10
| | | | Notes: svn path=/head/; revision=157223
* Add a bunch of missing pthread functions, and move out-of-order functions.Dag-Erling Smørgrav2006-03-281-7/+64
| | | | Notes: svn path=/head/; revision=157218
* Add entries for new pthread stubs.David Xu2006-03-101-0/+30
| | | | Notes: svn path=/head/; revision=156530
* Add namespace #defines for usleep.Daniel Eischen2005-08-031-0/+1
| | | | Notes: svn path=/head/; revision=148655
* Back out the `hiding' of strlcpy and strlcat. Several peopleJacques Vidrine2003-05-011-2/+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-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 Notes: svn path=/head/; revision=114256
* = Implement name service switch modules (NSS modules). NSS modulesJacques Vidrine2003-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 Notes: svn path=/head/; revision=113595
* Eliminate 61 warnings emitted at WARNS=2 (leaving 53 to go).Jacques Vidrine2003-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 Notes: svn path=/head/; revision=111010
* Add waitpid to the list of hidden names for use by wordexp.c and grantpt.c.Tim J. Robbins2003-01-071-1/+1
| | | | Notes: svn path=/head/; revision=108864
* Use a jump table (a la Solaris) for pthread routines with defaultDaniel Eischen2002-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. Notes: svn path=/head/; revision=106866
* Do not use __progname directly (except in [gs]etprogname(3)).Mark Murray2002-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. Notes: svn path=/head/; revision=93399
* Fixed namespace pollution related to `err' in libc in the same way as forBruce Evans2001-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. Notes: svn path=/head/; revision=86250
* signanosleep(2) hasn't existed since 1998.Ruslan Ermilov2001-10-191-1/+0
| | | | Notes: svn path=/head/; revision=85159
* Fixed namespace pollution related to `warn' in libc (but not in otherBruce Evans2001-08-291-0/+2
| | | | | | | | | 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-041-0/+6
| | | | | | | | Approved by: rwatson Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=75186
* libc MT-safety, part 2.Daniel Eischen2001-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 Notes: svn path=/head/; revision=72373
* Remove _THREAD_SAFE and make libc thread-safe by default byDaniel Eischen2001-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 Notes: svn path=/head/; revision=71579