Home | History | Annotate | only in /src/lib/libc/include
History log of /src/lib/libc/include
RevisionDateAuthorComments
 1.1 02-May-2025  riastradh branches: 1.1.4;
ld.elf_so: Use __sysctl() syscall stub rather than sysctl() wrapper.

This avoids pulling in some unnecessary junk from libc, saving on a
couple kilobytes of space and some relative relocations at runtime.

PR lib/59387: ld.elf_so: needlessly includes libc/gen/sysctl.c user.*
 1.1.4.2 02-Aug-2025  perseant Sync with HEAD
 1.1.4.1 02-May-2025  perseant file __sysctl.h was added on branch perseant-exfatfs on 2025-08-02 05:54:37 +0000
 1.4 09-Mar-2025  riastradh branches: 1.4.4;
arc4random(3): Provide a fallback in case pthread_atfork fails.

This is considerably more work and burden on testing than simply
statically preallocating a bit of storage for pthread_atfork to
eliminate the failure mode altogether, but it is less work than
arguing further over the atfork interface:
https://mail-index.NetBSD.org/source-changes-d/2025/03/02/msg014387.html

PR lib/59117: arc4random has some failure modes it shouldn't
 1.3 06-Mar-2025  riastradh arc4random(3): Switch to use thr_once (libc pthread_once symbol).

This way, we reduce the problem of arc4random initialization
fork-safety to the problem of pthread_once fork-safety -- and
anything else to do with one-time lazy initialization.

PR lib/59124: arc4random(3): first call in process races with
concurrent fork
 1.2 02-Mar-2025  riastradh arc4random(3): Avoid failure due to thread key limits.

If thr_keycreate (a.k.a. pthread_key_create) fails, fall back to
using globally serialized state instead of per-thread state. This is
unlikely to happen but arc4random(3) should work even if it does.
New test case forces exercising this path (at least, simulating the
effect of key creation failure).

PR lib/59117: arc4random has some failure modes it shouldn't
 1.1 27-Aug-2024  riastradh branches: 1.1.2;
arc4random(3): Add automatic tests.

This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail

NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.

PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
 1.1.2.2 09-Oct-2024  martin Pull up following revision(s) (requested by riastradh in ticket #939):

distrib/sets/lists/debug/module.md.amd64: revision 1.18
sys/modules/Makefile: revision 1.292
lib/libc/gen/arc4random.c: revision 1.34
lib/libc/gen/arc4random.c: revision 1.35
lib/libc/gen/arc4random.c: revision 1.36
lib/libc/gen/arc4random.c: revision 1.37
sys/kern/kern_entropy.c: revision 1.70
lib/libc/gen/arc4random.c: revision 1.38
sys/kern/kern_entropy.c: revision 1.71
lib/libc/gen/getentropy.3: revision 1.8
distrib/sets/lists/modules/md.amd64: revision 1.103
share/man/man4/rnd.4: revision 1.42
share/man/man4/rnd.4: revision 1.44
lib/libc/include/arc4random.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1786
sys/arch/i386/conf/GENERIC: revision 1.1258
sys/modules/acpivmgenid/acpivmgenid.ioconf: revision 1.1
sys/arch/amd64/conf/ALL: revision 1.190
distrib/sets/lists/debug/mi: revision 1.446
sys/arch/i386/conf/ALL: revision 1.521
lib/libc/gen/Makefile.inc: revision 1.219
distrib/sets/lists/debug/module.md.i386: revision 1.12
sys/dev/acpi/acpi_vmgenid.c: revision 1.1
sys/dev/acpi/acpi_vmgenid.c: revision 1.2
lib/libc/include/reentrant.h: revision 1.22
sys/arch/evbarm/conf/GENERIC64: revision 1.219
share/man/man4/Makefile: revision 1.735
distrib/sets/lists/modules/md.i386: revision 1.100
distrib/sets/lists/tests/mi: revision 1.1334
lib/libc/gen/arc4random.3: revision 1.22
sys/dev/acpi/files.acpi: revision 1.133
lib/libc/gen/arc4random.3: revision 1.23
tests/lib/libc/gen/t_arc4random.c: revision 1.1
sys/sys/entropy.h: revision 1.6
sys/arch/amd64/conf/GENERIC: revision 1.614
sys/modules/acpivmgenid/Makefile: revision 1.1
share/man/man4/acpivmgenid.4: revision 1.1
lib/libc/gen/Makefile.inc: revision 1.220
tests/lib/libc/gen/Makefile: revision 1.56
share/man/man4/acpivmgenid.4: revision 1.2
share/man/man4/acpivmgenid.4: revision 1.3

(all via patch)

Catch up with all the lint warnings since exit on warning was disabled.

Disable 'missing header declaration' and 'nested extern' warnings for now.
acpivmgenid(4): New driver for virtual machine generation ID.

Added to amd64/ALL and i386/ALL kernel configurations, and made
available as a loadable module acpivmgenid.kmod on x86, for now.
TBD: Add to all ACPI-supporting GENERIC kernels.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

entropy(9): Factor out subroutines to reset and gather entropy.
`Reset' means we keep the data in the pool, but assume it had zero
entropy. `Gather' means we request samples from all on-demand
sources and wait for the synchronous ones to complete.

No functional change intended, other than to expose new symbols --
just preparation to expose these to acpivmgenid(4), so it can use
these when the VM host notifies us that we, the guest, have been
cloned.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

acpivmgenid(4): Reset and gather entropy on VM clone notification.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Reseed if system entropy epoch changes.
This can happen, for example, if the system is a VM instance, and the
VM is cloned.

This incurs the cost of a system call on every arc4random call, which
is unfortunate, but
1. we don't currently have a (machine-independent) mechanism for
exposing a read-only page to userland shared by the kernel to
enable a cheaper access path to the entropy epoch; and
2. the algorithm here -- a simple application of ChaCha -- is likely
also a bottleneck and could be much cheaper by
(a) using sys/crypto/chacha for machine-dependent vectorized
ChaCha code, and
(b) filling a buffer (somewhere between a cipher block and a page)
in a batch at a time, instead of running ChaCha to generate
only 32 bytes at a time.
So although this might be a performance hit, the security benefit is
worthwhile and we have a clear path to do better than reversing the
performance hit later.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

acpivmgenid(4): Nix BUGS that have been squashed.
Reference kern.entropy.epoch for the remaining bug (which is a
performance issue, not a security issue).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

entropy(9): Allow unprivileged reads of sysctl kern.entropy.epoch.

Applications need this in order to know when to reseed. (We should
also expose it through a page shared read-only with userland for
cheaper access, but until we do, let's let applications get at it
through sysctl.)
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random.c: Fix test program.

This isn't wired up anywhere, but let's reduce the bitrot. It was
helpful in reminding me that kern.entropy.epoch was, for reasons I
can't remember, restricted to privileged access.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

amd64, evbarm, i386: Add acpivmgenid(4) to GENERIC.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

rnd(4): Document kern.entropy.epoch is unprivileged and elaborate.
Cross-reference acpivmgenid(4).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Note that arc4random respects kern.entropy.epoch.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Add debug info for new acpivmgenid module

arc4random(3): Add automatic tests.

This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail

NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

getentropy(3): Note intent to reseed on VM clone, and caveats.

Tidy markup and pacify some mandoc -Tlint complaints while here.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

Bump dates on man pages recently updated to mention VM clones.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Pacify some of lint's complaints.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random: suppress another lint warning
 1.1.2.1 27-Aug-2024  martin file arc4random.h was added on branch netbsd-10 on 2024-10-09 13:25:11 +0000
 1.4.4.2 02-Aug-2025  perseant Sync with HEAD
 1.4.4.1 09-Mar-2025  perseant file arc4random.h was added on branch perseant-exfatfs on 2025-08-02 05:54:37 +0000
 1.2 14-Jul-2017  joerg branches: 1.2.2;
Avoid common declaration.
 1.1 11-Jul-2017  joerg Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
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.
 1.2.2.2 29-Aug-2017  bouyer Pull up following revision(s) (requested by joerg in ticket #127):
tests/libexec/ld.elf_so/h_thread_local_dtor.c: revision 1.1
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmeb/c++config.h: revision 1.17
lib/libc/stdlib/atexit.h: file removal
lib/libc/stdlib/exit.c: revision 1.16
external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc64/c++config.h: revision 1.8
lib/libc/stdlib/exit.c: revision 1.17
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hf/c++config.h: revision 1.14
distrib/sets/lists/debug/shl.mi: revision 1.178
external/gpl3/gcc/lib/libstdc++-v3/arch/sh3el/c++config.h: revision 1.21
distrib/sets/lists/debug/shl.mi: revision 1.179
distrib/sets/lists/debug/mi: revision 1.219
lib/libpthread/pthread.c: revision 1.150
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7/c++config.h: revision 1.14
libexec/ld.elf_so/symbols.map: revision 1.2
include/dlfcn.h: revision 1.25
external/gpl3/gcc/lib/libstdc++-v3/arch/arm/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/x86_64/c++config.h: revision 1.23
external/gpl3/gcc/lib/libstdc++-v3/arch/mips64el/c++config.h: revision 1.18
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4eb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earm/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/mipsel/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/ia64/c++config.h: revision 1.5
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6eb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmhf/c++config.h: revision 1.17
distrib/sets/lists/tests/mi: revision 1.755
external/gpl3/gcc/lib/libstdc++-v3/arch/mips64eb/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/i386/c++config.h: revision 1.20
external/gpl3/gcc/lib/libstdc++-v3/arch/vax/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/armeb/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/sparc/c++config.h: revision 1.20
lib/libc/dlfcn/dlfcn_elf.c: revision 1.14
tests/libexec/ld.elf_so/t_thread_local_dtor.sh: revision 1.1
tests/lib/libpthread/t_thread_local_dtor.sh: revision 1.1
lib/libc/stdlib/Makefile.inc: revision 1.93
lib/libc/include/atexit.h: revision 1.1
lib/libc/include/atexit.h: revision 1.2
external/gpl3/gcc/lib/libstdc++-v3/arch/m68k/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hf/c++config.h: revision 1.14
distrib/sets/lists/debug/shl.mi: revision 1.180
external/gpl3/gcc/lib/libstdc++-v3/arch/sparc64/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv6hfeb/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/hppa/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7hfeb/c++config.h: revision 1.14
lib/libc/stdlib/cxa_thread_atexit.c: revision 1.1
tests/libexec/ld.elf_so/helper_dso3/h_helper_dso3.cpp: revision 1.1
tests/libexec/ld.elf_so/helper_dso3/Makefile: revision 1.1
external/gpl3/gcc/lib/libstdc++-v3/arch/riscv64/c++config.h: revision 1.5
libexec/ld.elf_so/rtld.c: revision 1.185
external/gpl3/gcc/lib/libstdc++-v3/arch/sh3eb/c++config.h: revision 1.19
external/gpl3/gcc/lib/libstdc++-v3/arch/riscv32/c++config.h: revision 1.5
external/gpl3/gcc/lib/libstdc++-v3/arch/m68000/c++config.h: revision 1.15
external/gpl3/gcc/lib/libstdc++-v3/arch/mipseb/c++config.h: revision 1.21
external/gpl3/gcc/lib/libstdc++-v3/arch/coldfire/c++config.h: revision 1.12
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv4/c++config.h: revision 1.14
external/gpl3/gcc/lib/libstdc++-v3/arch/earmhfeb/c++config.h: revision 1.15
external/gpl3/gcc/lib/libstdc++-v3/arch/alpha/c++config.h: revision 1.19
tests/libexec/ld.elf_so/Makefile: revision 1.9
external/gpl3/gcc/lib/libstdc++-v3/arch/powerpc/c++config.h: revision 1.20
external/gpl3/gcc/lib/libstdc++-v3/arch/earmv7eb/c++config.h: revision 1.14
tests/lib/libpthread/h_thread_local_dtor.cpp: revision 1.1
distrib/sets/lists/tests/shl.mi: revision 1.11
tests/lib/libpthread/Makefile: revision 1.13
libexec/ld.elf_so/rtld.h: revision 1.129
external/gpl3/gcc/lib/libstdc++-v3/arch/or1k/c++config.h: revision 1.6
Implement __cxa_thread_atexit and __cxa_thread_atexit_impl. This
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.
Fix filename of new debug file
Add misising DEBUGLIB file
Avoid common declaration.
Drop TLS variant checks, emutls is enough for VAX and Sun2.
 1.2.2.1 14-Jul-2017  bouyer file atexit.h was added on branch netbsd-8 on 2017-08-29 09:43:18 +0000
 1.2 04-Mar-2025  riastradh Revert __libc_atfork addition.

This reverts the following revisions:

lib/libc/gen/arc4random.c 1.40-41 (but not 1.42 which is independent)
lib/libc/gen/pthread_atfork.c 1.24
lib/libc/include/atfork.h 1.1

This additionally updates the comments in arc4random.c to reflect the
current state.

Requested by kre:
https://mail-index.netbsd.org/source-changes-d/2025/03/03/msg014388.html

Since the new symbol __libc_atfork has not been used outside libc,
this poses no ABI compatibility issues.
 1.1 03-Mar-2025  riastradh __libc_atfork: Add header file missed in previous commit.

PR lib/59112: libpthread constructors use malloc
PR lib/59117: arc4random has some failure modes it shouldn't
 1.3 20-Jan-2015  christos Fix non _REENTRANT build.
 1.2 14-Nov-2010  tron 1.) Rename internal function __findvar() to __findenvvar().
2.) Add a wrapper function __findenv() which implements the previous
*internal* interface. It turns out that ld.elf_so(1) and pthread(3)
both use it.

Stripping e.g. "LD_LIBRARY_PATH" from the environment while running
setuid binaries works again now.
 1.1 14-Nov-2010  tron Improve and simplify implementation of *env(3) functions:
- Use RB tree to keep track of memory allocated via setenv(3) as
suggested by Enami Tsugutomo in private e-mail.
This simplifies the code a lot as we no longer need to keep the size
of "environ" in sync with an array of allocated environment variables.
It also makes it possible to free environment variables in unsetenv(3)
if something has changed the order of the "environ" array.
- Fix a bug in getenv(3) and getenv_r(3) which would return bogus
results e.g. for " getenv("A=B") " if an environment variable "A"
with value "B=C" exists.
- Clean up the internal functions:
- Don't expose the read/write lock for the environment to other parts
of "libc". Provide locking functions instead.
- Use "bool" to report success or failure.
- Use "ssize_t" or "size_t" instead of "int" for indexes.
- Provide internal functions with simpler interfaces e.g. don't
combine return values and reference arguments.
- Don't copy "environ" into an allocated block unless we really need
to grow it.

Code reviewed by Joerg Sonnenberger and Christos Zoulas, tested by
Joerg Sonnenberger and me. These changes also fix problems in
zsh 4.3.* and pam_ssh according to Joerg.
 1.32 01-Oct-2024  christos just use off_t
 1.31 28-Sep-2024  christos need <sys/types.h> for __off_t in gnu11 mode.
 1.30 08-Jul-2024  christos PR/58391: Noriyuki Soda: re-adding syslog_ss() to syslog.h and syslog.3
 1.29 19-Jan-2024  christos branches: 1.29.2;
more extern decls
 1.28 03-Jan-2024  christos tidy up some extern declarations
 1.27 04-Apr-2023  christos PR/57250: Martin Husemann: dtoa mishandles infinite doubles on 32bit big
endian machines. When long double support was added, the old code was kept
for the regular double code. This code was never used because WIDE_DOUBLE
was always defined in the Makefile. Remove that old code, and conditionalize
the WIDE_DOUBLE code based on if long doubles are different than doubles on
the specific platform.
 1.26 15-May-2020  joerg branches: 1.26.6;
Hook up proper fork lock handling for malloc:
- lock all relevant mutexes just before fork
- unlock all mutexes just after fork in the parent
- full reinit non-spinlocks in the child
This is not using the normal pthread_atfork interface to ensure order of
operation, malloc is used as implementation detail too often.
 1.25 12-Jan-2017  christos branches: 1.25.16;
put back strerror_ss, it will be used shortly.
 1.24 12-Jan-2017  christos Add strerror_ss_r to be used by syslog_ss
 1.23 19-Aug-2013  joerg branches: 1.23.8;
Add strerror_l.
 1.22 04-May-2013  christos move prototypes to stdio.h
 1.21 11-Oct-2012  christos take care of the signal safe syslog calls which are not exposed.
 1.20 12-Sep-2012  manu branches: 1.20.2;
setcontext() used to be incompatible with -lpthread since it affected
the TLS pointer, therefore wrecking the pthread environement.

Some ports had _UC_TLSBASE flag or equivalent (_UC_UNIQUE on alpha)
that controlled whether setcontext() would change the TLS pointer.
This change let libpthread override setcontext() with its own version
that unsets _UC_TLSBASE, enabling safe usage of setcontext() with
-lpthread.

We also have the following required changes here:
- rename alpha's _UC_UNIQUE into _UC_TLSBASE
- add _UC_TLSBASE definition in header file for all ports
(powerpc, sh3, sparc and sparc64 lack the implementation for now)
- introduce a libc stub that can be overriden for setcontext()
- modify MD libcs swapcontext() implementations so that they use the
setcontext() libc stub instead of doing a plain system call.

While we are there:
- document various MD _UC_* flags in header file
- add libc and libpthread tests for swapcontext() behavior
(hopefully helpful to spot MD problems introduced with this change)

Future work:
- Deciding whether kernel support or _UC_TLSBASE should be added for
powerpc, sh3, sparc and sparc64 is left to portmasters
sparc64

Approved by core@
 1.19 19-Sep-2011  joerg branches: 1.19.2;
Mark _resumecontext as dead. ANSIfy all declarations for it.
 1.18 17-Jul-2011  joerg Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
 1.17 21-Oct-2009  snj Remove 3rd and 4th clauses in christos' license. OK christos.
 1.16 31-Oct-2008  christos branches: 1.16.2;
Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections
 1.15 04-Dec-2007  christos move decls for _malloc_{pre,post}fork() to extern.h
 1.14 22-Nov-2006  christos branches: 1.14.8;
Don't expose _ss functions for 4.0. Requested by core.
 1.13 17-May-2006  christos PR/24324: Arne H Juul: Re-implement seekdir/telldir using a pointer of
locations per directory instead of a global hash table to avoid memory
leak issues, and incorrect results.
 1.12 24-Feb-2006  drochner complete constification of the sysctl() user side
 1.11 16-Feb-2006  christos - s/notyet/WIDE_DOUBLE/
- Add a little more glue for WIDE_DOUBLE; not done yet.
- s/def FLOATING_POINT/ndef NO_FLOATING_POINT/ to reduce diffs with FreeBSD.
- fix memory leak where each double formatted leaked 24 by calling __freedtoa()
appropriately. the new gdtoa keeps a list of memory chunks allocated by
malloc(), and it must maintained properly by calling __freedtoa() on the
results of __dtoa() Hi Klaus!
- in vfwprintf() make cvt return char * and convert it using __mbsconv(),
instead of having it return wchar_t *.

This should fix the memory leaks people have been reporting (eg. in top etc.)
 1.10 24-Jan-2006  christos rename __func to _func_unlocked, and add their prototypes in extern.h
instead of exposing them in dirent.h. More locking consistency fixes.
 1.9 27-Sep-2003  matt Constify the _-sigaction_sigtramp tramp argument.
 1.8 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.7 09-Jul-2002  thorpej Add prototype for __sigaction_sigtramp(). This system call is used
only by libc internally, and thus does not need to be exported in
any other header file.
 1.6 26-Mar-1999  sommerfe branches: 1.6.12;
move __getcwd prototypes to libc-private header file.

XXX duplicate the prototype in getcwd regression test (which needs to
call the syscall directly for reasonably complete testing).
 1.5 14-Jan-1999  kleink * On architectures using ELF, and conditionally on those in transition, rename
_ASM_LABEL(cerror) and _ASM_LABEL(curbrk) to _C_LABEL(__cerror) and
_C_LABEL(__curbrk) (or their respective architecture-specific equivalents) to
avoid possible name clashes with identifiers used in user applications.
* Do the same for minbrk on all architectures to avoid a GCC-specific (and
on ELF architectures effectively useless) symbol reference renaming in MI code.
 1.4 15-Nov-1998  christos in the __str{error,signal} functions make the third argument size_t since
it is really a size. This does not affect the external interface, so there
should be no reason to bump the libc #
 1.3 26-Jul-1998  mycroft const poisoning.
 1.2 16-Oct-1997  christos Remove _tztab() declaration now that timezone() migrated to libcompat.
 1.1 13-Jul-1997  christos Add prototype declarations
 1.6.12.3 01-Aug-2002  nathanw Catch up to -current.
 1.6.12.2 11-Mar-2002  nathanw Add __setlogin() prototype.
 1.6.12.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.14.8.1 09-Jan-2008  matt sync with HEAD
 1.16.2.2 31-Oct-2008  christos Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections
 1.16.2.1 31-Oct-2008  christos file extern.h was added on branch christos-time_t on 2008-10-31 16:12:19 +0000
 1.19.2.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.19.2.1 30-Oct-2012  yamt sync with head
 1.20.2.3 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.20.2.2 23-Jun-2013  tls resync from head
 1.20.2.1 20-Nov-2012  tls Resync to 2012-11-19 00:00:00 UTC
 1.23.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.25.16.1 22-Aug-2024  martin Pull up following revision(s) (requested by riastradh in ticket #1865):

lib/libc/stdio/Makefile.inc: revision 1.48
tests/lib/libc/stdio/t_printf.c: revision 1.9
lib/libc/stdio/vfwprintf.c: revision 1.40
lib/libc/include/extern.h: revision 1.27
tests/lib/libc/stdio/t_printf.c: revision 1.10

PR/57250: Martin Husemann: dtoa mishandles infinite doubles on 32bit big
endian machines. When long double support was added, the old code was kept
for the regular double code. This code was never used because WIDE_DOUBLE
was always defined in the Makefile. Remove that old code, and conditionalize
the WIDE_DOUBLE code based on if long doubles are different than doubles on
the specific platform.

Add a test for PR/57250 from Havard Eidnes

Fix the test for "inf" output, also include newline in printf format...
 1.26.6.2 08-Oct-2024  martin Pull up following revision(s) (requested by rin in ticket #930):

lib/libc/include/extern.h: revision 1.30
distrib/sets/lists/base/shl.mi: revision 1.987 (patch)
external/bsd/blocklist/bin/support.c: revision 1.2
external/bsd/blocklist/bin/blocklistd.c: revision 1.5
external/bsd/blocklist/bin/blocklistd.8: revision 1.3
sys/sys/syslog.h: revision 1.42
external/bsd/blocklist/bin/support.h: revision 1.2
external/bsd/blocklist/include/blocklist.h: revision 1.3
crypto/external/bsd/openssh/dist/pfilter.c: revision 1.9
external/bsd/blocklist/lib/shlib_version: revision 1.2
lib/libc/gen/syslog_ss.c: revision 1.4
lib/libc/gen/Makefile.inc: revision 1.218
external/bsd/blocklist/lib/bl.c: revision 1.3
external/bsd/blocklist/README: revision 1.3
external/bsd/blocklist/include/bl.h: revision 1.2
distrib/sets/lists/debug/shl.mi: revision 1.347 (patch)
distrib/sets/lists/comp/mi: revision 1.2462
lib/libc/gen/syslog.3: revision 1.34
lib/libc/gen/syslog.3: revision 1.35
external/bsd/blocklist/libexec/blocklistd-helper: revision 1.8
external/bsd/blocklist/lib/libblocklist.3: revision 1.4
external/bsd/blocklist/lib/libblocklist.3: revision 1.5
external/bsd/blocklist/lib/libblocklist.3: revision 1.6
external/bsd/blocklist/lib/blocklist.c: revision 1.3

Spelling fixes

PR/58391: Noriyuki Soda: re-adding syslog_ss() to syslog.h and syslog.3

syslog(3): Nix trailing whitespace in man page.
No functional change intended.

reference sockpath instead of sockspath

Add blocklist_open2() that can pass a custom logger or NULL for no logging.
Switch internally to use syslog_r. Add compatibility for systems that don't
have syslog_r.

Switch blocklist to use syslog_ss since we are being called from a
signal handler.

bump libblocklist
remove trailing space

Silence a bogus warning when starting up:
NetBSD pf:
No ALTQ support in kernel
ALTQ related functions disabled
FreeBSD pf:
Anchor 'blacklistd' not found.
The anchor is indeed found and working correctly. This patch just
discards stderr's output, like in other places.
(jlduran@github)

update markup (Ed Maste)
 1.26.6.1 17-Apr-2023  martin Pull up following revision(s) (requested by he in ticket #137):

lib/libc/stdio/Makefile.inc: revision 1.48
lib/libc/stdio/vfwprintf.c: revision 1.40
lib/libc/include/extern.h: revision 1.27

PR/57250: Martin Husemann: dtoa mishandles infinite doubles on 32bit big
endian machines. When long double support was added, the old code was kept
for the regular double code. This code was never used because WIDE_DOUBLE
was always defined in the Makefile. Remove that old code, and conditionalize
the WIDE_DOUBLE code based on if long doubles are different than doubles on
the specific platform.
 1.29.2.1 02-Aug-2025  perseant Sync with HEAD
 1.1 20-May-2004  christos Add headers that ISC software [bind9] needs to include
 1.2 16-May-2020  thorpej Avoid pulling in "namespace.h" here, as it can have unintended
effects on consumers of this header.
 1.1 26-Apr-2020  thorpej Add a NetBSD native futex implementation, mostly written by riastradh@.
Map the COMPAT_LINUX futex calls to the native ones.
 1.206 02-Mar-2025  riastradh libc: New _r variants of heapsort, mergesort, qsort.

Also kheapsort_r for kernel/standalone use.

These variants allow the caller to pass a cookie through to the
comparison function, e.g. if you want to sort an array of indices
into a buffer.

qsort_r is new in POSIX.1-2024; the others are obvious analogues of
our nonstandard extensions for heapsort and mergesort.

PR lib/58931: qsort_r() missing
 1.205 17-Aug-2024  riastradh libc: Add _l variants of the cNrtomb and mbrtocN functions.

These accept an explicit locale parameter, rather than using the
current locale.

Visible under _NETBSD_SOURCE, not exposed otherwise.

NOTE: This adds libc symbols. Riding the libc minor bump for the
non-_l variants of these from two days ago -- hope that's not pushing
it too far.

PR lib/58613: c*rtomb, mbrtoc* should have locale-parametric _l
variants
 1.204 15-Aug-2024  riastradh libc: c32rtomb and mbrtoc32 are used internally, so weak-alias them.

PR lib/52374: <uchar.h> missing
 1.203 31-May-2022  riastradh branches: 1.203.2; 1.203.4;
libc: Reintroduce getentropy.

This was introduced two years ago when the getrandom/getentropy API
question was still open, and removed because the discussion was
ongoing. Now getentropy is more widely adopted and soon to be in
POSIX. So reintroduce the symbol into libc since we'll be keeping it
anyway. Discussion of details of the semantics, as interpreted by
NetBSD, is ongoing, but the symbol needs to get in before the
netbsd-10 branch. The draft POSIX text is
(https://www.opengroup.org/austin/docs/austin_1110.pdf):

SYNOPSIS
#include <unistd.h>

int getentropy(void *buffer, size_t length);

DESCRIPTION
The getentropy() function shall write length bytes of data
starting at the location pointed to by buffer. The output
shall be unpredictable high quality random data, generated by
a cryptographically secure pseudo-random number
generator. The maximum permitted value for the length
argument is given by the {GETENTROPY_MAX} symbolic constant
defined in <limits.h>.

RETURN VALUES
Upon successful completion, getentropy() shall return 0;
otherwise, -1 shall be retunred and errno set to indicate the
error.

ERRORS
The getentropy() function shall fail if:

[EINVAL] The value of length is greater than
{GETENTROPY_MAX}.

The getentropy() function may fail if:

[ENOSYS] The system does not provide the necessary
source of entropy.

RATIONALE
The getentropy() function is not a cancellation point.

Minor changes from the previous introduction of getentropy into libc:

- Return EINVAL, not EIO, on buflen > 256.
- Define GETENTROPY_MAX in limits.h.

The declaration of getentropy in unistd.h and definition of
GETENTROPY_MAX in limits.h are currently conditional on
_NETBSD_SOURCE. When the next revision of POSIX is finalized, we can
expose them also under _POSIX_C_SOURCE > 20yymmL as usual -- and this
can be done as a pullup without breaking existing compiled programs.
 1.202 11-Sep-2021  andvar Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
 1.201 04-Jul-2021  rillig libc: remove special handling for lint

In namespace.h 1.102 from 2005-07-16, the #ifndef was added to fix the
broken lint2 pass. Somewhere between 2005 and now, lint has been
changed so that it does not need this workaround anymore.

After usr.bin/xlint/lint1/tree.c 1.303 from 2021-06-30, the #ifndef in
namespace.h caused the only warning about an implicit function
declaration in the whole NetBSD tree, in lib/libc/gen/sysconf.c:149,
where _getpagesize was not defined, but only getpagesize.
 1.200 22-Sep-2020  nia remove getentropy bits
 1.199 06-May-2020  nia Add getentropy() to libc - a simple wrapper to access the kernel CSPRNG.

Posted to tech-userlevel@ a week ago and reviewed by riastradh@.

GETENTROPY(3) Library Functions Manual GETENTROPY(3)

NAME
getentropy - fill a buffer with high quality random data

LIBRARY
Standard C Library (libc, -lc)

SYNOPSIS
#include <unistd.h>

int
getentropy(void *buf, size_t buflen);

DESCRIPTION
The getentropy() function fills a buffer with high quality random data,
suitable for seeding cryptographically secure psuedorandom number
generators.

getentropy() is only intended for seeding random number generators and is
not intended for use by regular code which simply needs secure random
data. For this purpose, please use arc4random(3).

The maximum value for buflen is 256 bytes.

IMPLEMENTATION NOTES
getentropy() reads from the sysctl(7) variable kern.arandom.

RETURN VALUES
The getentropy() function returns 0 on success, and -1 if an error
occurred.

ERRORS
getentropy() will succeed unless:

[EFAULT] The buf argument points to an invalid memory address.

[EIO] Too many bytes were requested.

SEE ALSO
arc4random(3), rnd(4)

STANDARDS
The getentropy() function is non-standard.

HISTORY
The getentropy() function first appeared in OpenBSD 5.6, then in
FreeBSD 12.0, and NetBSD 10.
 1.198 18-Apr-2020  thorpej Rename "syscall" to "_syscall" and provide "syscall" as a weak alias.
 1.197 22-Sep-2019  christos Add a new member to struct vfsstat and grow the unused members
The new member is caled f_mntfromlabel and it is the dkw_wname
of the corresponding wedge. This is now used by df -W to display
the mountpoint name as NAME=
 1.196 17-Jan-2018  kamil branches: 1.196.4;
Revert to commits as they broke few rump tests

"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>
 1.195 07-Jan-2018  kamil Revert asctime() namespacing

asctime() is optionally a cancellation point in the POSIX spec.
It's not true for NetBSD.

Requested by <joerg>
 1.194 07-Jan-2018  kamil Revert namespacing of atoi(3)

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>
 1.193 05-Jan-2018  kamil Register new weak symbol in libc for internal usage: atoi

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>
 1.192 05-Jan-2018  kamil Register new weak symbol in libc for internal usage: asctime

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>
 1.191 05-Jan-2018  kamil Register dl_iterate_phdr in the libc's namespace.h

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>
 1.190 05-Jan-2018  kamil Register more syscalls in namespace.h (of libc)

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>
 1.189 30-Nov-2017  riastradh Import SHA-3 code into libc and libkern.

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
 1.188 22-Oct-2017  riastradh xref libc/README
 1.187 22-Oct-2017  christos Add an explanation of how namespace.h works.
 1.186 08-Feb-2017  maya Make paccept a weak symbol in preparation for using it in another function
 1.185 13-Jan-2017  christos branches: 1.185.2;
allow overriding snprintf/vsnprintf
 1.184 12-Jan-2017  christos undo SSP damage from -Wsystem-headers
 1.183 12-Jan-2017  christos Add strerror_ss_r to be used by syslog_ss
 1.182 24-Sep-2016  christos remove mpool_getf
 1.181 24-Sep-2016  christos bump for the flags version of db routines
 1.180 03-Apr-2016  christos branches: 1.180.2;
userland bits for wait6/waitid.
 1.179 10-Sep-2015  christos namespace protect allocaddrinfo
 1.178 01-May-2015  christos - new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
 1.177 17-Feb-2015  joerg Introduce reallocarr(3) for easy (re)allocation of memory with overflow
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.
 1.176 26-Sep-2014  christos add execvpe, execlpe (reviewed by phone)
 1.175 25-Sep-2014  manu Fix argument paddiing for posix_fallocate and fdiscard with gcc 1.x
 1.174 13-Jun-2014  joerg branches: 1.174.2;
Add asysctl(3) and asysctlbyname(3) wrappers for the common idiom of
fetching dynamically sized data via sysctl.
 1.173 16-Jan-2014  christos branches: 1.173.2;
remove dups
 1.172 16-Jan-2014  christos namespace protection for the new err functions
 1.171 16-Jan-2014  joerg Fix (v)errc/(v)warnc.
 1.170 05-Dec-2013  joerg Add cdbr_open_mem.
 1.169 28-Aug-2013  riastradh Publish explicit_memset and consttime_memequal in userland libc.

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)
 1.168 19-Aug-2013  joerg Add strerror_l.
 1.167 19-Aug-2013  joerg Add nl_langinfo_l, catopen_l and wcsftime_l.
 1.166 30-Apr-2013  joerg Make that to process PATH_LOCALE the first time _find_category is
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.
 1.165 21-Apr-2013  joerg Store time-specific locale data directly in the locale.
Ad dstrftime_l, strftime_lz and strptime_l.
 1.164 19-Apr-2013  joerg Add scanf_l and wscanf_l families.
 1.163 19-Apr-2013  joerg Add dummy strcoll_l and strxfrm_l.
 1.162 19-Apr-2013  joerg Add explicit locale versions for the printf family. Replace asprintf,
snprintf and sprintf with simple wrappers around the corresponding
va_list functions to reduce code duplication.
 1.161 18-Apr-2013  joerg Add wcscoll_l, wcsxfrm_l, wcsncasecmp_l, wcscasecmp_l, btowc_l,
mbrlen_l, mbsinit_l, mbsrtowcs_l, wcrtomb_l, wcsrtombs_l and wctob_l.
 1.160 18-Apr-2013  joerg Add wcstof_l, wcstod_l and wcstold_l.
 1.159 18-Apr-2013  joerg Add strtof_l, strtod_l and strtold_l.
 1.158 16-Apr-2013  joerg Add strtol_l and friends. Switch _citrus_bcs_strtol to use plain
strtol_l unless in tools mode. Add note to retire the BCS code on the
next libc major bump.
 1.157 16-Apr-2013  joerg Add wcwidth_l, wcswidth_l and the wctype.h family of *_l functions.
 1.156 20-Aug-2012  dsl branches: 1.156.2;
I'm fairly sure the libc rules require that arc4random_addrandom,
arc4random_buf, arc4random_stir and arc4random_uniform be weak.
 1.155 09-Jul-2012  rmind Add weak symbol for murmurhash2.
 1.154 03-Jun-2012  joerg Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
 1.153 12-Apr-2012  christos name protection for getpassfd
 1.152 12-Apr-2012  christos Add a new getpass implementation that does not mess with signals, and
include getpass_r
 1.151 02-Mar-2012  christos PR/46111: Wolfgang Stukenbrock: Add yp_setbindtries(3) so that yp operations
don't hang forever if requested.
 1.150 15-Feb-2012  joerg branches: 1.150.2;
Make sure that membar_producer gets the proper namespace mangling for libc.
 1.149 04-Jul-2011  manu branches: 1.149.2;
Import xdr_sizeof() from FreeBSD
 1.148 26-Mar-2011  christos add fpgetprec/fpsetprec
 1.147 12-Mar-2011  christos Fix various vis/unvis issues:
- no need for all the weak symbols
- define a new _VIS_END flag for UNVIS_END so that there are no collisions
between and vis and unvis flags.
- add bound versions of the vis and unvis functions that take the length of
the destination buffer. Unlike the OpenBSD ones they return -1 or NULL if
the buffer is not large enough, instead of silently truncating.
 1.146 16-Dec-2010  christos Provide a re-entrant and thread-safe set of timezone API's that
don't require locking and can operate on user-specified timezones
as opposed to having to alter the environment to change a timezone.
This work was presented to the tzcode folks and it was generally
accepted, but there seems to be a lot of inertia.
 1.145 17-Nov-2010  tron Provide proper namespace protection for rbtree(3) because it is now
used by "libc" internally.
 1.144 13-Nov-2010  christos forgot to commit this one for two months!
add vdprintf.
 1.143 06-Sep-2010  jakllsch New vdprintf needs "namespace protection".
 1.142 25-Apr-2010  joerg Add the constant database reader (cdbr(3)) and writer ((cdbw(3)).
They implement a space efficent write-once database with fast access
path. Switch the services(5) database to use cdb. The size of the
database file decreases from 2.1MB disk space to 307KB. Access
performance is about the same if setservent(0) is used and about an
order of magnitude faster otherwise. services_mkdb defaults to the new
format, but can optionally create the old db(3) format as well for
statically linked legacy applications.
 1.141 19-Mar-2010  joerg Namespace protection for mi_vector_hash.
 1.140 02-Dec-2009  roy Protect getline.
 1.139 01-Dec-2009  roy Protect getdelim when used internally.
 1.138 26-May-2009  joerg Add SHA224 implementation to libc.
Make libcrypto use the SHA2 implementation of libc.
Bump minor versions of libc and libcrypto.
 1.137 11-Jan-2009  christos merge christos-time_t
 1.136 05-Dec-2008  ad Add fdopendir(), from Solaris/Linux.
 1.135 20-Nov-2008  matt Add new ptree (Patricia / RADIX tree) implementation to NetBSD.
 1.134 31-Oct-2008  christos branches: 1.134.2;
Import syslogd SoC project by Martin Schuette:
- new syslog protocol api syslogp(3) that supports structured data
and draft-rfc timestamps
- reliable tcp connections with queueing
- encrypted connections
 1.133 04-Aug-2008  matt branches: 1.133.4; 1.133.6;
Add C99 functions imaxabs and imaxdiv.
 1.132 25-Jun-2008  ad Add getlogin_r. Manual page changes mostly lifted from FreeBSD.
 1.131 28-Apr-2008  martin branches: 1.131.2;
Remove clause 3 and 4 from TNF licenses
 1.130 02-Feb-2008  christos branches: 1.130.4;
namespace protection for csetexpandtc()
 1.129 03-Jun-2007  christos branches: 1.129.4;
- add read and readlink since they are used internally
- protect vsnprintf and vsnprintf since for lex(1) generated files <stdio.h>
is included before "namespace.h".
 1.128 10-May-2007  he The sl_delete function needs namespace protection added here as well.
 1.127 18-Feb-2007  christos SHA512_Last is not public anymore.
 1.126 17-Feb-2007  christos Define for SHA512_Last.
 1.125 08-Nov-2006  drochner branches: 1.125.2; 1.125.6;
cleanup unused stuff after hmac_* removal
 1.124 03-Nov-2006  christos protect the *syslog_ss
 1.123 28-Oct-2006  christos add {v,}snprintf_ss
 1.122 25-Oct-2006  christos add _r functions for syslog from OpenBSD
 1.121 24-Aug-2006  mrg remove duplicates added in previous commit.
 1.120 23-Aug-2006  christos I think we want both wcs{c,n}casecmp weak.
 1.119 23-Aug-2006  mrg add wcsdup, wcscasecmp and wcsncasecmp. fixes build problems..
 1.118 12-Aug-2006  christos - Add strndup and stresep
- Use stresep so in fstab so that we can mount paths with white space in them.
 1.117 23-Jun-2006  christos branches: 1.117.2;
Make these weak as Matthias Drochner pointed out.
 1.116 05-May-2006  rpaulo Add support for RFC 3542 Adv. Socket API for IPv6 (which obsoletes 2292).
* RFC 3542 isn't binary compatible with RFC 2292.
* RFC 2292 support is on by default but can be disabled.
* update ping6, telnet and traceroute6 to the new API.

From the KAME project (www.kame.net).
Reviewed by core.
 1.115 17-Apr-2006  salo Add setttyentpath(), functionally equivalent to setttyent() but takes an
additional argument to read the ttys information from an alternate path
istead of _PATH_TTYS.

Required for upcoming init(8) changes.

Mostly from <apb>.

Bump libc minor.
 1.114 16-Apr-2006  christos namespace protect wcstod too, and fix the protection in wcstold and wcstof.
 1.113 15-Apr-2006  tnozaki wcstod(3) is conform to ISO C90 Ammendant1 (FreeBSD's manpage is incorrect...).
don't __weak_alias'ize it and fix manpage.
 1.112 15-Apr-2006  tnozaki add c99 wcstof(3) and wcstold(3).
requested by skrll AT netbsd DOT org, thanks.

bump libc minor 138 -> 139.
 1.111 15-Mar-2006  kleink Add strtof(3) and strtold(3); welcome libc 12.137.
 1.110 26-Jan-2006  kleink Need to give the various rpc locks private names (prefixing them with
__rpc_). Rather than scattering changes around the 3rd-party RPC
code, place them in namespace.h.
 1.109 26-Sep-2005  christos the sha2 functions have an _.
 1.108 25-Sep-2005  elad Fix weak aliasing after recent changes.

Inspired by comments from christos@, xtraeme@, mlelstv@, mhitch@, mrg@,
and uwe@; all the bugs are mine.
 1.107 25-Sep-2005  christos add getenv_r and ttyname_r
 1.106 07-Aug-2005  veego Last change to namespace.h had an wrong entry: in6addr_nodelocal_allrouters
instead of in6addr_linklocal_allrouters.
Bump the shared library minor version.

Thanks to Klaus Klein for the hint what went wrong.
 1.105 07-Aug-2005  christos add missing in6addr_linklocal_allrouters.
 1.104 30-Jul-2005  christos - Fix the remaining indr_references so that they define lint symbols.
- Add an internal symbol for strerror_r (thanks klaus for noticing)
- Remove internal __strerror
 1.103 17-Jul-2005  christos Add comments at the end of #endif's; Requested by Havard Eidnes.
 1.102 16-Jul-2005  christos don't play #define games with lint. Breaks pass2.
 1.101 15-May-2005  yamt add fgetwln.
 1.100 07-Apr-2005  christos statvfs is both a function name and a struct tag. Defining it to _statvfs
causes lint to complain because it sees both struct statvfs and struct
_statvfs. Fix by changing the macro to have arguments.
XXX[1]: Probably this should be done for the rest of the functions that have
the same names as struct tags.
XXX[2]: Is there a better way?
 1.99 02-Apr-2005  christos PR/29849, PR/29850: Add getpwent_r and getgrent_r
 1.98 09-Feb-2005  kleink branches: 1.98.2;
A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
 1.97 06-Jan-2005  lukem Implement getgroupmembership(3). This is similar to getgrouplist(3), except
that the "int maxgroups" and "int *ngroups" parameters are separated into
two separate parameters which makes it possible to call multiple nsswitch
back-ends and have the results correctly merged.
getgrouplist(3) is now implemented using getgroupmembership(3).

Proposed on tech-userlevel on December 1, 2004.
 1.96 16-Dec-2004  kleink Internally rename getdevmajor(); noted by Geoff Wing.
 1.95 05-Oct-2004  lukem Overhaul the use of nsdispatch(3) by public APIs so that the back-end
methods use va_list in a manner that is directly related to the public API.
This makes it much easier to write dynamic nsswitch backends for getpwent(3).
Per my proposal on tech-userlevel.

Implement getpwgid_r() and getpwnam_r() APIs per the POSIX 1003.1, 2004 Ed.
These aren't fully reentrant or threadsafe yet, because the compat stuff
currently uses non-reentrant data sources (getnetgrent(3), getpwent(3)),
and there is probably some locking to be improved in the backends.
This will be fixed in the near future.
We also need to add _SC_GETPW_R_SIZE_MAX to sysconf(3).

Fix the compat `+' prototype override so getpwnam(3) and getpwuid(3) DTRT.

Improve the description of pw_class and pw_gecos.
 1.94 04-Oct-2004  lukem crank copyright
 1.93 04-Oct-2004  lukem Overhaul the use of nsdispatch(3) by public APIs so that the back-end
methods use va_list in a manner that is directly related to the public API.
This makes it much easier to write dynamic nsswitch backends for getgrent(3).
Per my proposal on tech-userlevel.

Implement getgrgid_r() and getgrnam_r() APIs per the POSIX 1003.1, 2004 Ed.
These aren't fully reentrant or threadsafe yet, because the compat stuff
currently uses non-reentrant data sources (getnetgrent(3), getgrent(3)),
and there is probably some locking to be improved in the backends.
This will be fixed in the near future.
We also need to add _SC_GETGR_R_SIZE_MAX to sysconf(3).
 1.92 17-Aug-2004  ginsbach namespace protection for gethostent()
 1.91 02-Jun-2004  christos delete duplicate namespace protection.
 1.90 21-May-2004  christos namespace protection for resolver routines.
 1.89 10-May-2004  drochner After discussion with christos, turn fgetstr() into an internal function.
Its API in inherently non-threadsafe (and it depends on certain properties
of the underlying stdio implementation), so it shouldn't be a first-class
function for general use, polluting the application namespace.
Also remove the FLOCKFILE() code from it - this is under control of the
calling function now.
(XXX I'm not sure whether the FLOCKFILE() should be kept in fgetln(),
this function cannot be used in multiple threads anyway. It doesn't
hurt much, and it might prevent corruption of internal FILE structures.)
 1.88 09-May-2004  kleink We now need an internal name for fileno(), since when buildling libc
_REENTRANT we can no longer use the macro version from <stdio.h>.
 1.87 27-Apr-2004  kleink Remove internal names for dbm_*(3); these are not required at this time.
 1.86 21-Apr-2004  christos protect fgetstr
 1.85 08-Apr-2004  atatat Weak aliases for sysctlfoobar() functions.
 1.84 04-Mar-2004  kleink branches: 1.84.2;
* Turn isinf(3) and isnan(3) into C99-style macros.
* Make it possible for ports to override these (i.e., VAX).
* Remove isnanl(), which was internal to libc only.
 1.83 19-Feb-2004  christos _r functions for services and protocols; also add the inet_cidr_* function
which will come next.
 1.82 18-Sep-2003  jdolecek remove pw_dup()
 1.81 13-Sep-2003  itojun weak alias for pw_dup
 1.80 13-Sep-2003  itojun use internal names for randomid()
 1.79 27-Jun-2003  tshiozak Citrus iconv support(4)
add iconv external I/F (iconv.h - iconv_open()/iconv()/iconv_close()) and
iconv(1) utility.
TODO:
- bump libc minor.
- add iconv data files.
- create manpages: iconv_open(3)/iconv(3)/iconv_close(3)/iconv(1)/
mkesdb(1)/mkcsmapper(1).
 1.78 28-May-2003  christos add readdir_r alias
 1.77 17-May-2003  thorpej Add isinfl() and isnanl().
 1.76 13-Feb-2003  nathanw Implement pthread_atfork() (in libc, because the required threadlib
stub behavior is exactly the same as the usual behavior).
 1.75 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.74 30-Nov-2002  lukem - Migrate fparseln(3) from libutil to libc, where it should have been in
the first place...
- Bump libutil major (to 7.0) and libc minor (to 12.91).
 1.73 29-Nov-2002  lukem add strsuftoll(3) and strsuftollx(3) - parse a string for a number
with an optional suffix, product (two numbers separated by `x'), and
provide range checking
 1.72 08-Nov-2002  fvdl Add rpc_control.
 1.71 17-Apr-2002  kleink branches: 1.71.2;
Need internal names for strlcat() and strlcpy().
 1.70 24-Jan-2002  lukem - Implement pwcache_userdb(3), which changes the routines that
user_from_uid(3) and uid_from_user(3) use to lookup user information.
- Implement pwcache_groupdb(3), which changes the routines that
group_from_gid(3) and gid_from_group(3) use to lookup group information.
- Ensure that private functions in pwcache.c are declared static
- Use strlcpy(3) instead of strncpy(3)
 1.69 14-Jan-2002  thorpej * Add WSYSCALL() to SYS.h, which creates a system call with an
internal name and a weak alias for the name.
* Add a WEAKASM syscall list, and process it.
* Make sysarch() have an internal name (_sysarch()).
 1.68 13-Jan-2002  thorpej Add internal names for fp{get,set}{mask,round,sticky}(), and
externally-visible weak aliases for the internal names.
 1.67 19-Sep-2001  aymeric move adjtime and clock_settime where they belong, now that they are C functions.
Apart from being TRT, this makes a.out builds work again.
 1.66 16-Sep-2001  manu Added support to use the clockctl driver if present for adjtime(),
clock_settime(), ntp_adjtime() and settimeofday(). The super-user still
always use the plain system call.
Approved by Christos
 1.65 07-May-2001  kleink Internally rename sysconf() to __sysconf() to make its latter name suitable
for use from public headers. Also, do so on all platforms.
 1.64 28-Apr-2001  kleink * Move definitions of exact-width integer types from <machine/types.h>
to <sys/types.h> and <sys/stdint.h>.
* Add a new C99 <stdint.h> header, which provides integer types of
explicit width, related limits and integer constant macros.
* Extend <inttypes.h> to provide <stdint.h> definitions and format
macros for printf() and scanf().
* Add C99 strtoimax() and strtoumax() functions.
* Use the latter within scanf().
* Add C99 %j, %t and %z printf()/scanf() conversions for
intmax_t, pointer-type and size_t arguments.
 1.63 13-Apr-2001  kleink Need an internal name for asprintf(3).
 1.62 31-Mar-2001  kleink Finally deprecate the old timezone() interface in favor of an XSH5
timezone/daytime pair; as proposed by J.T. in September, 1996.
Fixes PR standards/11807 by Nick Hudson.
 1.61 19-Mar-2001  atatat Add md2 routines to libc.
 1.60 19-Feb-2001  cgd branches: 1.60.2;
define getprogname to _getprogname for internal use
 1.59 20-Oct-2000  briggs Add {__,}fmtcheck(), a function specified by Bill Sommerfeld to check
a user-supplied format string against a fallback format string to ensure
that they will consume arguments of the same type.

libc minor bump for new API entry point.
 1.58 28-Sep-2000  kleink Need an internal name for pipe(2).
 1.57 08-Jul-2000  kleink XCU5: Add fseeko() and ftello() functions which provide the functionality of
fseek() and ftell(), respectively, but operate on file offsets of type off_t.
 1.56 05-Jul-2000  kleink Lexicographically sort in previous.
 1.55 05-Jul-2000  ad Pull in RIPEMD-160 functions from OpenBSD - this has the same API as our MD4,
MD5 and SHA1 stuff.
 1.54 26-Jun-2000  kleink Need an internal name for fork().
 1.53 23-Jun-2000  kleink Add internal names for brk() and sbrk().
 1.52 02-Jun-2000  fvdl branches: 1.52.2;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.51 08-May-2000  kleink branches: 1.51.2;
Need an internal name for send(); noticed by itojun.
 1.50 24-Apr-2000  itojun use BSDI-origin if_{index,name}* functions. they use getifaddrs(3) as
backend and are more robust against SIOCGIFCONF alignment issue.
now getifaddrs always takes care of the issue. (sync with kame tree)
use weak symbol just in case.
 1.49 24-Apr-2000  itojun supply weak alias for IPv6-related library additions. sorry to be late.
 1.48 02-Apr-2000  christos protect getopt_long.
 1.47 02-Apr-2000  minoura Move dl* function definitions to libc on ELF.
Based on the patch supplied by Takuya Shiozaki <tshiozak@astec.co.jp>.
See http://mail-index.netbsd.org/tech-userlevel/2000/02/23/0000.html.
 1.46 08-Mar-2000  kleink No longer need internal names for strtoq() and strtouq().
 1.45 06-Mar-2000  kleink Add ISO C99 long long integer general utility interfaces; partially addresses
PR standards/9482.
 1.44 23-Jan-2000  mycroft Ditto for nlist().
 1.43 22-Jan-2000  mycroft Don't do the namespace hack for timezone() here; it causes lint, and we don't
need it anyway.
 1.42 01-Dec-1999  thorpej Implement XDR routines for 64-bit integer data types:
- xdr_int64_t(), xdr_u_int64_t(), per NetBSD convention.
- xdr_hyper(), xdr_u_hyper(), xdr_longlong_t(), xdr_u_longlong_t(), a'la
Solaris, implemented in terms of the above.
 1.41 25-Nov-1999  wennmach Added #defines for svis, strsvis, strsvisx
 1.40 20-Sep-1999  kleink branches: 1.40.4;
Need internal names for these, too.
 1.39 15-Sep-1999  kleink Add indirect reference stubs for inet_[ap]ton() for environments not supporting
weak aliases; addresses PR lib/7435 but leaves the original file intact.
 1.38 17-Aug-1999  mycroft getsubopt(3) has a weak alias.
 1.37 09-Mar-1999  kleink Functionally back out namespace.h revision 1.7 and perror.c revision 1.15;
perror() is an identifier reserved by ANSI/ISO C, and in case of a redefition
the behavior is undefined.
 1.36 06-Feb-1999  kleink Add l64a_r(), a reentrant version of l64a(); found in the Multithreading
Extension of SVID4.
 1.35 04-Feb-1999  explorer add sha1 functions, like md5/4
 1.34 25-Jan-1999  lukem namespace protect hesiod stuff
 1.33 20-Jan-1999  lukem protect nsdispatch. sort entries
 1.32 30-Nov-1998  thorpej Need an internal name for the (new) sys_nsig.
 1.31 20-Oct-1998  kleink Need internal names for MD[45]{Init,Final,Update}().
 1.30 18-Oct-1998  kleink Replace use of getdtablesize() with (the non-deprecated) sysconf(), hence no
need for an internal name for the former any more; suggested by Matthew Green.
 1.29 16-Oct-1998  kleink getsubopt() isn't used internally.
 1.28 16-Oct-1998  kleink Need an internal name for herror().
 1.27 16-Oct-1998  kleink Need an internal name for tzname.
 1.26 16-Oct-1998  kleink Need an internal name for signal().
 1.25 16-Oct-1998  kleink Need an internal name for fgetln().
 1.24 15-Oct-1998  kleink Need an internal name for dn_expand().
 1.23 14-Oct-1998  kleink Need internal names for {end,set}hostent().
 1.22 14-Oct-1998  kleink Need internal names for res_init(), res_mkquery(), res_query() and res_search().
 1.21 14-Oct-1998  kleink Need internal names for ftruncate(), lseek(), mmap(), pread() and pwrite().
 1.20 13-Oct-1998  kleink Need an internal name for inet_aton().
 1.19 13-Oct-1998  kleink Need internal names for gethostby{addr,name}().
 1.18 13-Oct-1998  kleink Need an internal name for getdomainname().
 1.17 13-Oct-1998  kleink Need an internal name for strsep().
 1.16 13-Oct-1998  kleink Need an internal name for strdup().
 1.15 13-Oct-1998  kleink Need an internal name for isatty().
 1.14 13-Oct-1998  kleink Need internal names for isinf() and isnan().
 1.13 13-Oct-1998  kleink Need internal names for snprintf() and vsnprintf().
 1.12 13-Oct-1998  kleink Need an internal name for fdopen().
 1.11 08-Oct-1998  kleink Add an internal name for getdtablesize(), since it's being used internally.
 1.10 27-Sep-1998  kleink Add missing renaming of tcgetsid().
 1.9 27-Sep-1998  kleink Add an internal name for strtok_r().
 1.8 10-Sep-1998  kleink Add asctime_r(), ctime_r(), gmtime_r() and localtime_r().
 1.7 28-Jul-1998  mycroft Add an internal name for perror(3).
 1.6 20-Dec-1997  kleink Add lockf(), an alternate interface to perform advisory record locking;
per XPG4.2.
 1.5 02-Nov-1997  kleink Add basename() and dirname(), from XPG4.2.
 1.4 21-Jul-1997  jtc Put TNF copyright on this file
 1.3 21-Jul-1997  jtc If port provides __weak_alias(), provide an Standard C and POSIX pure
identifier namespace by renaming non standard functions and variables
such that they have a leading underscore. The library will use those
names internally. Weak aliases are used to provide the original names
to the API.

This is only the first part of this change. It is most of the functions
which are implemented in C for all NetBSD ports. Subsequent changes are
to add the same support to the remaining C files, to assembly files, and
to the automagically generated assembly source used for system calls.
When all of the above is done, ports with weak alias support should add
a definition for __weak_alias to <sys/cdefs.h>.
 1.2 27-Feb-1995  cgd branches: 1.2.4;
clean up Id
 1.1 09-Feb-1995  jtc branches: 1.1.2;
Initial set of ANSI clean namespace mappings.
 1.1.2.7 02-May-1995  jtc #include "namespace.h"
 1.1.2.6 26-Apr-1995  jtc namespace exec*() and *dir() functions, like sysv
 1.1.2.5 25-Apr-1995  jtc signal set manipulation functions are used by abort()
 1.1.2.4 25-Apr-1995  jtc Namespace protect isatty(), it's used by stdio to determine default
buffering characteristics for streams.
 1.1.2.3 18-Apr-1995  jtc namespace protect isnan() and isinf()
 1.1.2.2 25-Mar-1995  jtc updated
 1.1.2.1 13-Mar-1995  jtc add mappings for syscalls and time and date routines
 1.2.4.8 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.2.4.7 19-Sep-1996  jtc snapshot namespace cleanup: gen
 1.2.4.6 18-Sep-1996  jtc snapshot namespace cleanup: stdlib
 1.2.4.5 17-Sep-1996  jtc snapshot namespace cleanup: time
 1.2.4.4 17-Sep-1996  jtc snapshot namespace cleanup: yp
 1.2.4.3 17-Sep-1996  jtc snapshot namespace cleanup: termios
 1.2.4.2 16-Sep-1996  jtc snapshot namespace cleanup: rpc & xdr
 1.2.4.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.40.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.51.2.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.52.2.3 22-Apr-2002  he Pull up revision 1.71 (via patch, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.52.2.2 29-Sep-2000  kleink Pull up rev. 1.58 (approved by thorpej):
Add internal name for pipe().
 1.52.2.1 22-Aug-2000  kleink Pull up revs. 1.53-1.54 (approved by thorpej):
Add internal names for brk(), sbrk() and fork().
 1.60.2.10 08-Jan-2003  thorpej Need an internal name for kill().
 1.60.2.9 10-Dec-2002  thorpej Sync with HEAD.
 1.60.2.8 11-Nov-2002  nathanw Catch up to -current
 1.60.2.7 02-Aug-2002  nathanw Adapt to new stub name for sysarch.
 1.60.2.6 25-Apr-2002  nathanw Catch up to -current.
 1.60.2.5 25-Feb-2002  nathanw Move setlogin() stub to C code, and namespace-protect it.
 1.60.2.4 06-Feb-2002  nathanw Add internal names for flockfile(), ftrylockfile(), and funlockfile().
 1.60.2.3 28-Jan-2002  nathanw Catch up to -current.
 1.60.2.2 08-Oct-2001  nathanw Catch up to -current.
 1.60.2.1 05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.71.2.1 06-Jan-2003  jmc Pull up revisions 1.71-1.72 (requested by fvdl in ticket #1037)
Add rpc_control.
 1.84.2.3 11-Sep-2004  he Pull up revision 1.92 (requested by ginsbach in ticket #834):
Restore gethostent() as a supported interface. Yes, it
may be obsolete, but it is specified by IEEE Std 1003.1,
2004 Edition (POSIX) and the X/Open standards (Issue 66
and XNS 5.2).
 1.84.2.2 11-May-2004  tron Pull up revision 1.88 (requested by kleink in ticket #311):
We now need an internal name for fileno(), since when buildling libc
_REENTRANT we can no longer use the macro version from <stdio.h>.
 1.84.2.1 08-Apr-2004  jdc Pull up revision 1.85 (requested by atatat in ticket #90)

Weak aliases for sysctlfoobar() functions.
 1.98.2.2 28-Jan-2006  tron Pull up following revision(s) (requested by kleink in ticket #1142):
lib/libc/rpc/mt_misc.c: revision 1.5
lib/libc/include/namespace.h: revision 1.110
Need to give the various rpc locks private names (prefixing them with
__rpc_). Rather than scattering changes around the 3rd-party RPC
code, place them in namespace.h.
 1.98.2.1 11-Jul-2005  tron Pull up revision 1.99 (requested by lukem in ticket #540):
PR/29849, PR/29850: Add getpwent_r and getgrent_r
 1.117.2.2 27-Aug-2006  riz Pull up following revision(s) (requested by tron in ticket #64):
lib/libc/include/namespace.h: revision 1.119
lib/libc/string/wcsdup.c: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.1
lib/libc/include/namespace.h: revision 1.120
distrib/sets/lists/base/shl.mi: revision 1.366
lib/libc/shlib_version: revision 1.182
include/wchar.h: revision 1.26
lib/libc/string/Makefile.inc: revision 1.62
lib/libc/string/Makefile.inc: revision 1.63
lib/libc/string/wcsncasecmp.c: revision 1.1
PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
libc 147 for wcsdup and wcs{n,}casecmp
include one more new file.
add wcsdup, wcscasecmp and wcsncasecmp. fixes build problems..
I think we want both wcs{c,n}casecmp weak.
 1.117.2.1 27-Aug-2006  riz Pull up following revision(s) (requested by tron in ticket #63):
regress/lib/libc/string/Makefile: revision 1.9
lib/libc/string/strsep.3: revision 1.17
lib/libc/string/strsep.3: revision 1.18
regress/lib/libc/string/stresep/Makefile: revision 1.1
distrib/sets/lists/base/shl.mi: revision 1.364
regress/lib/libc/string/stresep/stresep_test.c: revision 1.1
lib/libc/gen/fstab.c: revision 1.28
lib/libc/shlib_version: revision 1.181
lib/libc/string/strndup.c: revision 1.1
lib/libc/string/strdup.3: revision 1.13
lib/libc/string/strdup.3: revision 1.14
lib/libc/string/Makefile.inc: revision 1.61
include/string.h: revision 1.31
distrib/sets/lists/comp/mi: revision 1.909
lib/libc/string/stresep.c: revision 1.1
lib/libc/include/namespace.h: revision 1.118
- Add strndup and stresep
- Use stresep so in fstab so that we can mount paths with white space in th=
em.
Add stresep and strndup.
add regression test for stresep.
libc 146
man pages for stresep and strndup.
Mark up NULL.
stresep, not strnsep. Remove duplicate "the". Bump date for previous.
 1.125.6.1 22-Jul-2009  snj Apply patch (requested by joerg in ticket #1338):
- Add support for SHA224 to libc
- Fix Big Endian support in some cases
- Use libc support in libcrypto
 1.125.2.1 22-Jul-2009  snj Apply patch (requested by joerg in ticket #1338):
- Add support for SHA224 to libc
- Fix Big Endian support in some cases
- Use libc support in libcrypto
 1.129.4.1 23-Mar-2008  matt sync with HEAD
 1.130.4.1 18-May-2008  yamt sync with head.
 1.131.2.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.133.6.1 14-Jul-2009  snj branches: 1.133.6.1.2;
Pull up following revisions (requested by joerg in ticket #855):
common/lib/libc/hash/sha2/sha2.c: revisions 1.8-1.18 via patch
crypto/dist/openssl/crypto/evp/m_sha1.c: revisions 1.2-1.3 via patch
distrib/sets/lists/base/md.amd64: revision 1.51 via patch
distrib/sets/lists/base/md.sparc64: revision 1.46 via patch
distrib/sets/lists/base/shl.mi: revision 1.474 via patch
distrib/sets/lists/comp/mi: revision 1.1263 via patch
lib/libc/shlib_version: patch
lib/libc/hash/sha2/Makefile.inc: revision 1.4 via patch
lib/libc/hash/sha2/sha2.3: revision 1.5 via patch
lib/libc/hash/sha2/sha224hl.c: revision 1.1 via patch
lib/libc/include/namespace.h: revision 1.138 via patch
lib/libcrypto/libc-sha256.c: revision 1.1 via patch
lib/libcrypto/libc-sha512.c: revision 1.1 via patch
lib/libcrypto/sha.inc: revision 1.10 via patch
lib/libcrypto/shlib_version: patch
sys/lib/libkern/arch/vax/Makefile.inc: revision 1.21 via patch
sys/sys/sha2.h: revision 1.3 via patch
Add SHA224 implementation to libc.
Make libcrypto use the SHA2 implementation of libc.
Bump minor versions of libc and libcrypto.
 1.133.6.1.2.1 21-Apr-2010  matt sync to netbsd-5
 1.133.4.1 14-Jul-2009  snj Pull up following revisions (requested by joerg in ticket #855):
common/lib/libc/hash/sha2/sha2.c: revisions 1.8-1.18 via patch
crypto/dist/openssl/crypto/evp/m_sha1.c: revisions 1.2-1.3 via patch
distrib/sets/lists/base/md.amd64: revision 1.51 via patch
distrib/sets/lists/base/md.sparc64: revision 1.46 via patch
distrib/sets/lists/base/shl.mi: revision 1.474 via patch
distrib/sets/lists/comp/mi: revision 1.1263 via patch
lib/libc/shlib_version: patch
lib/libc/hash/sha2/Makefile.inc: revision 1.4 via patch
lib/libc/hash/sha2/sha2.3: revision 1.5 via patch
lib/libc/hash/sha2/sha224hl.c: revision 1.1 via patch
lib/libc/include/namespace.h: revision 1.138 via patch
lib/libcrypto/libc-sha256.c: revision 1.1 via patch
lib/libcrypto/libc-sha512.c: revision 1.1 via patch
lib/libcrypto/sha.inc: revision 1.10 via patch
lib/libcrypto/shlib_version: patch
sys/sys/sha2.h: revision 1.3 via patch
Add SHA224 implementation to libc.
Make libcrypto use the SHA2 implementation of libc.
Bump minor versions of libc and libcrypto.
 1.134.2.7 10-Jan-2009  christos revert previous resolver patch. Not meant for christos-time_t
 1.134.2.6 04-Jan-2009  christos merge with head.
 1.134.2.5 10-Nov-2008  christos fix difftime.
 1.134.2.4 10-Nov-2008  christos this completes the symbol implementation for now. New we need to debug...
 1.134.2.3 09-Nov-2008  christos version some more stuff and add sys_foo aliases.
 1.134.2.2 08-Nov-2008  christos time_t changes
 1.134.2.1 31-Oct-2008  christos file namespace.h was added on branch christos-time_t on 2008-11-08 21:45:38 +0000
 1.149.2.3 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.149.2.2 30-Oct-2012  yamt sync with head
 1.149.2.1 17-Apr-2012  yamt sync with head
 1.150.2.1 23-Jun-2012  riz Pull up following revision(s) (requested by joerg in ticket #328):
lib/libc/gen/devname.c: revision 1.22
distrib/sparc64/instfs/dot.profile: revision 1.7
distrib/i386/cdroms/install.sh: revision 1.3
tests/lib/libcurses/director/director.c: revision 1.10
lib/libc/include/reentrant.h: revision 1.15
distrib/amd64/cdroms/install.sh: revision 1.3
tests/include/t_paths.c: revision 1.12
share/man/man7/hier.7: revision 1.101
etc/rc.d/sysdb: revision 1.24
include/stdlib.h: revision 1.99
tests/lib/libcurses/Makefile: revision 1.3
distrib/sparc64/cdroms/installcd/install.sh: revision 1.3
distrib/i386/cdroms/Makefile.cdrom: revision 1.27
lib/libc/gen/ttyname.c: revision 1.25
usr.bin/tic/Makefile: revision 1.2
tools/compat/Makefile: revision 1.57
lib/libterminfo/compile.c: revision 1.7
lib/libc/gen/ttyname.c: revision 1.26
lib/libterminfo/compile.c: revision 1.8
tools/compat/Makefile: revision 1.59
tools/compat/cdbw.h: revision 1.1
distrib/i386/installimage/install.sh: revision 1.2
lib/libc/include/namespace.h: revision 1.154
usr.bin/tic/tic.c: revision 1.13
usr.bin/tic/tic.c: revision 1.14
usr.bin/tic/tic.c: revision 1.15
distrib/sets/lists/base/mi: revision 1.996
usr.bin/tic/tic.c: revision 1.16
usr.sbin/dev_mkdb/dev_mkdb.8: revision 1.13
usr.bin/tic/tic.c: revision 1.17
usr.bin/tic/tic.c: revision 1.18
tools/compat/cdbr.h: revision 1.1
distrib/sparc64/instfs/list: revision 1.25
usr.bin/tic/tic.c: revision 1.19
lib/libc/cdb/cdbw.c: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.5
share/terminfo/Makefile: revision 1.3
usr.sbin/dev_mkdb/dev_mkdb.c: revision 1.29
usr.sbin/dev_mkdb/Makefile: revision 1.8
lib/libc/gen/ttyname.3: revision 1.23
lib/libc/gen/ttyname.3: revision 1.24
lib/libc/cdb/cdbr.c: revision 1.3
include/cdbw.h: revision 1.2
distrib/sparc64/cdroms/installcd/Makefile: revision 1.15
lib/libc/gen/devname.3: revision 1.12
tools/compat/compat_defs.h: revision 1.85
tools/compat/compat_defs.h: revision 1.86
lib/libterminfo/term_private.h: revision 1.10
lib/libterminfo/term.c: revision 1.14
usr.bin/tic/tic.1: revision 1.10
lib/libterminfo/term.c: revision 1.15
lib/libterminfo/Makefile.hash: revision 1.5
lib/libterminfo/term.c: revision 1.16
distrib/amd64/installimage/install.sh: revision 1.2
share/man/man5/rc.conf.5: revision 1.152
distrib/sets/lists/tests/mi: revision 1.472
distrib/amd64/cdroms/Makefile.cdrom: revision 1.7
include/paths.h: revision 1.41
bin/ps/ps.1: revision 1.101
lib/libterminfo/terminfo.5.in: revision 1.16
usr.bin/tic/tic.c: revision 1.20
lib/libterminfo/terminfo.5.in: revision 1.17
Prefer __printflike.
Use queue(3)
Replace linear lookup with hash table, reducing runtime by 60%.
Use e* from util.h.
One more strdup -> estrdup.
Maintain nalias and nterm on the fly.
Add void for ttyslot prototype.
Use memcmp in place of strncmp, since length is known to no longer than
either of the arguments.
Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
Add __predict_true / __predict_false definitions.
Add a special seeder for cdbw_output that gives stable results.
Hook up cdbw(3) for the tool build.
Prototype for cdbw_stable_seeder.
Provide a usable thr_once for !_REENTRANT
Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
Switch terminfo(3) to cdb(5).
Fix typos.
Make Alan Barrett happy and add ().
Add cdbr(3) support to tools/compat.
Bump date for previous.
Relax consistency to make it possible to match valid entries.
Prefix devname's buffer with /dev/ as ttyname is supposed to return the
full path. Reported by Dave Huang.
 1.156.2.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.156.2.1 23-Jun-2013  tls resync from head
 1.173.2.1 10-Aug-2014  tls Rebase.
 1.174.2.2 16-May-2015  snj Pull up following revision(s) (requested by christos in ticket #781):
common/lib/libc/stdlib/strtoi.c: revision 1.2
common/lib/libc/stdlib/strtou.c: revision 1.2
distrib/sets/lists/debug/mi: revision 1.113
distrib/sets/lists/tests/mi: revision 1.617
lib/libc/include/namespace.h: revision 1.178
lib/libc/stdlib/Makefile.inc: revision 1.90 via patch
lib/libc/stdlib/strtoi.3: revisions 1.1, 1.2
lib/libc/stdlib/strtol.3: revision 1.32
lib/libc/stdlib/strtou.3: revisions 1.1, 1.2
lib/libc/stdlib/strtoul.3: revisions 1.30, 1.31
tests/lib/libc/stdlib/Makefile: revision 1.25
tests/lib/libc/stdlib/t_strtoi.c: revision 1.1
- new test for strtoi
- namespace protection for strto{i,u}
- separate manpages for strto{i,u} from the ones for strto{u,}l
From: Kamil Rytarowski
--
Sort ERRORS and SEE ALSO.
--
Sort ERRORS and SEE ALSO.
--
Sort SEE ALSO.
 1.174.2.1 08-Feb-2015  snj Pull up following revision(s) (requested by christos in ticket #472):
lib/libc/include/namespace.h: revision 1.175
lib/libc/sys/Makefile.inc: revision 1.225, 1.227
lib/libc/sys/fdiscard.2: revision 1.3
lib/libc/sys/fdiscard.c: revision 1.1
lib/libc/sys/posix_fallocate.c: revision 1.1
Fix argument paddiing for posix_fallocate and fdiscard with gcc 1.x
--
PR/49617: Kirk Russell: posix_fallocate() should be returning an error on
failure, without setting errno, so make it PSEUDO_NOERROR, by adding a new
category GLUENOERR.
--
PR/49617: Kirk Russell: Describe the posix_fallocate return values correctly.
 1.180.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.180.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.185.2.1 21-Apr-2017  bouyer Sync with HEAD
 1.196.4.2 21-Apr-2020  martin Sync with HEAD
 1.196.4.1 13-Apr-2020  martin Mostly merge changes from HEAD upto 20200411
 1.203.4.1 02-Aug-2025  perseant Sync with HEAD
 1.203.2.1 14-Oct-2024  martin Pull up following revision(s) (requested by riastradh in ticket #976):

lib/libc/locale/c32rtomb.3: revision 1.10
lib/libc/locale/c32rtomb.3: revision 1.9
lib/libc/locale/c32rtomb.3: revision 1.11
tests/lib/libc/locale/t_mbrtoc32.c: revision 1.1
distrib/sets/lists/base/shl.mi: revision 1.988
lib/libc/include/namespace.h: revision 1.204
lib/libc/include/namespace.h: revision 1.205
lib/libc/locale/mbrtoc16.3: revision 1.1
lib/libc/locale/mbrtoc16.c: revision 1.1
lib/libc/locale/mbrtoc16.3: revision 1.2
lib/libc/locale/mbrtoc16.c: revision 1.2
lib/libc/locale/mbrtoc16.3: revision 1.3
lib/libc/locale/mbrtoc16.c: revision 1.3
lib/libc/locale/mbrtoc32.3: revision 1.1
lib/libc/locale/mbrtoc32.c: revision 1.1
tests/lib/libc/locale/t_c16rtomb.c: revision 1.1
lib/libc/locale/mbrtoc32.c: revision 1.2
lib/libc/locale/mbrtoc16.3: revision 1.4
lib/libc/locale/mbrtoc16.c: revision 1.4
lib/libc/locale/mbrtoc32.3: revision 1.2
tests/lib/libc/locale/t_c16rtomb.c: revision 1.2
lib/libc/locale/mbrtoc32.c: revision 1.3
lib/libc/locale/mbrtoc16.3: revision 1.5
lib/libc/locale/mbrtoc16.c: revision 1.5
lib/libc/locale/mbrtoc32.3: revision 1.3
tests/lib/libc/locale/t_c16rtomb.c: revision 1.3
lib/libc/locale/mbrtoc32.c: revision 1.4
lib/libc/locale/mbrtoc16.3: revision 1.6
lib/libc/locale/mbrtoc16.c: revision 1.6
lib/libc/locale/mbrtoc32.3: revision 1.4
tests/lib/libc/locale/t_c16rtomb.c: revision 1.4
lib/libc/locale/mbrtoc32.c: revision 1.5
lib/libc/locale/mbrtoc16.3: revision 1.7
lib/libc/locale/mbrtoc16.c: revision 1.7
lib/libc/locale/mbrtoc32.3: revision 1.5
tests/lib/libc/locale/t_c16rtomb.c: revision 1.5
lib/libc/locale/mbrtoc32.c: revision 1.6
lib/libc/locale/mbrtoc16.3: revision 1.8
lib/libc/locale/mbrtoc32.3: revision 1.6
tests/lib/libc/locale/t_c16rtomb.c: revision 1.6
lib/libc/locale/mbrtoc32.c: revision 1.7
lib/libc/locale/mbrtoc16.3: revision 1.9
lib/libc/locale/mbrtoc32.3: revision 1.7
lib/libc/locale/mbrtoc32.c: revision 1.8
lib/libc/locale/mbrtoc32.3: revision 1.8
lib/libc/locale/mbrtoc32.c: revision 1.9
distrib/sets/lists/comp/mi: revision 1.2468
lib/libc/locale/mbrtoc32.3: revision 1.9
distrib/sets/lists/comp/mi: revision 1.2469
lib/libc/locale/c32rtomb.h: revision 1.1
lib/libc/locale/c32rtomb.h: revision 1.2
include/Makefile: revision 1.147
share/man/man3/uchar.3: revision 1.1
share/man/man3/uchar.3: revision 1.2
tests/lib/libc/locale/t_c32rtomb.c: revision 1.1
distrib/sets/lists/comp/mi: revision 1.2470
lib/libc/locale/c16rtomb.3: revision 1.1
lib/libc/locale/c16rtomb.c: revision 1.1
lib/libc/locale/c16rtomb.3: revision 1.2
lib/libc/locale/c16rtomb.c: revision 1.2
lib/libc/locale/c16rtomb.3: revision 1.3
lib/libc/locale/c16rtomb.c: revision 1.3
lib/libc/locale/c16rtomb.3: revision 1.4
lib/libc/locale/c16rtomb.c: revision 1.4
lib/libc/locale/c16rtomb.3: revision 1.5
lib/libc/locale/c16rtomb.c: revision 1.5
lib/libc/locale/c16rtomb.3: revision 1.6
lib/libc/locale/c16rtomb.c: revision 1.6
lib/libc/locale/c16rtomb.3: revision 1.7
lib/libc/locale/c16rtomb.c: revision 1.7
lib/libc/locale/c16rtomb.3: revision 1.8
lib/libc/locale/c16rtomb.3: revision 1.9
distrib/sets/lists/tests/mi: revision 1.1330
distrib/sets/lists/tests/mi: revision 1.1331
distrib/sets/lists/tests/mi: revision 1.1332
tests/lib/libc/locale/t_uchar.c: revision 1.1
tests/lib/libc/locale/t_uchar.c: revision 1.2
tests/lib/libc/locale/t_uchar.c: revision 1.3
tests/lib/libc/locale/t_mbrtoc16.c: revision 1.1
tests/lib/libc/locale/t_mbrtoc16.c: revision 1.2
tests/lib/libc/locale/t_mbrtoc16.c: revision 1.3
include/uchar.h: revision 1.1
include/uchar.h: revision 1.2
include/uchar.h: revision 1.3
include/uchar.h: revision 1.4
include/uchar.h: revision 1.5
tests/lib/libc/locale/t_c8rtomb.c: revision 1.1
include/uchar.h: revision 1.6
tests/lib/libc/locale/t_c8rtomb.c: revision 1.2
tests/lib/libc/locale/t_c8rtomb.c: revision 1.3
tests/lib/libc/locale/t_c8rtomb.c: revision 1.4
share/man/man3/Makefile: revision 1.93
tests/lib/libc/locale/t_c8rtomb.c: revision 1.5
tests/lib/libc/locale/t_c8rtomb.c: revision 1.6
tests/lib/libc/locale/t_c8rtomb.c: revision 1.7
lib/libc/shlib_version: revision 1.297
lib/libc/locale/c16rtomb.3: revision 1.10
lib/libc/locale/c16rtomb.3: revision 1.11
tests/lib/libc/locale/t_mbrtoc8.c: revision 1.1
tests/lib/libc/locale/t_mbrtoc8.c: revision 1.2
tests/lib/libc/locale/t_mbrtoc8.c: revision 1.3
lib/libc/locale/mbrtoc16.3: revision 1.10
tests/lib/libc/locale/Makefile: revision 1.15
tests/lib/libc/locale/Makefile: revision 1.16
tests/lib/libc/locale/Makefile: revision 1.17
tests/lib/libc/locale/Makefile: revision 1.18
distrib/sets/lists/debug/mi: revision 1.442
distrib/sets/lists/debug/mi: revision 1.443
distrib/sets/lists/debug/mi: revision 1.444
lib/libc/locale/c8rtomb.3: revision 1.1
lib/libc/locale/c8rtomb.c: revision 1.1
lib/libc/locale/c8rtomb.3: revision 1.2
lib/libc/locale/c8rtomb.c: revision 1.2
lib/libc/locale/c8rtomb.3: revision 1.3
lib/libc/locale/c8rtomb.c: revision 1.3
lib/libc/locale/c8rtomb.3: revision 1.4
lib/libc/locale/c8rtomb.c: revision 1.4
lib/libc/locale/c8rtomb.3: revision 1.5
lib/libc/locale/c8rtomb.c: revision 1.5
lib/libc/locale/c8rtomb.3: revision 1.6
lib/libc/locale/c8rtomb.c: revision 1.6
lib/libc/locale/c8rtomb.3: revision 1.7
lib/libc/locale/c8rtomb.3: revision 1.8
lib/libc/locale/c8rtomb.3: revision 1.9
lib/libc/locale/mbrtoc32.h: revision 1.1
lib/libc/locale/mbrtoc32.h: revision 1.2
lib/libc/locale/mbrtoc8.c: revision 1.1
lib/libc/locale/mbrtoc8.3: revision 1.1
lib/libc/locale/mbrtoc8.c: revision 1.2
lib/libc/locale/mbrtoc8.3: revision 1.2
lib/libc/locale/mbrtoc8.c: revision 1.3
lib/libc/locale/mbrtoc8.3: revision 1.3
lib/libc/locale/mbrtoc8.c: revision 1.4
lib/libc/locale/mbrtoc8.3: revision 1.4
lib/libc/locale/Makefile.inc: revision 1.66
lib/libc/locale/mbrtoc8.c: revision 1.5
lib/libc/locale/mbrtoc8.3: revision 1.5
lib/libc/locale/Makefile.inc: revision 1.67
lib/libc/locale/mbrtoc8.c: revision 1.6
lib/libc/locale/mbrtoc8.3: revision 1.6
lib/libc/locale/mbrtoc8.c: revision 1.7
lib/libc/locale/mbrtoc8.3: revision 1.7
lib/libc/locale/mbrtoc8.c: revision 1.8
lib/libc/locale/c32rtomb.3: revision 1.1
lib/libc/locale/c32rtomb.c: revision 1.1
lib/libc/locale/c32rtomb.3: revision 1.2
lib/libc/locale/c32rtomb.c: revision 1.2
lib/libc/locale/c32rtomb.3: revision 1.3
lib/libc/locale/c32rtomb.c: revision 1.3
lib/libc/locale/c32rtomb.3: revision 1.4
lib/libc/locale/c32rtomb.c: revision 1.4
lib/libc/locale/c32rtomb.3: revision 1.5
lib/libc/locale/c32rtomb.c: revision 1.5
lib/libc/locale/c32rtomb.3: revision 1.6
lib/libc/locale/c32rtomb.c: revision 1.6
lib/libc/locale/c32rtomb.3: revision 1.7
lib/libc/locale/c32rtomb.3: revision 1.8

(all via patch)


tests/lib/libc/locale/Makefile: Sort.
No functional change intended.
Preparation for PR lib/52374.

uchar.h: New header file for C11 (and C++11) compliance.

Implementation of the new functions mbrtoc16, c16rtomb, mbrtoc32, and
c32rtomb to come later. Updates for C23 to come later.
PR lib/52374: <uchar.h> missing

libc: New C11 functions mbrtoc16, mbrtoc32, c16rtomb, c32rtomb.

The mbrtoc16/32 functions read mulitbyte strings according to the
current locale into UTF-16/32 code unit sequences; the c16/32rtomb
functions write UTF-16/32 code unit sequences into multibyte strings
according to the current locale. The `r' means restartable: they
work incrementally and pick up where they left off.

NOTE: This bumps the libc minor version, since it adds new symbols.

PR lib/52374: <uchar.h> missing
mbrtoc16(3), mbrtoc32(3): Fix \n in man page examples.
Need to write \en to pacify roff.
PR lib/52374: <uchar.h> missing

c16rtomb(3), c32rtomb(3): Fix more \n in man pages.
Also, tighten an assertion: we left room for a NUL byte at the end.
PR lib/52374: <uchar.h> missing

libc: Use the more idiomatic alignof from stdalign.h.
No functional change intended.
PR lib/52374: <uchar.h> missing

mbrtoc16(3): Simplify surrogate state test.

Turn the finer-grained test into an assertion.
No semantic change intended: we are supposed to control this state,
and we always arrange it this way. (But in principle this could
change the behaviour of buggy programs that violate the mbstate_t
abstraction.)
PR lib/52374: <uchar.h> missing

libc: New functions c8rtomb(3) and mbrtoc8(3).

New in C23, for converting from UTF-8 to locale-dependent multibyte
sequences (c8rtomb) or vice versa (mbrtoc8), along with the new type
char8_t.

Conditional on either:
- _NETBSD_SOURCE
- _ISOC23_SOURCE
- __STDC_VERSION__ >= 202311L
(Riding the libc minor bump from this morning for the UTF-16/UTF-32
versions from C11.)

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb
libc: c32rtomb and mbrtoc32 are used internally, so weak-alias them.
PR lib/52374: <uchar.h> missing
c8rtomb(3), mbrtoc8(3): Use namespace.h to get private aliases.

This way applications defining the symbols c32rtomb or mbrtoc32 won't
clobber our private definitions, which are slightly more constrained
about their use of mbstate_t than is obvious from the interface
contract.

PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb
mbrtoc16(3), mbrtoc32(3): brush up markup

Split long .Fn lines into Fo/Fa/Fc. Dont indent the list of return
values. Don't use artisanal -width.

Untabify code examples - indented literal displays don't have correct
tab stops consistent with tab stops in the fixed font code, so the
lines end up misaligned in the PostScript output.

c16rtomb(3), c32rtomb(3): brush up markup

mbrtoc16(3), mbrtoc32(3): Simplify return value language.
Also expand BMP only once.
PR lib/52374: <uchar.h> missing

mbrtoc16(3), mbrtoc32(3): No state overlap with mbrtoc8 or c8rtomb.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc32(3): Clarify control flow.
No need for another goto here; let's keep it clearly structured with
a single `out' label.
No functional change intended.
PR lib/52374: <uchar.h> missing

c8rtomb(3), mbrtoc8(3): brush up markup

mbrtoc8(3): Simplify return value language.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

c16rtomb(3), c32rtomb(3): Specify what happens if ps is null.
PR lib/52374: <uchar.h> missing

c8rtomb(3): Specify what happens when ps is null.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

c16rtomb(3), c32rtomb(3): No state overlap with mbrtoc8 or c8rtomb.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc16(3), mbrtoc32(3): Work on deturgidifying prose.
Still maybe not great but at least there's less jargon in most of the
text, without really losing any content.
PR lib/52374: <uchar.h> missing

mbrtoc8(3): Work on deturgidifying prose.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc16(3), mbrtoc32(3): Restore word accidentally removed.
PR lib/52374: <uchar.h> missing

mbrtoc8(3): Restore word accidentally removed.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

c8rtomb(3): Fix possible error descriptions.
The argument c8 can't be a surrogate code point itself (they're in
the range [0xd800,0xdfff], beyond 8-bit values), but the bits of a
surrogate code point could be forced into the UTF-8 format, which is
also invalid.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

c16rtomb(3), c32rtomb(3): Attempt a deturgidification pass.
Limit the jargon around surrogates.
PR lib/52374: <uchar.h> missing

c8rtomb(3): Clarify prose and fix example in caveat.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb
c16rtomb(3), c32rtomb(3), mbrtoc16(3), mbrtoc32(3): xref c8 versions.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc16(3): Clarify how many bytes are consumed in special cases.
Fix overlap in RETURN VALUES section.
PR lib/52374: <uchar.h> missing

mbrtoc8(3): Clarify how many bytes are consumed in special cases.
Fix overlap in RETURN VALUES section.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

pass lint, XXX see lint bug.

libc: Add _l variants of the cNrtomb and mbrtocN functions.
These accept an explicit locale parameter, rather than using the
current locale.
Visible under _NETBSD_SOURCE, not exposed otherwise.
NOTE: This adds libc symbols. Riding the libc minor bump for the
non-_l variants of these from two days ago -- hope that's not pushing
it too far.
PR lib/58613: c*rtomb, mbrtoc* should have locale-parametric _l
variants

c8rtomb(3), c16rtomb(3): Add tests for incomplete NUL termination.
PR lib/58615: incomplete c8rtomb, c16rtomb handles NUL termination
wrong

c8rtomb(3), c16rtomb(3): Fix NUL handling.
PR lib/58615: incomplete c8rtomb, c16rtomb handles NUL termination
wrong

c8rtomb(3), c16rtomb(3), c32rtomb(3): Test stateful shift sequences.
PR lib/58612: c8rtomb/c16rtomb/c32rtomb yield suboptimal shift
sequences

c8rtomb(3): Fix digit error in shift sequence test.
PR lib/58612: c8rtomb/c16rtomb/c32rtomb yield suboptimal shift
sequences

c8rtomb(3): Nix __CTASSERT after case label.
I put this in to make it (machine-verifiably) clear that zeroing the
state is the same as returning to the initial conversion state, as
the standard requires, but this is causing build trouble (and will
likely cause more trouble if pulled up) because some definitions of
__CTASSERT make a declaration which is forbidden after a label, so
let's remove it.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc8(3): Fix pasto in comment at top.
No functional change intended.
PR standards/58601: uchar.h C23 compliance: char8_t, mbrtoc8, c8rtomb

mbrtoc8: remove lint-specific workarounds
No binary change.

mbrtoc8: fix comments

mbrtoc16, mbrtoc32: fix comments, remove lint-specific workarounds
No binary change.
t_c8rtomb, t_c16rtomb: Simplify comment.
ESC $ B is technically rather the JIS X 0208-1983 shift sequence, but
since I don't see any way to provoke the JIS X 0208-1978 shift
sequence to come flying out of this conversion (ESC $ @), and I'm not
sure there's any difference in the interpretation, let's just say JIS
X 0208.
PR lib/58612: c8rtomb/c16rtomb/c32rtomb yield suboptimal shift
sequences

c32rtomb(3): Use conversion state to handle shift sequences.
For conversion of Unicode scalar values to coding systems requiring
shift sequences, such as ISO-2022-JP, _citrus_iconv_convert will
always produce:
1. a shift sequence from the initial state to some nondefault state,
like from US-ASCII to JIS X 0208
2. the encoding of the desired characater
3. a shift sequence restoring the initial state
This is unnecessary if the output is already in the state needed to
encoded the desired character. For example, this method produces
seven bytes to encode each YEN SIGN in ISO-2022-JP -- and fourteen,
to encode two consecutive ones -- even though the shift sequence is
only three bytes long and once shifted YEN SIGN takes only one byte.
Instead, convert the Unicode scalar value to a locale-dependent wide
character and encode that, by composing
- _citrus_iconv_convert
=> gives us a multibyte encoding of the character from the initial
state (and restoring the initial state afterward)
- mbrtowc with initial conversion state
=> gives us the single wide character representation
XXX If combining characters are possible here, this may fail.
- wcrtomb with caller's conversion tsate
=> gives us a state-dependent multibyte encoding of the character
XXX Is there a cheaper way to convert from Unicode scalar value to
locale-dependent wide character? It is not obvious to me from the
largely undocumented Citrus machinery, but it would obviously be
better than this somewhat circuitous Rube Goldberg contraption of
chained multibyte APIs.
PR lib/58612: c8rtomb/c16rtomb/c32rtomb yield suboptimal shift
sequences

mbrtoc8(3), mbrtoc16(3): Test consuming shift sequences with state.
This has the side effect of testing mbrtoc32(3) because they are both
defined in terms of it.
PR lib/58618: mbrtocN(3) fails to keep shift state

c8rtomb(3), c16rtomb(3), c32rtomb(3): Suggest MB_LEN_MAX in example.
This way it avoids variable-length arrays, by always allocating the
maximum space that could be occupied by MB_CUR_MAX.

mbrtoc32(3): Use conversion state to handle shift sequences.
PR lib/58618: mbrtocN(3) fails to keep shift state

mbrtoc32(3): Fix name and type of mbrtowc_l return value.
This was from `int mbtowc_l(...)' in an earlier draft and I didn't
update it to size_t when I changed the draft to mbrtowc_l. Caught by
lint.
`mb_len' avoids (harmless) clash with standard C function mblen(3).
PR lib/58618: mbrtocN(3) fails to keep shift state

c32rtomb(3): Fix type of wcrtomb_l return value.
This was from `int wctomb_l(...)' in an earlier draft and I didn't
update it to size_t when I changed the draft to wcrtomb_l. Caught by
lint.
`wc_len' mirrors `mb_len' in the complementary code in mbrtoc32(3) to
avoid clash with standard C function mblen(3).
PR lib/58612: c8rtomb/c16rtomb/c32rtomb yield suboptimal shift
sequences

c8rtomb(3), c16rtomb(3), c32rtomb(3): Attempt to simplify language.

c8rtomb(3), c16rtomb(3), c32rtomb(3): Fix null string output case.
This ignores c8/c16/c32, produces no output anywhere, and just resets
ps to the initial conversion state.
Also just use 0 in the example, not '\0' or L'\0'. This works for
C11, which prefers '\0' and L'\0', for and C23, which introduced the
new u8'\0', u'\0' (UTF-16), and U'\0' (UTF-32).
c16rtomb, c32rtomb, mbrtoc8: fix page numbers in comments
mbrtoc8(3), mbrtoc16(3), mbrtoc32(3): Say 0 for zero code unit.
Rather than deal with differences between C11 and C23 in notation,
'\0' vs L'\0' vs u8'\0' vs u'\0' vs U'\0'.
uchar.h: Include <sys/featuretest.h> before testing _*_SOURCE.
PR lib/58752: various header files test _*_SOURCE macros but don't
include sys/featuretest.h
PR lib/52374: <uchar.h> missing

uchar.h: Need <sys/cdefs.h> for __restrict.
PR lib/52374: <uchar.h> missing

uchar.h: Simplify __cpp_char8_t and __cplusplus conditionals.
No functional change intended.
PR lib/52374: <uchar.h> missing

tests/lib/libc/locale/t_uchar: Test for char8_t, mbrtoc8, c8rtomb.
PR lib/58752: various header files test _*_SOURCE macros but don't
include sys/featuretest.h
PR lib/52374: <uchar.h> missing

tests/t_uchar: fix copy-and-paste typo
 1.6 29-May-2008  mrg branches: 1.6.6;
remove clause #3 from my license where there are no other
copyright holders involved.
 1.5 20-Aug-2004  dogcow branches: 1.5.24; 1.5.26;
insert a missing quotation mark.
 1.4 19-Aug-2004  christos Deal with RESCUEDIR
 1.3 10-Oct-1997  mrg remove advertising clause from all my licenses.
 1.2 26-May-1997  mrg allow rcmd() to use something other than rsh protocol.
 1.1 16-Feb-1997  mrg branches: 1.1.2;
file pathnames.h was initially added on branch mrg-rcmd.
 1.1.2.1 16-Feb-1997  mrg path for /bin/rcmd.
 1.5.26.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.5.24.1 04-Jun-2008  yamt sync with head
 1.6.6.2 29-May-2008  mrg remove clause #3 from my license where there are no other
copyright holders involved.
 1.6.6.1 29-May-2008  mrg file pathnames.h was added on branch christos-time_t on 2008-05-29 14:51:26 +0000
 1.1 20-May-2004  christos Add headers that ISC software [bind9] needs to include
 1.4 20-Mar-2014  christos CID 273814, don't confuse coverity.
 1.3 17-Mar-2005  kleink branches: 1.3.44; 1.3.50;
We have pselect(2) now; the local wrapper is no longer necessary.
 1.2 09-Feb-2005  kleink A little libc namespace housekeeping exercise:
* Make vfprintf_unlocked() an internal function, c.f. __svfscanf_unlocked().
* Add internal names for arc4random(), endnetpath(), fhstatvfs(),
fstatvfs(), mkstemp(), shquote(), statvfs(), taddr2uaddr(), uaddr2taddr(),
uuid_create_nil(), uuid_is_nil(), and wcwidth().
* Include namespace.h where supposed to.
 1.1 20-May-2004  christos Add headers that ISC software [bind9] needs to include
 1.3.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.44.1 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.24 06-Oct-2025  riastradh libc: Expose some more pthread stubs.

Additionally, provide the option for pthread.h to expose
pthread_create so that libc can provide a weak stub for it, if you
define _NETBSD_PTHREAD_CREATE_WEAK.

This allows libraries to use the functions without linking against
libpthread for applications that don't need threads. For example,
with OpenSSL's libcrypto, as long as you don't try to raise
OSSL_set_max_threads above 0, it won't ever try pthread_create.

New pthread.h macros defined:

pthread_attr_destroy __libc_thr_attr_destroy
pthread_attr_init __libc_thr_attr_init
pthread_attr_setdetachstate __libc_thr_attr_setdetachstate
pthread_detach __libc_thr_detach
pthread_join __libc_thr_join

New pthread.h macros defined if _NETBSD_PTHREAD_CREATE_WEAK is
defined first:

pthread_create __libc_thr_create

New symbols defined by libc as weak aliases for stubs that always
fail but can be overridden by libpthread:

__libc_thr_attr_destroy
__libc_thr_attr_init
__libc_thr_attr_setdetachstate
__libc_thr_detach
__libc_thr_join

Note that libc already defined __libc_thr_create.

New internal stubs, not for overriding:

__libc_thr_detach_stub
__libc_thr_join_stub

These were formerly called __libc_pthread_detach and
__libc_pthread_join, respectively, and libc has defined weak aliases
pthread_detach and pthread_join for them since 2013. I retained all
four of those symbols, but defined new ones in the __ namespace that
match the pattern for other thread stubs to avoid raising questions
about why the pattern seems to be broken. I left a comment noting
this fact too.

New pthread strong aliases to override the libc symbols:

__libc_thr_attr_destroy
__libc_thr_attr_init
__libc_thr_attr_setdetachstate
__libc_thr_detach
__libc_thr_join

Note that pthread already defined a strong __libc_thr_create alias
for the real pthread_create, so there is no need to add a new one.

PR lib/59685: libcrypto should not depend on libpthread
 1.23 03-Feb-2025  andvar fix various typos in comments.
 1.22 27-Aug-2024  riastradh arc4random(3): Add automatic tests.

This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail

NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.

PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
 1.21 08-Dec-2021  andvar branches: 1.21.2; 1.21.4;
s/efficent/efficient/ in comments.
 1.20 08-Feb-2017  christos empty to nothing
 1.19 08-Feb-2017  christos __empty is defined in <sys/cdefs.h>
 1.18 20-Jan-2015  christos branches: 1.18.2; 1.18.4;
Fix non _REENTRANT build.
 1.17 12-Apr-2013  joerg Mark __libc_thr_exit_stub as dead.
 1.16 21-Mar-2013  christos - Allow libpthread to be dlopened again, by providing libc stubs to libpthread.
- Fail if the dlopened libpthread does pthread_create(). From manu@
- Discussed at length in the mailing lists; approved by core@
- This was chosen as the least intrusive patch that will provide
the necessary functionality.
XXX: pullup to 6
 1.15 03-Jun-2012  joerg branches: 1.15.2;
Provide a usable thr_once for !_REENTRANT
 1.14 11-Jan-2009  christos branches: 1.14.8; 1.14.10;
merge christos-time_t
 1.13 28-Apr-2008  martin branches: 1.13.8;
Remove clause 3 and 4 from TNF licenses
 1.12 04-Feb-2008  rtr branches: 1.12.4;
fix comment Abtract -> Abstract
 1.11 27-Nov-2007  ad Add thr_curcpu(), pthread_curcpu_np().
 1.10 14-Dec-2004  nathanw branches: 1.10.16;
Nuke threadlib.h. Library defensive threading is now provided through the
normal pthread.h interface.
Move stubs for libc back into a libc-internal header.
 1.9 18-Jul-2003  nathanw Adapt definition of FLOCKFILE()/FUNLOCKFILE() to new __flockfile_internal()
routines.
 1.8 19-Jan-2003  thorpej Use <threadlib.h>.
 1.7 18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.6 02-Jun-2000  fvdl branches: 1.6.4;
Add new RPC code, based on Sun's TI-RPC code. Adapted to not use XTI,
but sockets instead, internally. Old, backward compatible interfaces
maintained.
 1.5 14-Sep-1998  kleink branches: 1.5.8;
Add wrappers around mutex and rwlock run-time initialization.
 1.4 27-Jul-1998  mycroft Delint.
 1.3 22-Jan-1998  jtc Add support for multiple reader-single writer locks which will be used
in stdio. Although there is no POSIX.1 lock of this type, XPG 4.2 has
specified one that is suitable for our purposes and that we'll have to
implement anyway.
 1.2 19-Jan-1998  jtc Add FLOCKFILE() and FUNLOCKFILE() macro definitions to be used in
making stdio thread-safe.
 1.1 16-Jan-1998  jtc Header file which describes mechanism that will be used by libc for
thread safety of library internals.
 1.5.8.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.6.4.9 14-Jan-2003  thorpej Explicitly include <signal.h>.
 1.6.4.8 08-Jan-2003  nathanw Oh, duh, and use real rwlocks, too.

(And to think that I just got new glasses)
 1.6.4.7 08-Jan-2003  nathanw Now that we're using real rwlocks instead of mutexes, use
PTHREAD_RWLOCK_INITIALIZER instead of PTHREAD_MUTEX_INITIALIZER.
 1.6.4.6 08-Jan-2003  thorpej Rewrite the way libpthread provides thread primitives to libc, using
strong and weak aliases (the way cancelation points are handled).

Work around lame Unix static library semantics which could cause
the wrong thread primitives or cancelation point functions to be
included in a statically-linked program.

THIS IS AN ABI CHANGE. People running the nathanw_sa branch should
ensure that their libc and libpthread are in sync after updating.
 1.6.4.5 02-May-2002  nathanw Adapt to new dispatch-vector thread interface.
 1.6.4.4 25-Mar-2002  nathanw Bind libc's pthread desires to _libc_pthread_*, rather than pthread_*, to
prevent accidental use of pthread libraries that aren't actually integrated
with libc.
 1.6.4.3 06-Feb-2002  nathanw Add a COND_INITIALIZER and a thr_t definition.

Shuffle the arguments of the cond_init() macro to make a little more sense.
 1.6.4.2 30-Dec-2001  nathanw Define thr_errno() to be pthread__errno() when _REENTRANT is defined.
(This entire layer of #defines is silly.)
 1.6.4.1 08-Aug-2001  nathanw _REENT -> _REENTRANT
Add wrappers for pthread_once and friends.
Use mutexes as the poor man's rwlocks for the moment.
 1.10.16.2 23-Mar-2008  matt sync with HEAD
 1.10.16.1 09-Jan-2008  matt sync with HEAD
 1.12.4.1 18-May-2008  yamt sync with head.
 1.13.8.2 05-Jan-2009  christos don't expose __libc_cond_timedwait in compat code.
 1.13.8.1 28-Apr-2008  christos file reentrant.h was added on branch christos-time_t on 2009-01-05 01:53:48 +0000
 1.14.10.2 29-Apr-2013  riz Pull up following revision(s) (requested by manu in ticket #869):
lib/libpthread/pthread_rwlock.c: revision 1.33
lib/libc/include/reentrant.h: revision 1.16
lib/libpthread/pthread_cond.c: revision 1.59
lib/libpthread/pthread_misc.c: revision 1.15
lib/libc/thread-stub/thread-stub.c: revision 1.23
lib/libpthread/pthread_cancelstub.c: revision 1.38
lib/libpthread/pthread_specific.c: revision 1.26
lib/libpthread/pthread_mutex.c: revision 1.56
lib/libpthread/pthread_tsd.c: revision 1.11
lib/libpthread/Makefile: revision 1.80
lib/libpthread/pthread.c: revision 1.143
lib/libpthread/pthread_int.h: revision 1.89
- Allow libpthread to be dlopened again, by providing libc stubs to
libpthread.
- Fail if the dlopened libpthread does pthread_create(). From manu@
- Discussed at length in the mailing lists; approved by core@
- This was chosen as the least intrusive patch that will provide
the necessary functionality.
XXX: pullup to 6
 1.14.10.1 23-Jun-2012  riz Pull up following revision(s) (requested by joerg in ticket #328):
lib/libc/gen/devname.c: revision 1.22
distrib/sparc64/instfs/dot.profile: revision 1.7
distrib/i386/cdroms/install.sh: revision 1.3
tests/lib/libcurses/director/director.c: revision 1.10
lib/libc/include/reentrant.h: revision 1.15
distrib/amd64/cdroms/install.sh: revision 1.3
tests/include/t_paths.c: revision 1.12
share/man/man7/hier.7: revision 1.101
etc/rc.d/sysdb: revision 1.24
include/stdlib.h: revision 1.99
tests/lib/libcurses/Makefile: revision 1.3
distrib/sparc64/cdroms/installcd/install.sh: revision 1.3
distrib/i386/cdroms/Makefile.cdrom: revision 1.27
lib/libc/gen/ttyname.c: revision 1.25
usr.bin/tic/Makefile: revision 1.2
tools/compat/Makefile: revision 1.57
lib/libterminfo/compile.c: revision 1.7
lib/libc/gen/ttyname.c: revision 1.26
lib/libterminfo/compile.c: revision 1.8
tools/compat/Makefile: revision 1.59
tools/compat/cdbw.h: revision 1.1
distrib/i386/installimage/install.sh: revision 1.2
lib/libc/include/namespace.h: revision 1.154
usr.bin/tic/tic.c: revision 1.13
usr.bin/tic/tic.c: revision 1.14
usr.bin/tic/tic.c: revision 1.15
distrib/sets/lists/base/mi: revision 1.996
usr.bin/tic/tic.c: revision 1.16
usr.sbin/dev_mkdb/dev_mkdb.8: revision 1.13
usr.bin/tic/tic.c: revision 1.17
usr.bin/tic/tic.c: revision 1.18
tools/compat/cdbr.h: revision 1.1
distrib/sparc64/instfs/list: revision 1.25
usr.bin/tic/tic.c: revision 1.19
lib/libc/cdb/cdbw.c: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.4
lib/libc/cdb/cdbw.3: revision 1.5
share/terminfo/Makefile: revision 1.3
usr.sbin/dev_mkdb/dev_mkdb.c: revision 1.29
usr.sbin/dev_mkdb/Makefile: revision 1.8
lib/libc/gen/ttyname.3: revision 1.23
lib/libc/gen/ttyname.3: revision 1.24
lib/libc/cdb/cdbr.c: revision 1.3
include/cdbw.h: revision 1.2
distrib/sparc64/cdroms/installcd/Makefile: revision 1.15
lib/libc/gen/devname.3: revision 1.12
tools/compat/compat_defs.h: revision 1.85
tools/compat/compat_defs.h: revision 1.86
lib/libterminfo/term_private.h: revision 1.10
lib/libterminfo/term.c: revision 1.14
usr.bin/tic/tic.1: revision 1.10
lib/libterminfo/term.c: revision 1.15
lib/libterminfo/Makefile.hash: revision 1.5
lib/libterminfo/term.c: revision 1.16
distrib/amd64/installimage/install.sh: revision 1.2
share/man/man5/rc.conf.5: revision 1.152
distrib/sets/lists/tests/mi: revision 1.472
distrib/amd64/cdroms/Makefile.cdrom: revision 1.7
include/paths.h: revision 1.41
bin/ps/ps.1: revision 1.101
lib/libterminfo/terminfo.5.in: revision 1.16
usr.bin/tic/tic.c: revision 1.20
lib/libterminfo/terminfo.5.in: revision 1.17
Prefer __printflike.
Use queue(3)
Replace linear lookup with hash table, reducing runtime by 60%.
Use e* from util.h.
One more strdup -> estrdup.
Maintain nalias and nterm on the fly.
Add void for ttyslot prototype.
Use memcmp in place of strncmp, since length is known to no longer than
either of the arguments.
Fix a number of memory leaks. Keep final loop of the cleanup in tic(1)
under #ifdef __VALGRIND__ though.
Add __predict_true / __predict_false definitions.
Add a special seeder for cdbw_output that gives stable results.
Hook up cdbw(3) for the tool build.
Prototype for cdbw_stable_seeder.
Provide a usable thr_once for !_REENTRANT
Switch device database to cdb(5). Rework ttyname(3) and ttyname_r(3) to
depend on new devname_r(3) as heart. Add /dev/pts magic directly to
devname(3). While it can lead to returning non-existing paths, the
behavior is more consistent that way. Drop caching layer in devname(3),
it doesn't buy anything for the common case of having access to the
database. Teach devname(3) proper fallback behavior of scanning /dev.
Create both old-style and new-style database for now in /etc/rc.d/sysdb.
Switch terminfo(3) to cdb(5).
Fix typos.
Make Alan Barrett happy and add ().
Add cdbr(3) support to tools/compat.
Bump date for previous.
Relax consistency to make it possible to match valid entries.
Prefix devname's buffer with /dev/ as ttyname is supposed to return the
full path. Reported by Dave Huang.
 1.14.8.2 22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.14.8.1 30-Oct-2012  yamt sync with head
 1.15.2.1 23-Jun-2013  tls resync from head
 1.18.4.1 21-Apr-2017  bouyer Sync with HEAD
 1.18.2.1 20-Mar-2017  pgoyette Sync with HEAD
 1.21.4.1 02-Aug-2025  perseant Sync with HEAD
 1.21.2.1 09-Oct-2024  martin Pull up following revision(s) (requested by riastradh in ticket #939):

distrib/sets/lists/debug/module.md.amd64: revision 1.18
sys/modules/Makefile: revision 1.292
lib/libc/gen/arc4random.c: revision 1.34
lib/libc/gen/arc4random.c: revision 1.35
lib/libc/gen/arc4random.c: revision 1.36
lib/libc/gen/arc4random.c: revision 1.37
sys/kern/kern_entropy.c: revision 1.70
lib/libc/gen/arc4random.c: revision 1.38
sys/kern/kern_entropy.c: revision 1.71
lib/libc/gen/getentropy.3: revision 1.8
distrib/sets/lists/modules/md.amd64: revision 1.103
share/man/man4/rnd.4: revision 1.42
share/man/man4/rnd.4: revision 1.44
lib/libc/include/arc4random.h: revision 1.1
distrib/sets/lists/man/mi: revision 1.1786
sys/arch/i386/conf/GENERIC: revision 1.1258
sys/modules/acpivmgenid/acpivmgenid.ioconf: revision 1.1
sys/arch/amd64/conf/ALL: revision 1.190
distrib/sets/lists/debug/mi: revision 1.446
sys/arch/i386/conf/ALL: revision 1.521
lib/libc/gen/Makefile.inc: revision 1.219
distrib/sets/lists/debug/module.md.i386: revision 1.12
sys/dev/acpi/acpi_vmgenid.c: revision 1.1
sys/dev/acpi/acpi_vmgenid.c: revision 1.2
lib/libc/include/reentrant.h: revision 1.22
sys/arch/evbarm/conf/GENERIC64: revision 1.219
share/man/man4/Makefile: revision 1.735
distrib/sets/lists/modules/md.i386: revision 1.100
distrib/sets/lists/tests/mi: revision 1.1334
lib/libc/gen/arc4random.3: revision 1.22
sys/dev/acpi/files.acpi: revision 1.133
lib/libc/gen/arc4random.3: revision 1.23
tests/lib/libc/gen/t_arc4random.c: revision 1.1
sys/sys/entropy.h: revision 1.6
sys/arch/amd64/conf/GENERIC: revision 1.614
sys/modules/acpivmgenid/Makefile: revision 1.1
share/man/man4/acpivmgenid.4: revision 1.1
lib/libc/gen/Makefile.inc: revision 1.220
tests/lib/libc/gen/Makefile: revision 1.56
share/man/man4/acpivmgenid.4: revision 1.2
share/man/man4/acpivmgenid.4: revision 1.3

(all via patch)

Catch up with all the lint warnings since exit on warning was disabled.

Disable 'missing header declaration' and 'nested extern' warnings for now.
acpivmgenid(4): New driver for virtual machine generation ID.

Added to amd64/ALL and i386/ALL kernel configurations, and made
available as a loadable module acpivmgenid.kmod on x86, for now.
TBD: Add to all ACPI-supporting GENERIC kernels.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

entropy(9): Factor out subroutines to reset and gather entropy.
`Reset' means we keep the data in the pool, but assume it had zero
entropy. `Gather' means we request samples from all on-demand
sources and wait for the synchronous ones to complete.

No functional change intended, other than to expose new symbols --
just preparation to expose these to acpivmgenid(4), so it can use
these when the VM host notifies us that we, the guest, have been
cloned.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

acpivmgenid(4): Reset and gather entropy on VM clone notification.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Reseed if system entropy epoch changes.
This can happen, for example, if the system is a VM instance, and the
VM is cloned.

This incurs the cost of a system call on every arc4random call, which
is unfortunate, but
1. we don't currently have a (machine-independent) mechanism for
exposing a read-only page to userland shared by the kernel to
enable a cheaper access path to the entropy epoch; and
2. the algorithm here -- a simple application of ChaCha -- is likely
also a bottleneck and could be much cheaper by
(a) using sys/crypto/chacha for machine-dependent vectorized
ChaCha code, and
(b) filling a buffer (somewhere between a cipher block and a page)
in a batch at a time, instead of running ChaCha to generate
only 32 bytes at a time.
So although this might be a performance hit, the security benefit is
worthwhile and we have a clear path to do better than reversing the
performance hit later.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

acpivmgenid(4): Nix BUGS that have been squashed.
Reference kern.entropy.epoch for the remaining bug (which is a
performance issue, not a security issue).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

entropy(9): Allow unprivileged reads of sysctl kern.entropy.epoch.

Applications need this in order to know when to reseed. (We should
also expose it through a page shared read-only with userland for
cheaper access, but until we do, let's let applications get at it
through sysctl.)
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random.c: Fix test program.

This isn't wired up anywhere, but let's reduce the bitrot. It was
helpful in reminding me that kern.entropy.epoch was, for reasons I
can't remember, restricted to privileged access.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

amd64, evbarm, i386: Add acpivmgenid(4) to GENERIC.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

rnd(4): Document kern.entropy.epoch is unprivileged and elaborate.
Cross-reference acpivmgenid(4).
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Note that arc4random respects kern.entropy.epoch.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork
Add debug info for new acpivmgenid module

arc4random(3): Add automatic tests.

This verifies that:
- arc4random zeroes its state and reseeds itself on fork
- arc4random reseeds itself on entropy consolidation (e.g., VM clone)
- arc4random falls back to global state if it can't allocate local
state because address space limits cause mmap to fail

NOTE: This adds a new libc symbol __arc4random_global, but it's in
the reserved namespace and only used by t_arc4random, so no libc
minor bump.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

getentropy(3): Note intent to reseed on VM clone, and caveats.

Tidy markup and pacify some mandoc -Tlint complaints while here.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

Bump dates on man pages recently updated to mention VM clones.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random(3): Pacify some of lint's complaints.
PR kern/58632: getentropy(2) and arc4random(3) do not reseed on VM
fork

arc4random: suppress another lint warning
 1.1 27-Jan-2007  christos branches: 1.1.1;
Initial revision
 1.1.1.3 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.2 30-Mar-2007  ghen branches: 1.1.1.2.2; 1.1.1.2.4; 1.1.1.2.22; 1.1.1.2.26; 1.1.1.2.28; 1.1.1.2.32;
Import bind 9.4.0.
 1.1.1.1 27-Jan-2007  christos add resolv_mt.h
 1.1.1.2.32.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.2.28.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.2.26.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.2.22.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.2.4.2 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.2.4.1 30-Mar-2007  wrstuden file resolv_mt.h was added on branch wrstuden-fixsa on 2007-06-03 17:25:52 +0000
 1.1.1.2.2.3 17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.2.2.2 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.1.1.2.2.1 30-Mar-2007  jdc file resolv_mt.h was added on branch netbsd-4 on 2007-05-17 00:43:47 +0000
 1.1 05-Mar-2019  christos branches: 1.1.2;
Transfer all the keys that were created in the libc stub implementation
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.
 1.1.2.2 10-Jun-2019  christos Sync with HEAD
 1.1.2.1 05-Mar-2019  christos file tsd.h was added on branch phil-wifi on 2019-06-10 22:05:20 +0000
 1.5 12-Apr-2009  christos merge libbind and bump.
 1.4 13-Feb-2009  lukem avoid lint's whining on i386
 1.3 12-Feb-2009  uebayasi Enable assertions only when _DIAGNOSTICS is defined, as other libc parts do.
 1.2 21-Jun-2008  christos branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10; 1.2.14;
updates from bind-9-5-0
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen branches: 1.1.1.3.12;
Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos branches: 1.1.1.1.10; 1.1.1.1.12;
import isc specific header files.
 1.1.1.3.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.1.1.1.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.1.10.3 23-Jan-2011  bouyer Apply patch, requested by spz in ticket 1413:
dist/bind/ patch
include/resolv.h patch
include/arpa/nameser.h: patch
lib/libc/include/isc/assertions.h: patch
lib/libc/include/isc/eventlib.h patch
lib/libc/isc/assertions.c: patch
lib/libc/nameser/ns_parse.c patch
lib/libc/resolv/herror.c: patch
lib/libc/resolv/res_init.c patch
lib/libc/resolv/res_mkquery.c: patch
lib/libc/resolv/res_query.c patch
lib/libc/resolv/res_send.c: patch
usr.sbin/bind/Makefile.inc patch
usr.sbin/bind/include/config.h: patch
usr.sbin/bind/include/dns/code.h: patch
usr.sbin/bind/include/dns/enumclass.h: patch
usr.sbin/bind/include/dns/enumtype.h: patch
usr.sbin/bind/include/dns/rdatastruct.h: patch
usr.sbin/bind/include/isc/platform.h: patch
usr.sbin/bind/include/lwres/netdb.h: patch
usr.sbin/bind/include/lwres/platform.h: patch
usr.sbin/bind/libisc/Makefile: patch
lib/libc/inet/inet_addr.c new file

Update bind to 9.4-ESV-R4, latest version of the 9.4 line.
 1.1.1.1.10.2 17-May-2007  jdc branches: 1.1.1.1.10.2.2;
Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.1.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.1.1.1.10.2.2.1 23-Jan-2011  bouyer Apply patch, requested by spz in ticket 1413:
dist/bind/ patch
include/resolv.h patch
include/arpa/nameser.h: patch
lib/libc/include/isc/assertions.h: patch
lib/libc/include/isc/eventlib.h patch
lib/libc/isc/assertions.c: patch
lib/libc/nameser/ns_parse.c patch
lib/libc/resolv/herror.c: patch
lib/libc/resolv/res_init.c patch
lib/libc/resolv/res_mkquery.c: patch
lib/libc/resolv/res_query.c patch
lib/libc/resolv/res_send.c: patch
usr.sbin/bind/Makefile.inc patch
usr.sbin/bind/include/config.h: patch
usr.sbin/bind/include/dns/code.h: patch
usr.sbin/bind/include/dns/enumclass.h: patch
usr.sbin/bind/include/dns/enumtype.h: patch
usr.sbin/bind/include/dns/rdatastruct.h: patch
usr.sbin/bind/include/isc/platform.h: patch
usr.sbin/bind/include/lwres/netdb.h: patch
usr.sbin/bind/include/lwres/platform.h: patch
usr.sbin/bind/libisc/Makefile: patch
lib/libc/inet/inet_addr.c new file

Update bind to 9.4-ESV-R4, latest version of the 9.4 line.
 1.2.14.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.2.10.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.2.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.2 21-Jun-2008  christos updates from bind-9-5-0
 1.2.6.1 21-Jun-2008  christos file assertions.h was added on branch christos-time_t on 2008-06-21 20:41:49 +0000
 1.2.4.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.2 03-Aug-2014  wiz defintion -> definition
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos branches: 1.1.1.4.12; 1.1.1.4.22;
libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen branches: 1.1.1.3.18; 1.1.1.3.22; 1.1.1.3.24; 1.1.1.3.28;
Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos branches: 1.1.1.1.10; 1.1.1.1.12;
import isc specific header files.
 1.1.1.4.22.1 10-Aug-2014  tls Rebase.
 1.1.1.4.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.1.3.28.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.24.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.22.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.3.18.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.1.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.1.10.2 17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.1.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.3 12-Apr-2009  christos merge libbind and bump.
 1.2 21-Jun-2008  christos branches: 1.2.4; 1.2.6; 1.2.8; 1.2.10; 1.2.14;
updates from bind-9-5-0
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen branches: 1.1.1.3.12;
Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos branches: 1.1.1.1.10; 1.1.1.1.12;
import isc specific header files.
 1.1.1.3.12.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.1.1.1.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.1.10.3 23-Jan-2011  bouyer Apply patch, requested by spz in ticket 1413:
dist/bind/ patch
include/resolv.h patch
include/arpa/nameser.h: patch
lib/libc/include/isc/assertions.h: patch
lib/libc/include/isc/eventlib.h patch
lib/libc/isc/assertions.c: patch
lib/libc/nameser/ns_parse.c patch
lib/libc/resolv/herror.c: patch
lib/libc/resolv/res_init.c patch
lib/libc/resolv/res_mkquery.c: patch
lib/libc/resolv/res_query.c patch
lib/libc/resolv/res_send.c: patch
usr.sbin/bind/Makefile.inc patch
usr.sbin/bind/include/config.h: patch
usr.sbin/bind/include/dns/code.h: patch
usr.sbin/bind/include/dns/enumclass.h: patch
usr.sbin/bind/include/dns/enumtype.h: patch
usr.sbin/bind/include/dns/rdatastruct.h: patch
usr.sbin/bind/include/isc/platform.h: patch
usr.sbin/bind/include/lwres/netdb.h: patch
usr.sbin/bind/include/lwres/platform.h: patch
usr.sbin/bind/libisc/Makefile: patch
lib/libc/inet/inet_addr.c new file

Update bind to 9.4-ESV-R4, latest version of the 9.4 line.
 1.1.1.1.10.2 17-May-2007  jdc branches: 1.1.1.1.10.2.2;
Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.1.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.1.1.1.10.2.2.1 23-Jan-2011  bouyer Apply patch, requested by spz in ticket 1413:
dist/bind/ patch
include/resolv.h patch
include/arpa/nameser.h: patch
lib/libc/include/isc/assertions.h: patch
lib/libc/include/isc/eventlib.h patch
lib/libc/isc/assertions.c: patch
lib/libc/nameser/ns_parse.c patch
lib/libc/resolv/herror.c: patch
lib/libc/resolv/res_init.c patch
lib/libc/resolv/res_mkquery.c: patch
lib/libc/resolv/res_query.c patch
lib/libc/resolv/res_send.c: patch
usr.sbin/bind/Makefile.inc patch
usr.sbin/bind/include/config.h: patch
usr.sbin/bind/include/dns/code.h: patch
usr.sbin/bind/include/dns/enumclass.h: patch
usr.sbin/bind/include/dns/enumtype.h: patch
usr.sbin/bind/include/dns/rdatastruct.h: patch
usr.sbin/bind/include/isc/platform.h: patch
usr.sbin/bind/include/lwres/netdb.h: patch
usr.sbin/bind/include/lwres/platform.h: patch
usr.sbin/bind/libisc/Makefile: patch
lib/libc/inet/inet_addr.c new file

Update bind to 9.4-ESV-R4, latest version of the 9.4 line.
 1.2.14.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.2.10.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.2.8.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.2.6.2 21-Jun-2008  christos updates from bind-9-5-0
 1.2.6.1 21-Jun-2008  christos file eventlib.h was added on branch christos-time_t on 2008-06-21 20:41:49 +0000
 1.2.4.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen branches: 1.1.1.3.18; 1.1.1.3.22; 1.1.1.3.24; 1.1.1.3.28;
Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos branches: 1.1.1.1.10; 1.1.1.1.12;
import isc specific header files.
 1.1.1.3.28.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.24.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.22.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.3.18.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.1.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.1.10.2 17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.1.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.6 19-Apr-2022  rillig lib: remove CONSTCOND comment

Since 2021-01-31, lint doesn't need it anymore for the common pattern of
'do ... while (0)'.
 1.5 12-Apr-2009  christos merge libbind and bump.
 1.4 30-Mar-2007  ghen branches: 1.4.18; 1.4.22; 1.4.24; 1.4.28;
Resolve conflicts.
 1.3 27-Jan-2007  christos merge in resolver portion of bind-9.4.0-rc2
 1.2 20-May-2004  christos branches: 1.2.10; 1.2.12;
de-lint
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos import isc specific header files.
 1.2.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.2.10.2 17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.2.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.
 1.4.28.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.4.24.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.4.22.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.4.18.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1 20-May-2004  christos branches: 1.1.1;
Initial revision
 1.1.1.4 12-Apr-2009  christos libc portion of libbind from external/bsd/libbind
 1.1.1.3 30-Mar-2007  ghen branches: 1.1.1.3.18; 1.1.1.3.22; 1.1.1.3.24; 1.1.1.3.28;
Import bind 9.4.0.
 1.1.1.2 27-Jan-2007  christos import resolver portion of bind-9.4.0-rc2
 1.1.1.1 20-May-2004  christos branches: 1.1.1.1.10; 1.1.1.1.12;
import isc specific header files.
 1.1.1.3.28.1 09-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.24.1 10-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.3.22.1 13-May-2009  jym Sync with HEAD.

Third (and last) commit. See http://mail-index.netbsd.org/source-changes/2009/05/13/msg221222.html
 1.1.1.3.18.1 06-Jan-2011  riz Apply patches (requested by spz in ticket #1517):

Update bind to 9.7.2-P3.
 1.1.1.1.12.1 03-Jun-2007  wrstuden Catch up with now-somewhat-dated netbsd-4. These changes took longer
than expected for me to actually get around to merging.
 1.1.1.1.10.2 17-May-2007  jdc Add missing BIND 9.4.x include file and library changes (requested by
tron in ticket #662).
 1.1.1.1.10.1 17-May-2007  jdc Update BIND to version 9.4.1 (requested by christos in ticket #602).
Thanks to tron for the patches, upgrade script and testing.

RSS XML Feed