summaryrefslogtreecommitdiff
path: root/lib/libc/include
AgeCommit message (Collapse)Author
2019-03-05Transfer all the keys that were created in the libc stub implementationchristos
to the pthread tsd implementation when the main thread is created. This corrects a problem where a process created keys before libpthread was loaded (either from the libc constructor or because libpthread was dlopened later). This fixes a problem with jemalloc which creates keys in the constructor.
2018-01-17Revert to commits as they broke few rump testskamil
"Include namespace.h in a few of libc source files [...] This change finishes elimination of usage of the global name of the following symbols: - close -> _close - execve -> _execve - fcntl -> _fcntl - setcontext -> _setcontext - wait6 -> _wait6 - write -> _write - writev -> _writev" "Register more syscalls in namespace.h (of libc) Add weak symbols for: - fcntl - close - execve - setcontext - wait6 - write - writev" These changes broke: fs/nfs/t_rquotad:get_nfs_be_1_both fs/nfs/t_rquotad:get_nfs_be_1_group fs/nfs/t_rquotad:get_nfs_be_1_user fs/nfs/t_rquotad:get_nfs_le_1_both fs/nfs/t_rquotad:get_nfs_le_1_group fs/nfs/t_rquotad:get_nfs_le_1_user lib/librumphijack/t_config:fdoff lib/librumphijack/t_tcpip:http lib/librumphijack/t_tcpip:nfs lib/librumphijack/t_vfs:cpcopy lib/librumphijack/t_vfs:mv_x lib/librumphijack/t_vfs:paxcopy net/net/t_forwarding:ipforwarding_fastforward_v4 net/net/t_forwarding:ipforwarding_fastforward_v6 net/net/t_forwarding:ipforwarding_fragment_v4 net/net/t_forwarding:ipforwarding_misc net/net/t_mtudisc6:mtudisc6_basic This revert fixes the failures, except lib/librumphijack/t_vfs. The original changes were added in order to facilitate a usage of sanitizers against programs linked with NetBSD's libc. It is no longer needed, so abandon these changes. Sponsored by <The NetBSD Foundation>
2018-01-07Revert asctime() namespacingkamil
asctime() is optionally a cancellation point in the POSIX spec. It's not true for NetBSD. Requested by <joerg>
2018-01-07Revert namespacing of atoi(3)kamil
Sanitizers can handle recursive interceptions in some / most cases, if they will cause damage the problem will be not workaroundable without libc changes - I will be back to it. Keep namespace of asctime() as this can be a cancellation point according to POSIX. Right now it's not implemented on NetBSD. Defer it for later. Keep weak symbols and namespace for wait6(2) as this could be a cancellation point as well. Defer this for later. Sanitizers's [recursive] interceptors are a hack and moving one way or another can cause new sets of problems. Recursive ones can be useful and cause problems (on Linux there are known with with signal handlers). Sponsored by <The NetBSD Foundation>
2018-01-05Register new weak symbol in libc for internal usage: atoikamil
The NetBSD Standard C Library uses internally some of its functions with a mangled symbol name, usually "_symbol". The internal functions shall not use the global (public) symbols. Add atoi to namespace.h. Register a new __weak_alias() entry for atoi() in atoi.c. atoi() is used internally in getrpcent(), rresvport_af(), ftok(), err(), __llvm_profile_write_file(), llvm_gcda_start_file(), citrus_iconv_open(), getprotoent_r(), __rpc_uaddr2taddr_af(), __res_nopt_rdata() and servent_parseline(). This revision switches the internal usage to the internal symbol. Sponsored by <The NetBSD Foundation>
2018-01-05Register new weak symbol in libc for internal usage: asctimekamil
The NetBSD Standard C Library uses internally some of its functions with a mangled symbol name, usually "_symbol". The internal functions shall not use the global (public) symbols. Add asctime to namespace.h. Register a new __weak_alias() entry for asctime() in asctime.c. acstime() is used internally in ctime and __ctime50. This revision switches the internal usage to the internal symbol. Sponsored by <The NetBSD Foundation>
2018-01-05Register dl_iterate_phdr in the libc's namespace.hkamil
The NetBSD Standard C Library uses internally some of its functions with a mangled symbol name, usually "_symbol". The internal functions shall not use the global (public) symbols. Stop using the public global name of dl_iterate_phdr in tls/tls.c: __libc_static_tls_setup(). Follow the approach with other dlopen(3)-like functions with the namespace.h in the dl_iterate_phdr() case. Use internally a weak symbol: __dl_iterate_phdr instead of dl_iterate_phdr. Sponsored by <The NetBSD Foundation>
2018-01-05Register more syscalls in namespace.h (of libc)kamil
Add weak symbols for: - fcntl - close - execve - setcontext - wait6 - write - writev These syscalls are already marked as WEAKASM, generating weak references. Sponsored by <The NetBSD Foundation>
2017-11-30Import SHA-3 code into libc and libkern.riastradh
No new public symbols in libc, but publishing the symbols is a simple matter if/when we decide to do so. Proposed on tech-kern and tech-userlevel with no objections: https://mail-index.NetBSD.org/tech-kern/2017/11/11/msg022581.html https://mail-index.NetBSD.org/tech-userlevel/2017/11/11/msg010968.html
2017-10-22xref libc/READMEriastradh
2017-10-22Add an explanation of how namespace.h works.christos
2017-07-14Avoid common declaration.joerg
2017-07-11Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. Thisjoerg
functions are used for destructors of thread_local objects. If a pending destructor exists, prevent unloading of shared objects. Introduce __dl_cxa_refcount interface for this purpose. When the last reference is gone and the object has been dlclose'd before, the unloading is finalized. Ideally, __cxa_thread_atexit_impl wouldn't exist, but libstdc++ insists on providing __cxa_thread_atexit as direct wrapper without further patching.
2017-02-08empty to nothingchristos
2017-02-08Make paccept a weak symbol in preparation for using it in another functionmaya
2017-02-08__empty is defined in <sys/cdefs.h>christos
2017-01-13allow overriding snprintf/vsnprintfchristos
2017-01-12undo SSP damage from -Wsystem-headerschristos
2017-01-12put back strerror_ss, it will be used shortly.christos
2017-01-12Add strerror_ss_r to be used by syslog_sschristos
2016-09-24remove mpool_getfchristos
2016-09-24bump for the flags version of db routineschristos
2016-04-03userland bits for wait6/waitid.christos
2015-09-10namespace protect allocaddrinfochristos
2015-05-01- new test for strtoichristos
- namespace protection for strto{i,u} - separate manpages for strto{i,u} from the ones for strto{u,}l From: Kamil Rytarowski
2015-02-17Introduce reallocarr(3) for easy (re)allocation of memory with overflowjoerg
checks. Compared to OpenBSD's reallocarray, makes it easier to avoid memory leaks on allocation failures and it doesn't depend on malloc(0) != NULL for correct error checking. Compared to plain realloc, it also avoids the problem of intermediate integer overflows. The trade-off is the use of void * to side step C type system with regard to generic pointer to pointer.
2015-01-20Fix non _REENTRANT build.christos
2014-09-26add execvpe, execlpe (reviewed by phone)christos
2014-09-25Fix argument paddiing for posix_fallocate and fdiscard with gcc 1.xmanu
2014-08-03defintion -> definitionwiz
2014-06-13Add asysctl(3) and asysctlbyname(3) wrappers for the common idiom ofjoerg
fetching dynamically sized data via sysctl.
2014-03-20CID 273814, don't confuse coverity.christos
2014-01-16remove dupschristos
2014-01-16namespace protection for the new err functionschristos
2014-01-16Fix (v)errc/(v)warnc.joerg
2013-12-05Add cdbr_open_mem.joerg
2013-08-28Publish explicit_memset and consttime_memequal in userland libc.riastradh
Remove the double-underscore from the userland versions, and do the weak alias dance instead, now that these are public parts of libc. As discussed on tech-userlevel: https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html (option 3)
2013-08-19Add strerror_l.joerg
2013-08-19Add nl_langinfo_l, catopen_l and wcsftime_l.joerg
2013-05-04move prototypes to stdio.hchristos
2013-04-30Make that to process PATH_LOCALE the first time _find_category isjoerg
called. Use this to implement newlocale and provide duplocale/freelocale as well. Based on patches by Takehiko Nozaki with simplications and fix for the init order by myself.
2013-04-21Store time-specific locale data directly in the locale.joerg
Ad dstrftime_l, strftime_lz and strptime_l.
2013-04-19Add scanf_l and wscanf_l families.joerg
2013-04-19Add dummy strcoll_l and strxfrm_l.joerg
2013-04-19Add explicit locale versions for the printf family. Replace asprintf,joerg
snprintf and sprintf with simple wrappers around the corresponding va_list functions to reduce code duplication.
2013-04-18Add wcscoll_l, wcsxfrm_l, wcsncasecmp_l, wcscasecmp_l, btowc_l,joerg
mbrlen_l, mbsinit_l, mbsrtowcs_l, wcrtomb_l, wcsrtombs_l and wctob_l.
2013-04-18Add wcstof_l, wcstod_l and wcstold_l.joerg
2013-04-18Add strtof_l, strtod_l and strtold_l.joerg
2013-04-16Add strtol_l and friends. Switch _citrus_bcs_strtol to use plainjoerg
strtol_l unless in tools mode. Add note to retire the BCS code on the next libc major bump.
2013-04-16Add wcwidth_l, wcswidth_l and the wctype.h family of *_l functions.joerg