Home | History | Annotate | Download | only in include
History log of /src/include/Makefile
RevisionDateAuthorComments
 1.149  08-Oct-2024  christos PR/58729: Taylor R Campbell: container_of is not documented or available
in userland
 1.148  25-Aug-2024  christos PR/58640: Riastradh: Provide sys/stdalign.h
 1.147  15-Aug-2024  riastradh 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
 1.146  04-Jun-2019  hannken branches: 1.146.10; 1.146.12;
Move the basic part of XDR to common/include/rpc and common/lib/libc/rpc.

No functional change intended.
 1.145  24-Apr-2019  roy Don't install YP headers when MKYP=no
 1.144  16-Oct-2017  maya branches: 1.144.4;
Add endian.h header. Simply includes sys/endian.h

<endian.h> has been accepted by the austin group.
 1.143  02-Oct-2016  kamil branches: 1.143.6;
Import <stdalign.h>

This header conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.15 Alignment <stdalign.h>

According to ISO/IEC 9899:201x (draft) 7.15 Alignment <stdalign.h> defines
four macros:
- alignas which expands to _Alignas
- alignof which expands to _Alignof
- __alignas_is_defined and __alignof_is_defined which both expand to 1

The _Alignas declaration appears as one of the type specifiers to modify
the alignment requirement of the object being declared.

The _Alignof operator is used to query the alignment requirement of its
operand type.

ISO/IEC N3242=11-0012 (C++1x) and ISO/IEC N3797 (C++1y) both note a header
<cstdalign> which defines only __alignas_is_defined and shall not define
the alignas macro. It misses the alignof case as it's probably based on an
older C1x draft, which defined only alignas. Assume that this is a bug in
the standard and treat alignof the same way as alignas in C++11.

Allow to define alignas and alignof in C++ prior the C++11 standard. It
might be broken but a nonstandard C++ compiler might support C11-like
_Alignas and _Alignof. Note that it's fatal for g++(1) v.5.4.
 1.142  02-Oct-2016  kamil Import <stdnoreturn.h>

This header conforms to the C11 standard
Reference: ISO/IEC 9899:201x 7.23 _Noreturn <stdnoreturn.h>

According to ISO/IEC 9899:201x (draft) <stdnoreturn.> defines the
noreturn macro which expands to _Noreturn.

The _Noreturn keyword appears in a function declaration and specifies
that the function does not return by reaching the end of the function
body.

Design choices:
- don't implicitly break C++ code including this header with #error
C++11 offers [[noreturn]] which conflicts with C11 _Noreturn

- don't check for __STDC_VERSION__, everybody is free to reuse it with
a nonstandard compiler not conforming to C11 but supporting _Noreturn

gcc(1) and clang(1) support _Noreturn in -std=c99 and older standards

this follows <stdbool.h> choice for not checking for C99

- follow <stdbool.h> and declare the __noreturn_is_defined guard

- use a standard header guard (_STDNORETURN_H_), similar to <stdbool.h>

Reviewed by <pgoyette> and <joerg>
 1.141  29-Jul-2015  christos branches: 1.141.2;
move stdbool.h to sys, reuire pool.h to include <sys/stdbool.h> for bool,
centralize definitions of bool, true, false, to <sys/stdbool.h>
 1.140  11-Dec-2013  joerg Allow kernel code to access constant databases by moving cdbr(3) and the
required mi_vector_hash(3) into src/common.
 1.139  11-Feb-2012  martin branches: 1.139.6;
Add userland part of posix_spawn. Libc functions imported from FreeBSD.
Based on Charles Zhang's summer of code project.
 1.138  05-Feb-2012  dholland Migrate one last leftover bit (used only by the kernel now) to
sys/ufs/ufs and remove the old quota headers and no-longer-used shared
code. Ok by releng.
 1.137  09-Jan-2012  dholland Add <quota.h> with the new libquota API.

This is the user/application API and does not include the kernel
interface. Definitions shared with the kernel are found in
<sys/quota.h>.

Since I've been working on a local branch I have taken the liberty of
moving the latest-so-far version of <quota.h> to the front of the
patch queue. This loses (a small amount of) history but has the
advantage of avoiding unnecessary version bumps of libquota.so.
 1.136  26-Aug-2011  dyoung branches: 1.136.2;
Build and install ppath(3), property-list paths library.
 1.135  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.134  24-Mar-2011  bouyer Add a new libquota library, which contains some blocks to build and/or
parse quota plists; as well as a getfsquota() function to retrieve quotas
for a single id from a single filesystem (whatever filesystem this is:
a local quota-enabled fs or NFS). This is build on functions getufsquota()
(for local filesystems with UFS-like quotas) and getnfsquota();
which are also available to userland programs.
move functions from quota2_subr.c to libquota or libprop as appropriate,
and ajust in-tree quota tools.
move some declarations from kernel headers to either sys/quota.h or
quota/quota.h as appropriate. ufs/ufs/quota.h still installed because
it's needed by other installed ufs headers.
ufs/ufs/quota1.h still installed as a quick&dirty way to get a code
using the old quotactl() to compile (just include ufs/ufs/quota1.h instead of
ufs/ufs/quota.h - old code won't compile without this change and this is
on purpose).
Discussed on tech-kern@ and tech-net@ (long thread, but not much about
libquota itself ...)
 1.133  31-Jul-2010  joerg Add support for fenv.h interface for i386 and amd64.

Submitted by Stathis Kamperis as part of GSoC 2010 and ported from
FreeBSD.
 1.132  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.131  28-May-2008  ad branches: 1.131.8; 1.131.16;
/usr/include/atomic.h, for Solaris source compat.
 1.130  07-Sep-2007  rmind branches: 1.130.6; 1.130.8;
Implementation of POSIX message queues.

Reviewed by: <ad>, <tech-kern>
 1.129  20-Aug-2007  drochner branches: 1.129.2;
Add C99 complex support, for double and float.
Most complex function implementations are from the "c9x-complex" library,
originating from the "cephes" math library, see
http://www.netlib.org/cephes/, from Stephen L. Moshier, incorporated and
redistributed with the NetBSD license by permission of the author.

Error behaviour and other boundary conditions (branch cuts)
need to be looked at.

For namespace sanity, I've done the rename/weak alias procedure to
most of the exported functions which are also used internally.
Didn't do so for sin/cos(f) yet because assembler implementations use
them directly, and renaming functions shared between the main libm
and the machine specific "overlay" might raise binary compatibility
issues.
 1.128  30-May-2007  tls Move FORTIFY_SOURCE implementation from the somewhat ill-named "libssp"
(what other systems keep in libssp, we already have in libc) into libc
to match what other systems with FORTIFY_SOURCE do. Goodbye, libssp
dependency in libraries and executables. Discussed with christos and
mrg; Christos will merge the headers to get us the rest of the way to a
FORTIFY_SOURCE implementation that works as others' code expects.
 1.127  30-Apr-2007  rmind Import of POSIX Asynchronous I/O.
Seems to be quite stable. Some work still left to do.

Please note, that syscalls are not yet MP-safe, because
of the file and vnode subsystems.

Reviewed by: <tech-kern>, <ad>
 1.126  09-Feb-2007  ad Sync with changes introduced by merging the newlock2 branch.
 1.125  30-Oct-2006  christos branches: 1.125.2; 1.125.4;
kill crypto/rmd160.h and crypto/sha2.h, and instead make symlinks to
/usr/include from /usr/include/sys. This makes all the one way hash
header handling identical.
 1.124  02-Jun-2006  mrg remove support for building (with) GCC 2.95. also:
- always install <stdbool.h>
- don't generate a fake one for vax / gettext.
 1.123  27-Apr-2006  thorpej Install proplib include files.
 1.122  07-Apr-2006  mrg retire HAVE_GCC3/HAVE_GCC4 and introduce HAVE_GCC that is set to 2, 3 or 4.
 1.121  30-Dec-2005  agc Add Todd Miller's ftw(3) and nftw(3) file-tree walking functionality,
from OpenBSD.

Bump libc minor to 136.
 1.120  03-Apr-2005  christos Add FreeBSD's strfmon(3). From Rui Paulo. No bump this time. Take advantage
of the getpwent_r bump.
 1.119  14-Dec-2004  nathanw 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.118  13-Sep-2004  thorpej DCE 1.1 RPC compatible UUID routines for libc, adapted from FreeBSD.
Encode/decode to big/little endian binary blob routines adapted from
kernel.

PR 23470.
 1.117  13-Jul-2004  seb Add wordexp(3). The wordexp function performs shell-style word expansions.
This implementation is wrapper around the undocumented wordexp sh(1)
built-in command.

From FreeBSD.
Provided in PR lib/26123.
Approved by kleink@.
 1.116  21-May-2004  christos install new files.
 1.115  14-Oct-2003  tron Replace symbolic link "/usr/include/varargs.h" (pointing to
"/usr/include/machine/varargs.h") by a stub include file which will
emit an error if GCC 3.3 or newer is used and include "machine/varargs.h"
otherwise.

Based on a suggestion by Richard Earnshaw. This fixes PR toolchain/22888
by myself.
 1.114  01-Oct-2003  christos make some files symlinks from sys.
 1.113  09-Sep-2003  itojun add randomid(3).
 1.112  27-Aug-2003  mrg introduce an additional switch to enable building GCC3 instead of GCC2:
HAVE_GCC3. if this is set, we also set USE_TOOLS_TOOLCHAIN=no. change
the definition of the former to be restricted to whether tools/toolchain
is used or not.
 1.111  26-Jul-2003  mrg install stdbool.h if gcc3
 1.110  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.109  22-Mar-2003  jdolecek install mntopts.h
 1.108  20-Jan-2003  christos add support for p1003.1b semaphores. From FreeBSD
 1.107  19-Jan-2003  thorpej Expose libc's thread stubs, which get magically turned into real pthread
calls when the pthread library is linked in. Simplifies making other
libraries (such as X's) thread-safe.
 1.106  18-Jan-2003  thorpej Merge the nathanw_sa branch.
 1.105  18-Sep-2002  lukem minor makefile delint
 1.104  31-Mar-2002  bjh21 split /usr/include/sys/sha1.h and /usr/include/sha1.h completely.
future direction: nuke /usr/include/sys/sha1.h, it shouldn't be there as
we don't provide libkern to userland.

This mirrors the same change for md5.h made by itojun on 2000/12/11.
 1.103  22-Mar-2002  thorpej Split the notion of building Hesiod, Kerberos, S/key, and YP
infrastructure and using that infrastructure in programs.

* MKHESIOD, MKKERBEROS, MKSKEY, and MKYP control building
of the infratsructure (libraries, support programs, etc.)

* USE_HESIOD, USE_KERBEROS, USE_SKEY, and USE_YP control
building of support for using the corresponding API
in various libraries/programs that can use it.

As discussed on tech-toolchain.
 1.102  22-Feb-2002  christos A utmpx implementation.
 1.101  04-Feb-2002  thorpej Don't install <stdbool.h> for now. Lossage resulting from me testing
with a not-in-tree compiler.
 1.100  02-Feb-2002  thorpej ISO C / SUSv3 <stdbool.h>.
 1.99  12-Dec-2001  tv MKfoo=no -> NOfoo=
 1.98  17-Jul-2001  thorpej A <sched.h> file, which provides the clone(2) prototypes, in order
to be compatible with Linux.
 1.97  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.96  19-Mar-2001  atatat Add md2 routines to libc.
 1.95  17-Feb-2001  ragge branches: 1.95.2;
Don't handle ieeefp.h on vax.
 1.94  21-Dec-2000  itojun have dummy wctype.h and isw*/tow*. part of libc minor 68 -> 69 crank.
equivalent to is*/to* at this moment. we'll put wchar_t code in the
near future.
 1.93  11-Dec-2000  itojun split /usr/include/sys/md5.h and /usr/include/md5.h completely.
future direction: nuke /usr/include/sys/md5.h, it shouldn't be there as
we don't provide libkern to userland.
 1.92  05-Jul-2000  ad Pull in RIPEMD-160 functions from OpenBSD - this has the same API as our MD4,
MD5 and SHA1 stuff.
 1.91  20-Jun-2000  thorpej branches: 1.91.2;
Merge a bunch of things from crypto-us and crypto-intl into basesrc,
adding support for Heimdal/KTH Kerberos where easy to do so. Eliminate
bsd.crypto.mk.

There is still a bunch more work to do, but crypto is now more-or-less
fully merged into the base NetBSD distribution.
 1.90  03-Jun-2000  fvdl Use a seperate Makefile in the rpc/ subdir. Needed because it generates
a file (rpcb_prot.h).
 1.89  03-Jun-2000  fvdl Add missed include files.
 1.88  03-Jun-2000  fvdl Move rpcb_prot.x to here from libc/rpc.
 1.87  02-Jun-2000  fvdl Fix omission in previous.
 1.86  02-Jun-2000  fvdl New headers for the new RPC code (based on TI-RPC from Sun).
 1.85  20-Apr-2000  kleink branches: 1.85.2;
* Move <wchar.h> from libcurses to include (for the missing functionality
is to be provided by libc).
* Define wint_t and size_t in <wchar.h> as well.
 1.84  01-Apr-2000  christos Add getopt.h and collect all the getopt related stuff here.
Make unistd.h include <getopt.h> to get the getopt stuff.
This adds support for getopt_long from Dieter Baron and Thomas Klausner.
 1.83  23-Feb-2000  itojun add getifaddrs(3) from bsdi4, as mentioned in tech-net (in SIOCGIFCONF
related thread).
this will save future apps from complexity of SIOCGIFCONF.

getifaddrs(3) does not use SIOCGIFCONF internally, it uses sysctl.
 1.82  12-Jan-2000  mjl Add necessary support routines for login.conf.
 1.81  10-Jan-2000  kleink Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.
 1.80  22-Dec-1999  kleink For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.
 1.79  13-Sep-1999  kleink Add an XSH5 ulimit()/<ulimit.h> implementation.
 1.78  12-Sep-1999  kleink Add an XSH5 fmtmsg() implementation.
 1.77  20-Jul-1999  mrg optionally include CRYPTOPATH Makefile.frag files.
 1.76  12-Jul-1999  thorpej Use bsd.crypto.mk.
 1.75  19-Mar-1999  thorpej Move the link.h files for the different shlib formats via repository copy,
and rename them to match the executable format. Introduce a new link.h
file which automatically picks the correct header based on the target of
the toolchain.
 1.74  13-Feb-1999  lukem convert from NOxxx= to MKxxx=no.
include <bsd.own.mk> if testing a MKxxx variable.
 1.73  15-Jan-1999  lukem merge nsswitch into main branch
 1.72  12-Jan-1999  kleink Separate the userland and libsa errno declarations from <sys/errno.h> into
their canonical places.
 1.71  02-Feb-1998  perry merge lite-2
 1.70  02-Nov-1997  kleink Add <libgen.h> header, from XPG4.2.
 1.69  30-Apr-1997  thorpej branches: 1.69.2;
Move md5.h to <sys/md5.h> so that it may be included by the kernel.
A symlink is used to preserve <md5.h> compatibility.
 1.68  27-Mar-1997  mycroft Install files via INCS, and GC the bogus permission fixing hack.
 1.67  30-Jan-1997  thorpej Install md4.h and md5.h
 1.66  17-Jan-1997  lukem A stringlist implementation (previously ``private'' to libc netgroup code,
but christos ok-ed making public as it's useful)
 1.65  27-Dec-1996  pk link.h no longer liver here
 1.64  18-Dec-1996  cgd install dlfcn.h on the Alpha, since the Alpha (with the ELF shared library
tools) provides the dl*() interfaces. the only remaining special-case header
is the a.out link.h, which should really be installed by the dynamic linker.
 1.63  18-Oct-1996  thorpej branches: 1.63.2;
Use ${INSTALL}.
 1.62  29-Sep-1996  mrg install sys headers from sys/Makefile.
 1.61  07-Sep-1996  mycroft Make a symlink for poll.h.
 1.60  09-Aug-1996  jtc install rmt.h
 1.59  15-May-1996  jtc Added new header files for functions in libutil.
Added macro for master passwd lock file.
From Greg Hudson <ghudson@MIT.EDU>.
 1.58  10-May-1996  cgd don't install dlfcn.h or link.h on the Alpha, because they make no
sense for that architecture. (It doesn't have dynamic linking or
shared libraries.)
 1.57  25-Apr-1996  jtc Use 'includes' instead of 'install' targets to install headers
 1.56  05-Feb-1996  jtc Add cpio.h, tar.h, and re_comp.h headers for POSIX & XPG4 conformance
 1.55  05-Jun-1995  pk Add dlfcn.h and alphabetize.
 1.54  16-Apr-1995  mycroft Follow symlinks when copying .h files. From Greg Hudson.
 1.53  07-Apr-1995  jtc New header file <ieeefp.h>, which provides a API for getting and setting
IEEE rounding mode, exception enable flags, and exception sticky flags.
 1.52  17-Feb-1995  jtc For Normative Addendum 1.
We have this cr*p because no one would sa "no" to the danes.
 1.51  15-Jan-1995  jtc fix tipo
 1.50  12-Jan-1995  jtc Use and .
 1.49  03-Dec-1994  christos Add netgroup.h
 1.48  26-Oct-1994  cgd new RCS ID format.
 1.47  15-Oct-1994  cgd make <stdarg.h> a symlink, and clean up ports' stdarg.h and varargs.h files.
 1.46  29-Aug-1994  mycroft branches: 1.46.2;
Simplify copying of sys include files.
 1.45  21-Jul-1994  cgd get permissions right on installed directories
 1.44  08-Jul-1994  jtc Use pax instead of two tar's to install ${MACHINE} and ${MACHINE_ARCH}
header files. It's faster, because the file data doesn't have to be
passed through a pipe; and it's cleaner, because pax's rich set of
features allows us to copy the files without changing directories, etc.
 1.43  22-Jun-1994  mycroft branches: 1.43.2;
Fix the install for real. Note this uses pax(1).
 1.42  22-Jun-1994  cgd add bm header, from Bostic
 1.41  21-Jun-1994  jtc Added langinfo.h header for nl_langinfo() function
 1.40  12-Jun-1994  cgd make install work for copies, but hack it to work for symlinks
 1.39  29-May-1994  jtc Added nl_types.h for message catalog functions
 1.38  16-May-1994  cgd oops
 1.37  16-May-1994  cgd update all but ctype.h, dumprestore.h, time.h to 4.4-Lite versions.
USL copyright additions on those. Kill varargs.h, because it can simply
be a link to the machine-dependent version.
 1.36  11-May-1994  cgd user-land signal include file
 1.35  31-Mar-1994  cgd don't use MACHINE_ARCH if it's dir doesn't exist...
 1.34  10-Feb-1994  cgd clean things up some
 1.33  10-Feb-1994  cgd don't hide install -d, and make owner/group correct
 1.32  12-Jan-1994  cgd regexp.h should still be here, for things needing the compat lib.
 1.31  08-Jan-1994  cgd fix SYS_INCLUDE definition, and explicitly include bsd.own.mk.
minor cleanup, and add support for creating and/or symlinking
/usr/include/${MACHINE_ARCH} as necessary.
 1.30  22-Dec-1993  cgd add 'dev' to the list of LDIRS
 1.29  12-Nov-1993  jtc Install regex.h header.
 1.28  21-Oct-1993  jtc Added X/Open 1170's <search.h> header --- it only declares bsearch, insque,
and remque at this time. The remainder of the functions will be added as
time allows.
 1.27  17-Oct-1993  pk Moved <link.h> here from usr.bin/ld as it is needed by other modules
and utilities (eg. crt0, libc, nm).
 1.26  09-Oct-1993  cgd install the 2 includes in ./rpcsvc, too.
 1.25  08-Oct-1993  cgd move rpcsvc files and include generation into src/lib/librpcsvc
 1.24  01-Oct-1993  jtc Use `:', rather than `.' to separate user and group in chown commands
in case we ever decide to remove the support for the (obsolete) `.'
separator.
 1.23  16-Aug-1993  mycroft Oops. `copies' was getting done before making /usr/include.
 1.22  15-Aug-1993  mycroft There would have to be just one Makefile in the entire tree which referenced
_PROGSUBDIR. GRRRRRR.
 1.21  01-Aug-1993  mycroft Add RCS identifiers.
 1.20  10-Jul-1993  brezak Allow SYS_INCLUDES={copies,symlinks} choice in bsd.own.mk.
 1.19  16-Jun-1993  mycroft Don't forget to install fnmatch.h.
 1.18  07-Jun-1993  deraadt install incluide files mode 644
 1.17  26-May-1993  deraadt install /usr/include/malloc.h!
 1.16  18-May-1993  cgd change for 'arch'
 1.15  06-May-1993  proven ftp put doesn't cleanly truncate and overwrite a file.
 1.14  06-May-1993  proven rpc directory installs now.
 1.13  05-May-1993  proven Set permissions and ownership all at once. (No more directories mode 0777)
 1.12  01-May-1993  mycroft Don't forget to install err.h.
 1.11  28-Apr-1993  cgd changed sys.386bsd to sys
 1.10  26-Apr-1993  mycroft Install mpool.h.
 1.9  09-Apr-1993  cgd added netccitt, netiso, and netns support, from (currently
alpha) patch 126
 1.8  09-Apr-1993  cgd make sure directory to install stuff exists before installing
 1.7  04-Apr-1993  cgd now that we have subdirs, need to do them on install, too...
 1.6  04-Apr-1993  cgd updated for addition of rpcsvc
 1.5  31-Mar-1993  cgd install of include subdirs from sys.386bsd now done relative to current
dir, rather than from /sys.
 1.4  23-Mar-1993  cgd marked dirs netimp, netiso, and netns as "missing" from LDIRS
 1.3  22-Mar-1993  cgd added "vm" to list of subdirs of /usr/include, and made a minor
cleanup so /usr/include/machine is handled right w/different types
of installs (links vs. copies).
 1.2  22-Mar-1993  cgd made install copy, rather than symlink includes
 1.1  21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2  02-Feb-1998  perry import lite-2
 1.1.1.1  21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.43.2.1  21-Jul-1994  cgd from trunk
 1.46.2.2  29-Aug-1994  mycroft Simplify copying of sys include files.
 1.46.2.1  29-Aug-1994  mycroft file Makefile was added on branch netbsd-1-0 on 1994-08-29 04:59:49 +0000
 1.63.2.1  06-Nov-1996  lukem initial nsswitch implementation
 1.69.2.2  31-Oct-1998  lukem update to current, fix copyrights, reimplement MAXDNSLUS (for now)
 1.69.2.1  23-May-1997  lukem Add necessary files for nsswitch, take 2
Remove support for "lookup" methods in resolv.conf
Remove prototypes for _ng_sl_*; these were replaced a long time ago
 1.85.2.2  23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.85.2.1  28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.91.2.2  20-Jun-2000  thorpej Merge a bunch of things from crypto-us and crypto-intl into basesrc,
adding support for Heimdal/KTH Kerberos where easy to do so. Eliminate
bsd.crypto.mk.

There is still a bunch more work to do, but crypto is now more-or-less
fully merged into the base NetBSD distribution.
 1.91.2.1  20-Jun-2000  thorpej file Makefile was added on branch netbsd-1-5 on 2000-06-20 06:00:33 +0000
 1.95.2.12  20-Sep-2002  thorpej Sync with HEAD.
 1.95.2.11  25-Apr-2002  nathanw Catch up to -current.
 1.95.2.10  22-Mar-2002  nathanw Catch up to -current.
 1.95.2.9  12-Mar-2002  nathanw Restore ucontext.h (missed in last merge; thanks to nick for pointing
it out).
Clean up wrap slightly.
 1.95.2.8  11-Mar-2002  nathanw Catch up to -current.
 1.95.2.7  23-Feb-2002  gmcgarry It's back with the pthreads bits.
 1.95.2.6  23-Feb-2002  gmcgarry sched.h is now part of the pthread library
 1.95.2.5  28-Jan-2002  nathanw Catch up to -current.
 1.95.2.4  14-Jan-2002  nathanw Catch up to -current.
 1.95.2.3  08-Oct-2001  nathanw Catch up to -current.
 1.95.2.2  08-Apr-2001  nathanw Merge trunk onto branch.
 1.95.2.1  05-Mar-2001  nathanw User-level support for LWPs and scheduler activations.
SVR4-style ucontext code by Klaus Klein.
 1.125.4.1  03-Sep-2007  wrstuden Sync w/ NetBSD-4-RC_1
 1.125.2.1  22-Jul-2007  liamjfoy Pull up to netbsd-4 (requested by christos in ticket #773):

Move libssp to libc.
 1.129.2.1  06-Nov-2007  matt sync with HEAD
 1.130.8.1  23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.130.6.1  04-Jun-2008  yamt sync with head
 1.131.16.2  17-Aug-2010  uebayasi Sync with HEAD.
 1.131.16.1  30-Apr-2010  uebayasi Sync with HEAD.
 1.131.8.2  28-May-2008  ad /usr/include/atomic.h, for Solaris source compat.
 1.131.8.1  28-May-2008  ad file Makefile was added on branch christos-time_t on 2008-05-28 12:28:13 +0000
 1.136.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.136.2.1  17-Apr-2012  yamt sync with head
 1.139.6.1  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.141.2.1  04-Nov-2016  pgoyette Sync with HEAD
 1.143.6.1  04-Dec-2017  snj Pull up following revision(s) (requested by maya in ticket #416):
distrib/sets/lists/comp/mi: revision 1.2152
include/Makefile: revision 1.144
include/endian.h: revision 1.1
Add endian.h header. Simply includes sys/endian.h
<endian.h> has been accepted by the austin group.
 1.144.4.1  10-Jun-2019  christos Sync with HEAD
 1.146.12.1  02-Aug-2025  perseant Sync with HEAD
 1.146.10.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

RSS XML Feed