Home | History | Annotate | only in /src/lib/libc/string
History log of /src/lib/libc/string
RevisionDateAuthorComments
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_bcmp.c was added on branch netbsd-1-3 on 1997-11-08 22:00:58 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_bcopy.c was added on branch netbsd-1-3 on 1997-11-08 22:01:03 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_bzero.c was added on branch netbsd-1-3 on 1997-11-08 22:01:07 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.4 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.3 05-Aug-2009  joerg branches: 1.3.58;
ffs(3) lives in strings.h, so include the correct header. ANSIfy.
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_ffs.c was added on branch netbsd-1-3 on 1997-11-08 22:01:12 +0000
 1.3.58.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_index.c was added on branch netbsd-1-3 on 1997-11-08 22:00:59 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.2 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.1 07-Dec-1997  matthias branches: 1.1.124;
add lint stubs for files that are implemented in assembler on the pc532.
 1.1.124.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_memchr.c was added on branch netbsd-1-3 on 1997-11-08 22:01:04 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_memcmp.c was added on branch netbsd-1-3 on 1997-11-08 22:01:08 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_memcpy.c was added on branch netbsd-1-3 on 1997-11-08 22:01:14 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_memmove.c was added on branch netbsd-1-3 on 1997-11-08 22:01:00 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_memset.c was added on branch netbsd-1-3 on 1997-11-08 22:01:05 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_rindex.c was added on branch netbsd-1-3 on 1997-11-08 22:01:09 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strcat.c was added on branch netbsd-1-3 on 1997-11-08 22:01:14 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strchr.c was added on branch netbsd-1-3 on 1997-11-08 22:01:01 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strcmp.c was added on branch netbsd-1-3 on 1997-11-08 22:01:06 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strcpy.c was added on branch netbsd-1-3 on 1997-11-08 22:01:10 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strlen.c was added on branch netbsd-1-3 on 1997-11-08 22:01:15 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.2 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.1 07-Dec-1997  matthias branches: 1.1.124;
add lint stubs for files that are implemented in assembler on the pc532.
 1.1.124.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strncmp.c was added on branch netbsd-1-3 on 1997-11-08 22:01:02 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.2 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.1 07-Dec-1997  matthias branches: 1.1.124;
add lint stubs for files that are implemented in assembler on the pc532.
 1.1.124.1 02-Aug-2025  perseant Sync with HEAD
 1.3 01-Dec-2024  rillig libc: modernize lint stubs

Use prototype function definitions instead of identifier lists, as C23
does not support the latter.

Remove redundant /*ARGSUSED*/ comments and parentheses.
 1.2 14-Jun-2000  cgd branches: 1.2.116;
fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_strrchr.c was added on branch netbsd-1-3 on 1997-11-08 22:01:06 +0000
 1.2.116.1 02-Aug-2025  perseant Sync with HEAD
 1.3 05-Jul-2010  christos consistency with c source
 1.2 14-Jun-2000  cgd fix up NetBSD RCS Ids to match the standard, and the leading comment as
to match as well. No functional changes.
 1.1 06-Nov-1997  cgd branches: 1.1.2; 1.1.10;
lint stubs for functions which ports use assembly versions. When using
an assembly version of a function, add the right lint stub to the Makefile.inc
which specifies the source to build the function (see the
arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
functions, because some of them don't _have_ normal C versions and if
that were done dependencies would get messed up.
 1.1.10.1 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.1.2.2 08-Nov-1997  veego pull up changes from the trunk (approved by perry) from cgd:
>lint stubs for functions which ports use assembly versions. When using
>an assembly version of a function, add the right lint stub to the Makefile.inc
>which specifies the source to build the function (see the
>arch/i386/*/Makefile.inc). Can't just lint the normal C versions of these
>functions, because some of them don't _have_ normal C versions and if
>that were done dependencies would get messed up.
 1.1.2.1 06-Nov-1997  veego file Lint_swab.c was added on branch netbsd-1-3 on 1997-11-08 22:01:11 +0000
 1.93 02-Nov-2024  riastradh memset_explicit(3): Add C23 alias for explicit_memset.

PR standards/58607: C23: <string.h> memset_explicit
 1.92 01-Nov-2024  riastradh ffs(3): Fix visibility in strings.h and add MLINKS for ffsl/ffsll.

ffs(3) was added in POSIX 2001 with XSI option (_XOPEN_SOURCE>=600),
not in POSIX 2008 with XSI option (_XOPEN_SOURCE>=700).

Noticed while updating the STANDARDS section of the man page.

PR lib/58802: missing ffsl(), ffsll() functions from POSIX 2024
 1.91 01-Nov-2024  riastradh strings.h: Spruce up for POSIX 2024.

1. Add ffsl, ffsll.
2. Hide bcmp, bcopy, bzero, index, rindex for POSIX>=2024.
3. Expose ffs only for NetBSD or POSIX>=2008 with XSI option.
4. Hide popcount* NetBSD extensions for any POSIX.
5. Sprinkle __constfunc on ffs*.

Add tests for ffs/ffsl/ffsll in tests/include/sys/t_bitops next to
ffs32/ffs64 for convenience.

XXX Still missing strcasecmp_l, strncasecmp_l, and locale_t.

PR lib/58802: missing ffsl(), ffsll() functions from POSIX 2024
 1.90 08-Jun-2024  joerg branches: 1.90.2;
Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.
 1.89 11-Aug-2023  ryoon Install strncpy.3 to fix build
 1.88 11-Aug-2023  riastradh strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.
 1.87 01-Aug-2023  christos Add companion mempcpy to wmempcpy, bump.
 1.86 31-Jul-2023  christos new gdb needs wmempcpy, give it to it.
 1.85 14-Apr-2021  mrg branches: 1.85.6;
for GCC, built memset.c with -fno-builtin. this avoids GCC 10 compiling
memset() and emitting calls to memset() where it seems code that looks
like what memset() does, which ends up recursing and blowing the stack.

this makes mips userland with GCC 10 work.
 1.84 25-Mar-2020  kre Document strerror_l()

While here also document (but comment it out since it isn't
available - yet) strerror_lr(). To include that, simply
uncomment the relevant lines, and (twice I think) s/returns/return/
on lines just after currently commented out lines (that is, it
currently says, "A returns" after the comments are returned, we
need it to be "A and B return" - the "and B" appears when the comment
markers are removed, removing the 's' from returns must be done manually.

In addition to adding strerror_l() some additional enhancements were
made to the general strerror() doc.
 1.83 12-Jan-2017  christos branches: 1.83.14;
Add strerror_ss_r to be used by syslog_ss
 1.82 15-Oct-2016  kamil Import wcsnlen(3) to libc

The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
 1.81 12-Oct-2016  christos add strchrnul
 1.80 24-Sep-2014  christos branches: 1.80.2;
add strnstr from FreeBSD
 1.79 19-Aug-2013  joerg GC __indr_reference wrappers.
 1.78 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.77 24-Jun-2013  riastradh Add consttime_bcmp(3) and explicit_bzero(3) to makefile and set lists.
 1.76 30-Aug-2012  drochner branches: 1.76.2;
Add "consttime_bcmp" and "explicit_bzero" functions for both kernel
abd userland, as proposed on tech-security, with explicit_bzero using
a volatile function pointer as suggested by Alan Barrett.
Both do what the name says. For userland, both are prefixed by "__"
to keep them out of the user namespace.
Change some memset/memcmp uses to the new functions where it makes
sense -- these are just some examples, more to come.
 1.75 30-Jul-2009  dsl branches: 1.75.6;
If SRCS contains any .S files then remove the corresponding .c file from
SRCS and add to LSRCS (for lint).
Change the 'string' Makefiles so that the arch/*/string/Makefile.inc
need only specify the .S files for that architecture and not the .c
files for all the files they don't override.
 1.74 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.73 21-Jul-2009  joerg Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
 1.72 18-Jul-2009  dsl Remove index() and rindex() from the list (in comment)
 1.71 01-May-2009  perry Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.70 10-Apr-2009  christos add memrchr
 1.69 11-Jan-2009  christos branches: 1.69.2;
merge christos-time_t
 1.68 02-Jan-2009  tnozaki Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.67 17-Feb-2007  wiz branches: 1.67.18; 1.67.20;
Add strings(3), collecting information about strings.h.
Add Xr for it to string(3).

XXX: if someone could make a HISTORY section, I'd appreciate it
 1.66 13-Oct-2006  tnozaki PR/30809 added manpages of wcswcs(3) and wcscoll(3), wcsxfrm(3)
(wcs?width and wprintf are already in repository).
 1.65 27-Aug-2006  dsl fix xtos's pasto
 1.64 26-Aug-2006  christos PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
 1.63 23-Aug-2006  christos include one more new file.
 1.62 22-Aug-2006  christos PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
 1.61 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.60 03-Jun-2006  tnozaki branches: 1.60.2;
fix lib/33476:
added following manpages (derived from FreeBSD),
wcwidth(3) wcswidth(3)
wcstol(3) wcstoll(3) wcstoimax(3)
wcstoul(3) wcstoull(3) wcstoumax(3)
and update doc/TODO.i18n.
 1.59 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.58 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.57 28-Jul-2005  christos PR/30845: Luke Mewburn: strerror_r(3) missing
- Merge 4.4BSD strerror.3 man page changes that summarize information
for all the error printing functions. This makes the perror(3) page
obsolete.
- Implement all error functions in terms of strerror_r(), including
__strerror() which is not used internally. Can it be removed?
- Bump version for strerror_r
 1.56 14-Mar-2005  perry Fix stupid typo. I added memmem, not memmove.
 1.55 13-Mar-2005  perry add memmem
 1.54 03-Jul-2004  junyoung Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.
 1.53 05-Mar-2003  tshiozak branches: 1.53.2;
changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.52 17-Apr-2002  kleink Need internal names for strlcat() and strlcpy().
 1.51 24-Dec-2000  itojun branches: 1.51.2;
split wide char section, just for readability/future possibility for .if
 1.50 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.49 08-Sep-1999  lukem branches: 1.49.8;
add netbsd rcsid's
update for knf (return value on separate line to function name...)
check dst and src aren't null pointers before trying to use them
enable strlcat/strlcpy
 1.48 24-Feb-1999  drochner branches: 1.48.2;
use ${ARCHDIR} instead of ${.CURDIR}/arch/${MACHINE_ARCH} where appropriate
libc builds on pmax again
 1.47 14-Sep-1998  kleink Install a link for strtok_r(3).
 1.46 04-Aug-1998  perry switch bzero to version in memset.c.
bzero.c is now a "#define BZERO//#include memset.c" type file.
Remove comment from Makefile about the fact that this is on the todo list.
 1.45 04-Aug-1998  perry Replace complicated and ugly makefile gook to make memmove,memcpy by
-Ding the bcopy.c source (and similarly strchr from index.c, strrchr
from rindex.c) with stub .c files for memmove, memcpy, strchr and
strrchr that simply #define the appropriate thing and #include the
appropriate .c file. Inspired by the way many m-d .S files handle the
same thing. This radically simplifies the Makefile.inc for libc/string
(and libkern).
 1.44 30-Jan-1998  perry note that bzero isn't yet being built from memset.c
 1.43 30-Jan-1998  perry update to lite-2
 1.42 23-Jan-1998  cgd Update various aspects of the special target builds which should
have been done (by others) a long time ago:
* fix PIC compilation to use new PIC flags,
* make them 'make -j N' safe.
 1.41 22-Oct-1997  lukem - use CPPFLAGS instead of CFLAGS
- use ${COMPILE.C} ... instead of ${CC} ${CFLAGS} -c ...
 1.40 09-Oct-1997  lukem branches: 1.40.2;
rcsid police
 1.39 23-Apr-1997  mrg move str[fp]time into libc/time.
 1.38 22-Dec-1996  cgd add rules to build .ln files (memmove.ln, memcpy.ln, strchr.ln, strrchr.ln)
for objects built specially from other C files, when appropriate.
 1.37 12-Nov-1996  jtc Add strtok_r() for reentrant (thread-aware) programs
 1.36 24-Sep-1996  matthias Make it possible to have a md version of memccpy.
 1.35 20-Mar-1995  mycroft Clarify a comment slightly.
 1.34 20-Mar-1995  mycroft Separate machine dependencies.
 1.33 10-Feb-1995  cgd list the files needed on the alpha.
 1.32 22-Dec-1994  cgd specify man pages the new way.
 1.31 14-Nov-1994  dean Include files for pmax
 1.30 03-Sep-1994  jtc __strerror() and __strsignal() have been broken out into their own files
and use message catalogs if NLS is defined.
Increased the size of char buffers used by strerror() and strsignal();
the error and signal strings may be much longer in some locales.
 1.29 02-Aug-1994  jtc branches: 1.29.2;
Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.28 06-Jul-1994  mycroft We're supposed to include ${CPPFLAGS} when compiling .c files.
 1.27 22-Jun-1994  cgd add Boyer-Moore string search routines, from Bostic. man page
needs to be fixed for mandoc, and RCSID's need to be added.
 1.26 25-Feb-1994  phil Changing the ns32k stuff.
 1.25 10-Dec-1993  mycroft memcpy.S and memmove.S on i386 are now separate.
 1.24 08-Dec-1993  mycroft Add strchr.S and strrchr.S for m68k.
 1.23 08-Dec-1993  pk Added some Sparc sources.
 1.22 07-Dec-1993  mycroft Also a memcpy.S for m68k.
 1.21 07-Dec-1993  mycroft Remove -p flags from .so builds.
 1.20 06-Dec-1993  mycroft Add memmove.S to m68k assembler stuff.
 1.19 06-Dec-1993  mycroft Use assembler versions of m68k stuff.
 1.18 06-Dec-1993  cgd fix things so that memmove.so, et al., are built correctly on
machines w/o architecture-specific sources.
 1.17 05-Dec-1993  briggs Changed occurance of MACHINE_ARCH == "hp300" to MACHINE_ARCH == "m68k"
 1.16 05-Dec-1993  cgd get pc532 moved into ns32k; that's is MACHINE_ARCH
 1.15 04-Dec-1993  cgd update for .S and MACHINE_ARCH
 1.14 18-Oct-1993  cgd don't compiler strerror.c source here, and clean up.
 1.13 07-Oct-1993  jtc Moved strerror.[c3] from libc/stdio to libc/string.
Since perror is not permitted to change strerror()'s static buffer, I have
changed both functions to pass their own buffers to the new library-internal
function _strerror() that actually does the error message string look up.
Split strerror manpage into strerror and perror manpages.
 1.12 07-Oct-1993  cgd make an arch directory in libc, and move all machine dirs into it
 1.11 05-Oct-1993  jtc Add swab.c or swab.s, as appropriate, to each machines source list instead
of always using swab.c
 1.10 17-Sep-1993  phil pc532 specifics.
 1.9 01-Aug-1993  mycroft Add RCS identifiers.
 1.8 17-Jun-1993  jtc Add i386 assembly versions of bcmp & memcmp
 1.7 17-Jun-1993  jtc enable memset & memchr.
 1.6 16-Jun-1993  mycroft Actually, just make memcpy() an alias for memmove().
 1.5 16-Jun-1993  mycroft Oops. Forgot to update the Makefile.
 1.4 16-Jun-1993  jtc Added i386 assembly language versions of ffs, strcat, strcpy, and strlen.
 1.3 15-Jun-1993  jtc Added fast strcmp() and strncmp() routines.
 1.2 07-May-1993  cgd add assembly language version of index, rindex, strchr, and strrchr
supplied by J.T. Conklin <conklin@kaleida.com>
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.29.2.2 02-Aug-1994  jtc Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.29.2.1 02-Aug-1994  jtc file Makefile.inc was added on branch netbsd-1-0 on 1994-08-02 05:01:21 +0000
 1.40.2.1 09-Nov-1997  lukem sync with trunk (approved by thorpej)
 1.48.2.1 05-Jul-2000  he Pull up revision 1.49 (requested by he):
Add strlcpy() and strlcat() to libc.
 1.49.8.1 22-Apr-2002  he Pull up revision 1.52 (via patch, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.51.2.1 25-Apr-2002  nathanw Catch up to -current.
 1.53.2.1 12-Jul-2004  he Pull up revision 1.54 (requested by junyoung in ticket #638):
Add strcasestr(3), case insensitive version of strstr(3).
 1.60.2.3 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.60.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.60.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.67.20.1 04-Jan-2009  christos merge with head.
 1.67.18.1 15-Jan-2009  snj Pull up following revision(s) (requested by tnozaki in ticket #222):
distrib/sets/lists/base/mi: revision 1.788
distrib/utils/libhack/Makefile.inc: revision 1.23
distrib/utils/libhack/Makefile: revision 1.22
etc/mtree/NetBSD.dist: revision 1.387
include/locale.h: revision 1.15
lib/libc/citrus/Makefile.inc: revision 1.6
lib/libc/citrus/citrus_aliasname_local.h: revision 1.1
lib/libc/citrus/citrus_bcs.h: revision 1.5
lib/libc/citrus/citrus_bcs_strtol.c: revision 1.1
lib/libc/citrus/citrus_bcs_strtoul.c: revision 1.1
lib/libc/citrus/citrus_csmapper.c: revision 1.9
lib/libc/citrus/citrus_fix_grouping.h: revision 1.1
lib/libc/citrus/citrus_lc_ctype.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.h: revision 1.1
lib/libc/citrus/citrus_lc_monetary.c: revision 1.1
lib/libc/citrus/citrus_lc_monetary.h: revision 1.1
lib/libc/citrus/citrus_lc_numeric.c: revision 1.1
lib/libc/citrus/citrus_lc_numeric.h: revision 1.1
lib/libc/citrus/citrus_lc_template.h: revision 1.1
lib/libc/citrus/citrus_lc_template_decl.h: revision 1.1
lib/libc/citrus/citrus_lc_time.c: revision 1.1
lib/libc/citrus/citrus_lc_time.h: revision 1.1
lib/libc/citrus/citrus_module.c: revision 1.8
lib/libc/citrus/citrus_namespace.h: revision 1.7
lib/libc/citrus/modules/citrus_euc.c: revision 1.13
lib/libc/gen/Makefile.inc: revision 1.166
lib/libc/gen/isctype.c: revision 1.17 via patch
lib/libc/gen/tolower_.c: revision 1.10
lib/libc/gen/toupper_.c: revision 1.10
lib/libc/iconv/Makefile.inc: revision 1.3
lib/libc/iconv/iconv.c: revision 1.7
lib/libc/locale/Makefile.inc: revision 1.53
lib/libc/locale/___runetype_mb.c: file removal
lib/libc/locale/_wctrans.c: revision 1.7
lib/libc/locale/_wctrans_local.h: revision 1.3
lib/libc/locale/_wctype.c: revision 1.1
lib/libc/locale/_wctype_local.h: revision 1.1
lib/libc/locale/aliasname.c: revision 1.3
lib/libc/locale/aliasname_local.h: revision 1.2
lib/libc/locale/bsdctype.c: revision 1.1
lib/libc/locale/bsdctype.h: revision 1.1
lib/libc/locale/ctypeio.c: revision 1.8
lib/libc/locale/ctypeio.h: revision 1.2
lib/libc/locale/current_locale.c: revision 1.1
lib/libc/locale/dummy_lc_collate.c: revision 1.1
lib/libc/locale/dummy_lc_template.h: revision 1.1
lib/libc/locale/fix_grouping.c: revision 1.1
lib/libc/locale/fix_grouping.h: revision 1.1
lib/libc/locale/generic_lc_all.c: revision 1.1
lib/libc/locale/generic_lc_template.h: revision 1.1
lib/libc/locale/generic_lc_template_decl.h: revision 1.1
lib/libc/locale/global_locale.c: revision 1.1
lib/libc/locale/iswctype.c: file removal
lib/libc/locale/iswctype_mb.c: revision 1.1
lib/libc/locale/iswctype_sb.c: revision 1.6
lib/libc/locale/lcmessages.c: file removal
lib/libc/locale/lcmessages.h: file removal
lib/libc/locale/lcmonetary.c: file removal
lib/libc/locale/lcmonetary.h: file removal
lib/libc/locale/lcnumeric.c: file removal
lib/libc/locale/lcnumeric.h: file removal
lib/libc/locale/lctime.c: file removal
lib/libc/locale/lctime.h: file removal
lib/libc/locale/localeconv.c: revision 1.15
lib/libc/locale/localeio.c: revision 1.2
lib/libc/locale/localeio.h: revision 1.2
lib/libc/locale/localeio_lc_ctype.c: revision 1.1
lib/libc/locale/localeio_lc_messages.c: revision 1.1
lib/libc/locale/localeio_lc_monetary.c: revision 1.1
lib/libc/locale/localeio_lc_numeric.c: revision 1.1
lib/libc/locale/localeio_lc_time.c: revision 1.1
lib/libc/locale/multibyte.h: revision 1.4
lib/libc/locale/multibyte_amd1.c: revision 1.6
lib/libc/locale/multibyte_c90.c: revision 1.5
lib/libc/locale/nb_lc_messages_misc.h: revision 1.1
lib/libc/locale/nb_lc_monetary_misc.h: revision 1.1
lib/libc/locale/nb_lc_numeric_misc.h: revision 1.1
lib/libc/locale/nb_lc_template.h: revision 1.1
lib/libc/locale/nb_lc_template_decl.h: revision 1.1
lib/libc/locale/nb_lc_time_misc.h: revision 1.1
lib/libc/locale/nl_langinfo.c: revision 1.12
lib/libc/locale/rune.c: revision 1.31
lib/libc/locale/rune.h: revision 1.13
lib/libc/locale/rune_local.h: revision 1.11
lib/libc/locale/runeglue.c: revision 1.14
lib/libc/locale/runetable.c: revision 1.18
lib/libc/locale/setlocale.c: revision 1.55 via patch
lib/libc/locale/setlocale_local.h: revision 1.1
lib/libc/locale/setrunelocale.c: file removal
lib/libc/nls/Makefile.inc: revision 1.9
lib/libc/nls/catopen.c: revision 1.26
lib/libc/string/Makefile.inc: revision 1.68
lib/libc/string/wcscmp.c: revision 1.6
lib/libc/string/wcsncmp.c: revision 1.6
lib/libc/string/wcswidth.c: file removal
lib/libc/string/wmemcmp.c: revision 1.4
regress/lib/libc/locale/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/en_US.UTF-8.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.exp.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.in.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.exp.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.in.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.SJIS.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.eucJP.exp.uue: revision 1.2
regress/lib/libc/locale/ctype2/Makefile: revision 1.5
regress/lib/libc/locale/ctype2/ja_JP.ISO-2022-JP-2.in.uue: revision 1.1
regress/lib/libc/locale/ctype2/ja_JP.ISO2022-JP2.in.uue: file removal
regress/lib/libc/locale/ctype3/Makefile: revision 1.5
regress/lib/libc/locale/mbtowc/Makefile: revision 1.3
regress/lib/libc/locale/mbtowc/ja_JP.ISO-2022-JP: revision 1.1
regress/lib/libc/locale/mbtowc/ja_JP.ISO2022-JP: file removal
regress/lib/libc/locale/wcstod/wcstod_test.c: revision 1.2
share/locale/Makefile.locale: revision 1.1
share/locale/Makefile: revision 1.5
share/locale/ctype/Makefile: revision 1.28
share/locale/locale.alias: revision 1.11
share/locale/messages/Makefile: revision 1.5
share/locale/messages/en_US.ISO8859-1.src: file removal
share/locale/messages/en_US.US-ASCII.src: revision 1.1
share/locale/messages/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/messages/ja_JP.ct.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-2.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-5.src: revision 1.1
share/locale/messages/sr_YU.ISO8859-2.src: file removal
share/locale/messages/sr_YU.ISO8859-5.src: file removal
share/locale/messages/sr_YU.UTF-8.src: file removal
share/locale/messages/zh_CN.GB18030.src: file removal
share/locale/messages/zh_TW.eucTW.src: revision 1.1
share/locale/monetary/Makefile: revision 1.5
share/locale/monetary/af_ZA.ISO8859-1.src: revision 1.2
share/locale/monetary/am_ET.UTF-8.src: revision 1.2
share/locale/monetary/be_BY.CP1131.src: file removal
share/locale/monetary/be_BY.CP1251.src: revision 1.2
share/locale/monetary/be_BY.ISO8859-5.src: revision 1.2
share/locale/monetary/be_BY.UTF-8.src: revision 1.2
share/locale/monetary/bg_BG.CP1251.src: revision 1.2
share/locale/monetary/bg_BG.UTF-8.src: revision 1.2
share/locale/monetary/ca_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/cs_CZ.ISO8859-2.src: revision 1.2
share/locale/monetary/cs_CZ.UTF-8.src: revision 1.2
share/locale/monetary/da_DK.ISO8859-1.src: revision 1.2
share/locale/monetary/de_AT.ISO8859-1.src: revision 1.2
share/locale/monetary/de_CH.ISO8859-1.src: revision 1.2
share/locale/monetary/de_DE.ISO8859-1.src: revision 1.2
share/locale/monetary/el_GR.ISO8859-7.src: revision 1.2
share/locale/monetary/en_AU.ISO8859-1.src: revision 1.2
share/locale/monetary/en_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.UTF-8.src: revision 1.2
share/locale/monetary/en_IE.UTF-8.src: revision 1.2
share/locale/monetary/en_NZ.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.US-ASCII.src: revision 1.1
share/locale/monetary/es_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/et_EE.ISO8859-15.src: revision 1.2
share/locale/monetary/fi_FI.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_FR.ISO8859-1.src: revision 1.2
share/locale/monetary/he_IL.UTF-8.src: revision 1.2
share/locale/monetary/hi_IN.ISCII-DEV.src: revision 1.2
share/locale/monetary/hr_HR.ISO8859-2.src: revision 1.2
share/locale/monetary/hu_HU.ISO8859-2.src: revision 1.2
share/locale/monetary/hy_AM.ARMSCII-8.src: revision 1.2
share/locale/monetary/hy_AM.UTF-8.src: revision 1.2
share/locale/monetary/is_IS.ISO8859-1.src: revision 1.2
share/locale/monetary/it_IT.ISO8859-1.src: revision 1.2
share/locale/monetary/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/monetary/ja_JP.UTF-8.src: revision 1.2
share/locale/monetary/ja_JP.eucJP.src: revision 1.2
share/locale/monetary/kk_KZ.PT154.src: revision 1.2
share/locale/monetary/kk_KZ.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.eucKR.src: revision 1.2
share/locale/monetary/lt_LT.ISO8859-13.src: revision 1.2
share/locale/monetary/mn_MN.UTF-8.src: revision 1.2
share/locale/monetary/nl_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/nl_NL.ISO8859-1.src: revision 1.2
share/locale/monetary/no_NO.ISO8859-1.src: revision 1.2
share/locale/monetary/pl_PL.ISO8859-2.src: revision 1.2
share/locale/monetary/pl_PL.UTF-8.src: revision 1.2
share/locale/monetary/pt_BR.ISO8859-1.src: revision 1.2
share/locale/monetary/pt_PT.ISO8859-1.src: revision 1.2
share/locale/monetary/ro_RO.ISO8859-2.src: revision 1.2
share/locale/monetary/ru_RU.CP1251.src: revision 1.2
share/locale/monetary/ru_RU.CP866.src: revision 1.2
share/locale/monetary/ru_RU.ISO8859-5.src: revision 1.2
share/locale/monetary/ru_RU.KOI8-R.src: revision 1.2
share/locale/monetary/ru_RU.UTF-8.src: revision 1.2
share/locale/monetary/sk_SK.ISO8859-2.src: revision 1.2
share/locale/monetary/sl_SI.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_ME.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_RS.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_YU.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_YU.ISO8859-5.src: revision 1.2
share/locale/monetary/sr_YU.UTF-8.src: revision 1.2
share/locale/monetary/sv_SE.ISO8859-1.src: revision 1.2
share/locale/monetary/tr_TR.ISO8859-9.src: revision 1.2
share/locale/monetary/uk_UA.CP1251.src: revision 1.2
share/locale/monetary/uk_UA.ISO8859-5.src: revision 1.2
share/locale/monetary/uk_UA.KOI8-U.src: revision 1.2
share/locale/monetary/uk_UA.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.GB18030.src: revision 1.2
share/locale/monetary/zh_CN.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.eucCN.src: revision 1.2
share/locale/monetary/zh_HK.Big5hkscs.src: revision 1.1
share/locale/monetary/zh_HK.UTF-8.src: revision 1.2
share/locale/monetary/zh_TW.Big5.src: revision 1.2
share/locale/numeric/Makefile: revision 1.4
share/locale/numeric/am_ET.UTF-8.src: file removal
share/locale/numeric/en_US.ISO8859-1.src: file removal
share/locale/numeric/en_US.US-ASCII.src: revision 1.1
share/locale/numeric/ja_JP.eucJP.src: file removal
share/locale/numeric/ko_KR.eucKR.src: file removal
share/locale/numeric/mn_MN.UTF-8.src: file removal
share/locale/numeric/sr_ME.ISO8859-2.src: revision 1.1
share/locale/numeric/sr_YU.ISO8859-2.src: file removal
share/locale/numeric/sr_YU.ISO8859-5.src: file removal
share/locale/numeric/zh_CN.eucCN.src: file removal
share/locale/time/Makefile: revision 1.5
share/locale/time/en_US.ISO8859-1.src: file removal
share/locale/time/en_US.US-ASCII.src: revision 1.1
share/locale/time/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/time/ja_JP.ct.src: revision 1.1
share/locale/time/sr_ME.ISO8859-2.src: revision 1.1
share/locale/time/sr_ME.ISO8859-5.src: revision 1.1
share/locale/time/sr_ME.UTF-8.src: revision 1.1
share/locale/time/sr_YU.ISO8859-2.src: file removal
share/locale/time/sr_YU.ISO8859-5.src: file removal
share/locale/time/sr_YU.UTF-8.src: file removal
share/locale/time/zh_CN.GB18030.src: file removal
share/locale/time/zh_TW.eucTW.src: revision 1.1
usr.bin/locale/locale.c: revision 1.6
usr.bin/mklocale/Makefile: revision 1.12
usr.bin/mklocale/lex.l: revision 1.14
usr.bin/mklocale/mklocaledb.c: revision 1.1
usr.bin/mklocale/yacc.y: revision 1.25
usr.sbin/chrtbl/Makefile: revision 1.8
usr.sbin/chrtbl/ctypeio.c: revision 1.1
usr.sbin/chrtbl/ctypeio.h: revision 1.1
Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES}
db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).
[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].
[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().
[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<
old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.69.2.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.75.6.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.75.6.1 30-Oct-2012  yamt sync with head
 1.76.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.80.2.2 20-Mar-2017  pgoyette Sync with HEAD
 1.80.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.83.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.85.6.2 13-Oct-2024  martin Pull up following revision(s) (requested by riastradh in ticket #971):

lib/libc/locale/setlocale_local.h: revision 1.18
lib/libc/string/strerror_r.c: revision 1.6
lib/libc/locale/setlocale.c: revision 1.66
lib/libc/string/Makefile.inc: revision 1.90
lib/libc/locale/global_locale.c: revision 1.29

Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.
 1.85.6.1 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.
 1.90.2.1 02-Aug-2025  perseant Sync with HEAD
 1.23 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.22 28-Jul-2005  christos PR/30845: Luke Mewburn: strerror_r(3) missing
- Merge 4.4BSD strerror.3 man page changes that summarize information
for all the error printing functions. This makes the perror(3) page
obsolete.
- Implement all error functions in terms of strerror_r(), including
__strerror() which is not used internally. Can it be removed?
- Bump version for strerror_r
 1.21 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.20 17-Nov-2002  itojun use strlcpy where it is more appropriate.
 1.19 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.18 13-Feb-2002  yamt make strerror and strsignal use NL_CAT_LOCALE.
 1.17 24-Aug-2001  yamt don't change errno on success.(SUSV2)
this will fix error messages of some commands like setkey(8).
 1.16 20-Sep-1999  lukem branches: 1.16.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.15 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.14 15-Nov-1998  christos delint
 1.13 26-Jul-1998  mycroft const poisoning.
 1.12 16-Feb-1998  lukem don't assume buf is NL_TEXTMAX long
 1.11 03-Feb-1998  perry remove obsolete register declarations
 1.10 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.9 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.8 11-Oct-1996  jtc Since the user provide his own message catalog (via NLSPATH and LANG)
the __strerror() and __strsignal() functions can not assume that the
messages will not overflow a NL_TEXTSIZE-sized buffer.

Noted by Mike Long <mike.long@analog.com> in PR
 1.7 20-Jan-1996  jtc branches: 1.7.2; 1.7.4;
Include errno.h (declarations of sys_errlist and sys_nerr were moved
from stdio.h to errno.h).
 1.6 24-Apr-1995  cgd cast last argument of catgets() to (char *) to quiet compiler's complaints
about loss of 'const'-ness.
 1.5 12-Dec-1994  jtc branches: 1.5.2;
Rework indirect reference support as outlined by my recent message to
the tech-userlevel mailing list.
 1.4 18-Nov-1994  jtc Private versions of cat*() functions now have only one leading underscore.
 1.3 10-Oct-1994  jtc Use __sys_errlist[] & __sys_nerr.
 1.2 06-Oct-1994  jtc Call internal NLS interfaces: __catopen(), __catgets(), and __catclose().
 1.1 03-Sep-1994  jtc __strerror() and __strsignal() have been broken out into their own files
and use message catalogs if NLS is defined.
Increased the size of char buffers used by strerror() and strsignal();
the error and signal strings may be much longer in some locales.
 1.5.2.1 17-Feb-1995  jtc Use namespace.h, back out old mechanism used for namespace purity.
 1.7.4.1 06-Dec-1996  rat Pullup request from Mike Long <mike.long@analog.com>

Avoids buffer overruns as described in PR 2780.
 1.7.2.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.16.10.5 10-Dec-2002  thorpej Sync with HEAD.
 1.16.10.4 11-Nov-2002  nathanw Catch up to -current
 1.16.10.3 22-Mar-2002  nathanw Catch up to -current.
 1.16.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.16.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.28 02-Nov-2024  kre Delete unnecessary definitions of SIGRTMIN & SIGRTMAX

Long ago, SIGRTMIN & SIGRTMAX were #ifdef _KERNEL in
<sys/signal.h> so duplicate definitions were added
here (#ifndef SIGRTMIN so the duplicates vanished for
all practical purposes in 2016 when the symbols were
exposed to userland).

NFC (unless someone hides SIGRTMIN & SIGRTMAX again).
 1.27 02-Nov-2024  kre KNF. NFC.
 1.26 02-Nov-2024  kre Stop attempting to return a (char*) in place of (const char *)

This removes a cast that was added in 1994, when __strsignal()
returned a char * to convert the const char * element of sys_siglist
into a type that matched.

It should have been removed when __strsignal() was changed to
return const char * in 1998. But wasn't.

This should fix an inane warning (treated as an error) from a
compile stupid enough to allow a natural char * (as in char buf[N])
to be returned as a result (which is, of course, fine), but complains
about returning (char *) applied to a (const char *).
 1.25 20-Mar-2012  matt branches: 1.25.42; 1.25.44;
Use C89 Prototypes.
Remove use of __P
 1.24 07-Aug-2003  agc branches: 1.24.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.23 17-Nov-2002  itojun use strlcpy. correct mis(non-)use of buflen argument.
 1.22 11-Nov-2002  thorpej Fix signed/unsigned comparison warnings.
 1.21 20-Mar-2002  christos add rt signal names.
 1.20 13-Feb-2002  yamt make strerror and strsignal use NL_CAT_LOCALE.
 1.19 20-Sep-1999  lukem branches: 1.19.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.18 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.17 30-Nov-1998  thorpej Use the (new) sys_nsig instead of NSIG.
 1.16 15-Nov-1998  christos delint
 1.15 26-Jul-1998  mycroft const poisoning.
 1.14 03-Feb-1998  perry remove obsolete register declarations
 1.13 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.12 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.11 11-Oct-1996  cgd stnrcpy() isn't a function. strncpy() is. Use it instead.
 1.10 11-Oct-1996  jtc Since the user provide his own message catalog (via NLSPATH and LANG)
the __strerror() and __strsignal() functions can not assume that the
messages will not overflow a NL_TEXTSIZE-sized buffer.

Noted by Mike Long <mike.long@analog.com> in PR
 1.9 15-Jun-1995  jtc branches: 1.9.4; 1.9.6;
don't include <sys/cdefs.h>, it's a 'private' header
 1.8 24-Apr-1995  cgd cast last argument of catgets() to (char *) to quiet compiler's complaints
about loss of 'const'-ness.
 1.7 12-Dec-1994  jtc branches: 1.7.2;
Rework indirect reference support as outlined by my recent message to
the tech-userlevel mailing list.
 1.6 18-Nov-1994  jtc Private versions of cat*() functions now have only one leading underscore.
 1.5 19-Oct-1994  cgd case to quiet compiler.
 1.4 10-Oct-1994  jtc Use __sys_siglist[].
 1.3 06-Oct-1994  jtc Call internal NLS interfaces: __catopen(), __catgets(), and __catclose().
 1.2 12-Sep-1994  jtc Don't define sys_siglist, <signal.h> does that already
 1.1 03-Sep-1994  jtc __strerror() and __strsignal() have been broken out into their own files
and use message catalogs if NLS is defined.
Increased the size of char buffers used by strerror() and strsignal();
the error and signal strings may be much longer in some locales.
 1.7.2.1 17-Feb-1995  jtc Use namespace.h, back out old mechanism used for namespace purity.
 1.9.6.1 06-Dec-1996  rat Pullup request from Mike Long <mike.long@analog.com>

Avoids buffer overruns as described in PR 2780.
 1.9.4.1 16-Sep-1996  jtc snapshot namespace cleanup
 1.19.10.4 10-Dec-2002  thorpej Sync with HEAD.
 1.19.10.3 11-Nov-2002  nathanw Catch up to -current
 1.19.10.2 22-Mar-2002  nathanw Catch up to -current.
 1.19.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.24.56.1 17-Apr-2012  yamt sync with head
 1.25.44.1 02-Aug-2025  perseant Sync with HEAD
 1.25.42.1 17-Nov-2024  martin Pull up following revision(s) (requested by kre in ticket #1004):

tools/compat/configure: revision 1.106
lib/libc/string/__strsignal.c: revision 1.26
tools/compat/configure.ac: revision 1.108
tools/compat/nbtool_config.h.in: revision 1.57
usr.bin/elf2aout/elf2aout.c: revision 1.24
tools/compat/Makefile: revision 1.93
sys/arch/macppc/stand/fixcoff/fixcoff.c: revision 1.13
tools/compat/compat_defs.h: revision 1.123

Include <arpa/inet.h> for htonl() (From Jan-Benedict Glaw)
Probably this should be using htobe32() instead of htonl()
(and so <endian.h> rather than <arpa/inet.h>) as there is
no sign of any network anywhere near here. But that's for
another day, and to be done by someone who can test it.

Portability fixes from Jan-Benedict Glaw
The args to help() and usage() need to be const char *
and main() should be declared as returning int.

Add shquote to libnbcompat
Include shquote() in configure tests
Regen for added shquote()

Stop attempting to return a (char*) in place of (const char *)
This removes a cast that was added in 1994, when __strsignal()
returned a char * to convert the const char * element of sys_siglist
into a type that matched.

It should have been removed when __strsignal() was changed to
return const char * in 1998. But wasn't.

This should fix an inane warning (treated as an error) from a
compile stupid enough to allow a natural char * (as in char buf[N])
to be returned as a result (which is, of course, fine), but complains
about returning (char *) applied to a (const char *).
 1.4 19-Aug-2013  joerg GC __indr_reference wrappers.
 1.3 28-Apr-2008  martin branches: 1.3.4; 1.3.8; 1.3.28;
Remove clause 3 and 4 from TNF licenses
 1.2 13-Sep-2005  christos branches: 1.2.18;
compat core reorg.
 1.1 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.2.18.1 18-May-2008  yamt sync with head.
 1.3.28.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.3.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.3.8.1 28-Apr-2008  martin file _strerror_r.c was added on branch christos-time_t on 2008-04-28 20:23:01 +0000
 1.3.4.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.6 19-Aug-2013  joerg GC __indr_reference wrappers.
 1.5 21-Oct-2009  snj branches: 1.5.6; 1.5.12;
Remove 3rd and 4th clauses in christos' license. OK christos.
 1.4 13-Sep-2005  christos compat core reorg.
 1.3 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.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 17-Apr-2002  kleink branches: 1.1.2; 1.1.4;
Need internal names for strlcat() and strlcpy().
 1.1.4.2 25-Apr-2002  nathanw Catch up to -current.
 1.1.4.1 17-Apr-2002  nathanw file _strlcat.c was added on branch nathanw_sa on 2002-04-25 04:01:46 +0000
 1.1.2.2 22-Apr-2002  he Pull up revision 1.1 (new, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.1.2.1 17-Apr-2002  he file _strlcat.c was added on branch netbsd-1-5 on 2002-04-22 22:02:42 +0000
 1.5.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.6.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.6 19-Aug-2013  joerg GC __indr_reference wrappers.
 1.5 21-Oct-2009  snj branches: 1.5.6; 1.5.12;
Remove 3rd and 4th clauses in christos' license. OK christos.
 1.4 13-Sep-2005  christos compat core reorg.
 1.3 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.2 12-Jun-2005  lukem Add missing __RCSID()
 1.1 17-Apr-2002  kleink branches: 1.1.2; 1.1.4;
Need internal names for strlcat() and strlcpy().
 1.1.4.2 25-Apr-2002  nathanw Catch up to -current.
 1.1.4.1 17-Apr-2002  nathanw file _strlcpy.c was added on branch nathanw_sa on 2002-04-25 04:01:46 +0000
 1.1.2.2 22-Apr-2002  he Pull up revision 1.1 (new, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.1.2.1 17-Apr-2002  he file _strlcpy.c was added on branch netbsd-1-5 on 2002-04-22 22:03:13 +0000
 1.5.12.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.5.6.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.14 05-May-2012  dholland Mark these obsolete as well.
 1.13 29-Apr-2010  jruoho branches: 1.13.6;
Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.10 07-Feb-2002  ross Generate <>& symbolically.
 1.9 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.8 22-Mar-1999  garbled branches: 1.8.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.7 05-Feb-1998  perry add LIBRARY section to man page
 1.6 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 25-Nov-1993  jtc Don't cross-reference ourself.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.13.6.1 23-May-2012  yamt sync with head.
 1.15 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.12 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.11 01-Apr-1999  simonb Slight cleanup - no functional change.
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 24-Oct-1996  cgd pull up from libkern:
>when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.5 18-Apr-1996  cgd branches: 1.5.2;
don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 04-Feb-1996  jtc gcc -Wall cleanup from John Birrell <jb@cimlogic.com.au>.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.2.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.15 20-Jun-2015  dholland PR 49988 Kamil Rytarowski: fix pasto
 1.14 05-May-2012  dholland Mark these obsolete as well.
 1.13 29-Apr-2010  wiz branches: 1.13.6;
Add punctuation.
 1.12 29-Apr-2010  jruoho Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.7 22-Mar-1999  garbled branches: 1.7.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.6 05-Feb-1998  perry add LIBRARY section to man page
 1.5 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.13.6.1 23-May-2012  yamt sync with head.
 1.16 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.14 04-Jul-2002  kent memcpy/memmove/bcopy: Add diagnostic code to check pointer wraparound.
The code is enabled only when _DIAGNOSTIC is defined.
 1.13 08-Feb-2001  wiz branches: 1.13.2;
De-lint. Reviewed by christos.
 1.12 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 22-Feb-1998  mycroft Add the same protection as other files have for _KERNEL, which at least works
for the kernel.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 15-Jun-1995  jtc branches: 1.5.4;
don't include <sys/cdefs.h>, it's a 'private' header
 1.4 19-Oct-1994  cgd be a bit more careful with types.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.4.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.13.2.1 01-Aug-2002  nathanw Catch up to -current.
 1.9 23-Jan-2016  dholland Update synopses to match u_int/u_long/etc. changes. Do not bump date as
it's not a substantive change.
 1.8 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.7 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.6 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.5 07-Feb-2002  ross Generate <>& symbolically.
 1.4 09-Apr-2001  wiz mdoc'ify
 1.3 09-Oct-1997  lukem branches: 1.3.14;
rcsid police
 1.2 22-Jun-1994  cgd rcs id's
 1.1 22-Jun-1994  cgd add Boyer-Moore string search routines, from Bostic. man page
needs to be fixed for mandoc, and RCSID's need to be added.
 1.3.14.3 22-Mar-2002  nathanw Catch up to -current.
 1.3.14.2 08-Mar-2002  nathanw Catch up to -current.
 1.3.14.1 08-Oct-2001  nathanw Catch up to -current.
 1.13 23-Jun-2014  shm PR/42032 fixed overrun in bm_exec(), free(3) clean ups
 1.12 25-Jun-2012  abs branches: 1.12.2; 1.12.8;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.11 07-Aug-2003  agc branches: 1.11.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 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.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 04-Feb-1996  jtc branches: 1.4.2;
gcc -Wall cleanup from John Birrell <jb@cimlogic.com.au>.
 1.3 14-Dec-1994  cgd fix for bug 638
 1.2 22-Jun-1994  cgd rcs id's
 1.1 22-Jun-1994  cgd add Boyer-Moore string search routines, from Bostic. man page
needs to be fixed for mandoc, and RCSID's need to be added.
 1.4.2.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.11.56.1 30-Oct-2012  yamt sync with head
 1.12.8.1 10-Aug-2014  tls Rebase.
 1.12.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.11 17-Feb-2007  wiz o Removed functions that are in strings.h, not string.h
o Added memmem
o Bump date

From Slava Semushin in private mail.
 1.10 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.13 29-Apr-2010  jruoho Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.10 07-Feb-2002  ross Generate <>& symbolically.
 1.9 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.8 22-Mar-1999  garbled branches: 1.8.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.7 05-Feb-1998  perry add LIBRARY section to man page
 1.6 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 25-Nov-1993  jtc BDS -> BSD
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.9 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.8 04-Aug-1998  perry switch bzero to version in memset.c.
bzero.c is now a "#define BZERO//#include memset.c" type file.
Remove comment from Makefile about the fact that this is on the todo list.
 1.7 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.6 03-Feb-1998  perry remove obsolete register declarations
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 18-Apr-1996  cgd branches: 1.4.2;
don't include user-land headers compiling for libkern. (sync with libkern.)
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.2.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.2 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.1 23-Jun-2013  riastradh Add man pages and xrefs for consttime_bcmp and explicit_bzero.

ok wiz
 1.5 23-Mar-2015  apb Explain why there is no consttime_memcmp().

Inspired by a patch from Kamil Rytarowski.
 1.4 14-Nov-2014  wiz bump year
 1.3 14-Nov-2014  riastradh Commit to returning 1, not any nonzero value.
 1.2 28-Aug-2013  riastradh branches: 1.2.4; 1.2.6; 1.2.8;
Fix sense of consttime_memequal and update all callers.

Now it returns true (nonzero) to mean equal and false (zero) to mean
inequal, as the name suggests.

As promised on tech-userlevel back in June:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
 1.1 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 28-Aug-2013  tls file consttime_memequal.3 was added on branch tls-maxphys on 2014-08-20 00:02:16 +0000
 1.2.6.1 18-Mar-2015  snj Pull up following revision(s) (requested by riastradh in ticket #610):
lib/libc/string/consttime_memequal.3: revision 1.3, 1.4
Commit to returning 1, not any nonzero value.
--
bump year
 1.2.4.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.2.4.1 28-Aug-2013  yamt file consttime_memequal.3 was added on branch yamt-pagecache on 2014-05-22 11:36:54 +0000
 1.2 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.1 23-Jun-2013  riastradh Add man pages and xrefs for consttime_bcmp and explicit_bzero.

ok wiz
 1.3 02-Nov-2024  riastradh memset_explicit(3): Add C23 alias for explicit_memset.

PR standards/58607: C23: <string.h> memset_explicit
 1.2 28-Aug-2013  riastradh branches: 1.2.4; 1.2.8; 1.2.42;
Make explicit_memset match memset's return value.
 1.1 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.2.42.1 02-Aug-2025  perseant Sync with HEAD
 1.2.8.2 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.8.1 28-Aug-2013  tls file explicit_memset.3 was added on branch tls-maxphys on 2014-08-20 00:02:16 +0000
 1.2.4.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.2.4.1 28-Aug-2013  yamt file explicit_memset.3 was added on branch yamt-pagecache on 2014-05-22 11:36:54 +0000
 1.14 01-Nov-2024  riastradh ffs(3): Fix visibility in strings.h and add MLINKS for ffsl/ffsll.

ffs(3) was added in POSIX 2001 with XSI option (_XOPEN_SOURCE>=600),
not in POSIX 2008 with XSI option (_XOPEN_SOURCE>=700).

Noticed while updating the STANDARDS section of the man page.

PR lib/58802: missing ffsl(), ffsll() functions from POSIX 2024
 1.13 28-Apr-2010  jruoho branches: 1.13.58;
Only put the actual header for the .In line.
 1.12 28-Apr-2010  jruoho Reference ffs32(3). Also note POSIX compliance and the movement of the
header from <string.h> to <strings.h>.
 1.11 21-Jul-2009  wiz Xref popcount(3).
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 07-Feb-2002  ross Generate <>& symbolically.
 1.7 05-Feb-1998  perry branches: 1.7.12;
add LIBRARY section to man page
 1.6 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 10-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.13.58.1 02-Aug-2025  perseant Sync with HEAD
 1.11 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 18-Apr-1996  cgd branches: 1.5.2;
don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.2.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.15 05-May-2012  dholland Bump date for previous.
 1.14 05-May-2012  dholland Describe these as obsolete.
 1.13 29-Apr-2010  jruoho branches: 1.13.6;
Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
 1.12 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.7 05-Feb-1998  perry branches: 1.7.12;
add LIBRARY section to man page
 1.6 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.5 30-Jan-1998  perry update to lite-2
 1.4 06-Dec-1997  mikel fix typo (s/A/An/)
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.13.6.1 23-May-2012  yamt sync with head.
 1.15 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.14 30-Nov-2005  martin Fix warns=4 (via __UNCONST())
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 09-Feb-2001  wiz De-lint. Reviewed by Christos.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 21-Jan-1998  cgd add appropriate #ifdefs (kernel includes) so that these files can
be copied to libkern and built without modification.
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 11-Jun-1994  jtc branches: 1.4.8;
Remove unneeded #include <stddef.h> because <string.h> #defines NULL too.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.8.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.11 15-Jul-2024  wiz memccpy(3): add STANDARDS section

With input from kre@
 1.10 16-Oct-2006  wiz branches: 1.10.96;
nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 03-Feb-1998  perry .Bx'ize
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.10.96.1 02-Aug-2025  perseant Sync with HEAD
 1.13 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.12 07-Aug-2003  agc branches: 1.12.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.5 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.4 02-Aug-1993  mycroft Nuke remaining patchkit headers.
 1.3 01-Aug-1993  mycroft Add RCS identifiers.
 1.2 21-Mar-1993  cgd after 0.2.2 "stable" patches applied
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.56.1 30-Oct-2012  yamt sync with head
 1.11 10-Apr-2009  wiz Split Nm over two lines.
 1.10 10-Apr-2009  christos add memrchr
 1.9 16-Oct-2006  wiz branches: 1.9.28;
nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.9.28.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.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 29-Nov-2005  christos fix warns=4
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 21-Jan-1998  cgd add appropriate #ifdefs (kernel includes) so that these files can
be copied to libkern and built without modification.
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.10 23-Jun-2013  riastradh Add man pages and xrefs for consttime_bcmp and explicit_bzero.

ok wiz
 1.9 07-Aug-2003  agc branches: 1.9.56; 1.9.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 12-Nov-1996  lukem fix the the typos
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.9.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.56.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.13 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 15-Aug-1996  jtc #ifdef _KERNEL, #include <lib/libkern/libkern.h> instead of <string.h>.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.15 13-Aug-2023  wiz memcpy: consistency in prototype and fix sentence
 1.14 01-Aug-2023  christos Add companion mempcpy to wmempcpy, bump.
 1.13 08-Sep-2003  wiz Use St -isoC-9X instead of St -isoC9X, to be in sync with groff.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.10 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 07-Jul-2001  perry Note explicitly that memcpy does not guarantee good behavior on overlap.
 1.7 06-Jul-2001  tv memcpy(3) is not guaranteed to do overlaps, contrary to this historical
manpage "BUGS" section. Nuke the entire section.
Addresses PR lib/13370.
 1.6 22-Mar-2001  kleink Sprinkle some restrict qualifiers.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.4 18-Oct-2002  nathanw Catch up to -current.
 1.5.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 04-Aug-1998  perry Replace complicated and ugly makefile gook to make memmove,memcpy by
-Ding the bcopy.c source (and similarly strchr from index.c, strrchr
from rindex.c) with stub .c files for memmove, memcpy, strchr and
strrchr that simply #define the appropriate thing and #include the
appropriate .c file. Inspired by the way many m-d .S files handle the
same thing. This radically simplifies the Makefile.inc for libc/string
(and libkern).
 1.4 01-Nov-2024  nia libc: Expose some newly-standard C functions in POSIX.1-2024 mode
 1.3 30-Apr-2008  martin branches: 1.3.8; 1.3.76;
Convert TNF licenses to new 2 clause variant
 1.2 14-Mar-2005  wiz branches: 1.2.24;
Remove one of two nearly duplicate words.
 1.1 13-Mar-2005  perry Add memmem(3), compatible with version in Linux
 1.2.24.1 18-May-2008  yamt sync with head.
 1.3.76.1 02-Aug-2025  perseant Sync with HEAD
 1.3.8.2 30-Apr-2008  martin Convert TNF licenses to new 2 clause variant
 1.3.8.1 30-Apr-2008  martin file memmem.3 was added on branch christos-time_t on 2008-04-30 13:10:52 +0000
 1.3 08-Jul-2018  christos switch to FreeBSD's memmem
 1.2 28-Apr-2008  martin branches: 1.2.8; 1.2.62; 1.2.64;
Remove clause 3 and 4 from TNF licenses
 1.1 13-Mar-2005  perry branches: 1.1.24;
Add memmem(3), compatible with version in Linux
 1.1.24.1 18-May-2008  yamt sync with head.
 1.2.64.1 10-Jun-2019  christos Sync with HEAD
 1.2.62.1 28-Jul-2018  pgoyette Sync with HEAD
 1.2.8.2 28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.2.8.1 28-Apr-2008  martin file memmem.c was added on branch christos-time_t on 2008-04-28 20:23:01 +0000
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 04-Aug-1998  perry Replace complicated and ugly makefile gook to make memmove,memcpy by
-Ding the bcopy.c source (and similarly strchr from index.c, strrchr
from rindex.c) with stub .c files for memmove, memcpy, strchr and
strrchr that simply #define the appropriate thing and #include the
appropriate .c file. Inspired by the way many m-d .S files handle the
same thing. This radically simplifies the Makefile.inc for libc/string
(and libkern).
 1.1 01-Aug-2023  christos Add companion mempcpy to wmempcpy, bump.
 1.2 11-Apr-2009  christos branches: 1.2.2;
make this work properly, by moving to the end of the buffer before starting
the search.
remove clauses 3 + 4.
 1.1 10-Apr-2009  christos add memrchr
 1.2.2.2 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.2.1 11-Apr-2009  jym file memrchr.c was added on branch jym-xensuspend on 2009-05-13 19:18:27 +0000
 1.13 04-Aug-2016  sevan Grammar
 1.12 24-Jun-2013  wiz branches: 1.12.10;
Fix xref.
 1.11 24-Jun-2013  riastradh Replace consttime_bcmp/explicit_bzero by consttime_memequal/explicit_memset.

consttime_memequal is the same as the old consttime_bcmp.
explicit_memset is to memset as explicit_bzero was to bcmp.

Passes amd64 release and i386/ALL, but I'm sure I missed some spots,
so please let me know.
 1.10 23-Jun-2013  riastradh Add man pages and xrefs for consttime_bcmp and explicit_bzero.

ok wiz
 1.9 07-Aug-2003  agc branches: 1.9.56; 1.9.62;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 26-Aug-1997  kleink Add missing "RETURN VALUES" section; from Krister Walfridsson
<cato@ulysses.df.lth.se> in PR lib/4028.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.9.62.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.9.56.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.12.10.1 06-Aug-2016  pgoyette Sync with HEAD
 1.17 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 08-Feb-2001  wiz De-lint. Reviewed by christos.
 1.14 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.13 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.12 09-Aug-1998  wrstuden 'c' is only used #ifndef BZERO so wrap its declaration accordingly.
 1.11 27-Mar-1998  cgd limits.h if user-land, machine/limits.h if kernel or standalone
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 04-Feb-1998  thorpej Cast pointers to u_long before masking them, not int.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 15-Aug-1996  jtc #ifdef _KERNEL, #include <lib/libkern/libkern.h> instead of <string.h>.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6 14-Jul-2016  abhinav Fix grammar.
 1.5 22-Aug-2011  dholland Add patch from Klaus Klein in PR 45258 to note that popcount32/64
require <stdint.h>.
 1.4 22-Jul-2009  wiz Add comma in enumeration.
 1.3 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.2 21-Jul-2009  wiz Fix typo, add comma in enumeration.
 1.1 21-Jul-2009  joerg Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
 1.2 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.1 21-Jul-2009  joerg Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
 1.2 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.1 21-Jul-2009  joerg Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
 1.2 21-Jul-2009  joerg Move popcount et al to src/common and add popcount32/popcount64.
Requested by rmind@. MD should now override popcount32/popcount64 and
provide the aliases as fitting.
 1.1 21-Jul-2009  joerg Add popcount(3) and the long and long long version. Name is inspired by
gnulib, the implementation goes back to the AMD Software Optimizer
guide. A number of platforms will want to replace the C version with
assembler code using native instructions.
 1.14 05-May-2012  dholland Bump date for previous.
 1.13 05-May-2012  dholland Describe these as obsolete.
 1.12 29-Apr-2010  jruoho branches: 1.12.6;
Add some STANDARDS lingo, mainly to note the functions that have been
removed from POSIX (2008).
 1.11 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 07-Feb-2002  ross Generate <>& symbolically.
 1.7 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.12.6.1 23-May-2012  yamt sync with head.
 1.15 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.14 30-Nov-2005  martin Fix warns=4 via __UNCONST()
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 09-Feb-2001  wiz De-lint. Reviewed by Christos.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 21-Jan-1998  cgd add appropriate #ifdefs (kernel includes) so that these files can
be copied to libkern and built without modification.
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 11-Jun-1994  jtc branches: 1.4.8;
Remove unneeded #include <stddef.h> because <string.h> #defines NULL too.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.8.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.2 06-Nov-2013  tron Fix build problems.
 1.1 01-May-2009  perry branches: 1.1.2; 1.1.8; 1.1.14;
Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.1.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.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.1.2.2 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.2.1 01-May-2009  jym file stpcpy.c was added on branch jym-xensuspend on 2009-05-13 19:18:27 +0000
 1.2 06-Nov-2013  tron Fix build problems.
 1.1 01-May-2009  perry branches: 1.1.2; 1.1.8; 1.1.14;
Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.1.14.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.1.8.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.1.2.2 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.2.1 01-May-2009  jym file stpncpy.c was added on branch jym-xensuspend on 2009-05-13 19:18:27 +0000
 1.21 13-Jul-2016  abhinav Fix grammar and be consistent between using zero and 0.
 1.20 12-Jul-2016  wiz Add missing word.
 1.19 12-Jul-2016  abhinav Fix sentence
 1.18 12-Jul-2016  abhinav Add STANDARDS section.
It is part of IEEE Std 1003.1-2001 and 2008, both, but there doesn't seem to be
any difference between the two versions, therefore referencing the older standard.
 1.17 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 10-May-2003  wiz Grammar improvement from jmc@openbsd.
 1.14 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.13 07-Feb-2002  ross Generate <>& symbolically.
 1.12 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.11 18-Apr-1999  ad branches: 1.11.10;
Correct omission made during last fix of HISTORY section.
 1.10 18-Apr-1999  ad Fix HISTORY section (somebody hacked the end off it).
 1.9 23-Oct-1998  tron Add note about special case when calling strcmp() or strcasecmp() with
len = 0 as suggested by Jaromir Dolecek in PR lib/6344.
 1.8 05-Feb-1998  perry add LIBRARY section to man page
 1.7 03-Feb-1998  perry .Bx'ize
 1.6 03-Feb-1998  kleink Update SYNOPSIS: the function prototypes reside in <strings.h>.
 1.5 30-Jan-1998  perry update to lite-2
 1.4 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.3 09-Oct-1997  lukem branches: 1.3.2;
rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.2.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.11.10.3 22-Mar-2002  nathanw Catch up to -current.
 1.11.10.2 08-Mar-2002  nathanw Catch up to -current.
 1.11.10.1 08-Oct-2001  nathanw Catch up to -current.
 1.17 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 22-Apr-2003  junyoung Use unsigned char rather than u_char.
 1.14 19-Nov-2002  junyoung "namespace.h" should precede all included headers other than <sys/cdefs.h>.
 1.13 19-Nov-2002  junyoung Include <sys/types.h> for u_char instead of a local definition of it.
 1.12 22-Jan-2000  mycroft branches: 1.12.6; 1.12.8;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 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.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 02-Jun-1997  kleink Add support for localized character sets (a.k.a. LC_CTYPE).

Thanks go to Matthias Scheler <tron@lyssa.owl.de> for contributing his initial
work in PR/3592, and to Christos Zoulas for refining it!
 1.4 15-Jun-1995  jtc branches: 1.4.4;
don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.4.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.12.8.1 24-Sep-2003  tron Pull up revision 1.15 (requested by junyoung in ticket #1470):
Use unsigned char rather than u_char.
 1.12.6.1 10-Dec-2002  thorpej Sync with HEAD.
 1.3 29-Nov-2005  christos WARNS=4
 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 03-Jul-2004  junyoung branches: 1.1.2;
Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.
 1.1.2.2 12-Jul-2004  he Pull up revision 1.1 (new, requested by junyoung in ticket #638):
Add strcasestr(3), case insensitive version of strstr(3).
 1.1.2.1 03-Jul-2004  he file strcasestr.c was added on branch netbsd-2-0 on 2004-07-12 20:53:40 +0000
 1.16 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.15 08-Sep-2003  wiz Use St -isoC-9X instead of St -isoC9X, to be in sync with groff.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.12 07-Jan-2003  wiz Remove superfluous word.
 1.11 11-Aug-2002  yamt bump .Dd .
 1.10 11-Aug-2002  yamt bring in EXAMPLES from openbsd.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 22-Mar-2001  kleink Sprinkle some restrict qualifiers.
 1.7 28-Sep-1999  lukem branches: 1.7.8;
xref strlcpy & strlcat
 1.6 05-Feb-1998  perry branches: 1.6.2; 1.6.4;
add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.3 09-Oct-1997  lukem branches: 1.3.2;
rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.2.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.6.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.6.2.1 05-Jul-2000  he Pull up revision 1.7 (requested by he):
Add reference to newly added strlcat() and strlcpy().
 1.7.8.5 08-Jan-2003  thorpej Sync with HEAD.
 1.7.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.7.8.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.8.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 21-Jul-1997  mrg KNF and help gcc optimise for registers better.
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 04-Feb-1996  jtc gcc -Wall cleanup from John Birrell <jb@cimlogic.com.au>.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.15 31-Jan-2023  simonb Note that strchrnul() first appeared in glibc 2.1.1 and appeared in
FreeBSD 10 before it appeared in NetBSD 8.
 1.14 26-Nov-2020  rillig fix typo in manual page for strchrnul(3)
 1.13 16-Oct-2016  wiz Add missing word.
 1.12 12-Oct-2016  christos add strchrnul
 1.11 07-Aug-2003  agc branches: 1.11.80;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.9 11-Aug-2002  yamt bring in EXAMPLES from OpenBSD.
 1.8 07-Feb-2002  ross Generate <>& symbolically.
 1.7 05-Feb-1998  perry branches: 1.7.12;
add LIBRARY section to man page
 1.6 30-Jan-1998  perry update to lite-2
 1.5 30-Dec-1997  mikel pointers are NULL, NUL is a char; deraadt@openbsd.org
 1.4 09-Oct-1997  lukem rcsid police
 1.3 10-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.12.3 13-Aug-2002  nathanw Catch up to -current.
 1.7.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.11.80.1 04-Nov-2016  pgoyette Sync with HEAD
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 04-Aug-1998  perry Replace complicated and ugly makefile gook to make memmove,memcpy by
-Ding the bcopy.c source (and similarly strchr from index.c, strrchr
from rindex.c) with stub .c files for memmove, memcpy, strchr and
strrchr that simply #define the appropriate thing and #include the
appropriate .c file. Inspired by the way many m-d .S files handle the
same thing. This radically simplifies the Makefile.inc for libc/string
(and libkern).
 1.14 14-Jul-2016  abhinav Add missing words and fix grammar.
 1.13 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 10-May-2003  wiz Grammar improvement from jmc@openbsd.
 1.10 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.7 23-Oct-1998  tron branches: 1.7.12;
Add note about special case when calling strcmp() or strcasecmp() with
len = 0 as suggested by Jaromir Dolecek in PR lib/6344.
 1.6 05-Feb-1998  perry add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.3 09-Oct-1997  lukem branches: 1.3.2;
rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.2.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.7.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 24-Oct-1996  cgd pull up from libkern:
>when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.5 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 10-May-2003  wiz Grammar improvement from jmc@openbsd.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.12 17-May-2013  joerg Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.11 19-Apr-2013  joerg Add dummy strcoll_l and strxfrm_l.
 1.10 25-Jun-2012  abs branches: 1.10.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.9 07-Aug-2003  agc branches: 1.9.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 20-Sep-1999  lukem branches: 1.8.6;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.7 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.6.2 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.8.6.1 28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.9.56.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.9.56.1 30-Oct-2012  yamt sync with head
 1.10.2.1 23-Jun-2013  tls resync from head
 1.27 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.
 1.26 11-Aug-2023  riastradh strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.
 1.25 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)
 1.24 11-Aug-2023  riastradh strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.
 1.23 01-Apr-2015  riastradh branches: 1.23.26;
Strengthen prohibition against overlapping in strcpy(3).
 1.22 01-Apr-2015  christos grammar.
 1.21 01-Apr-2015  christos clarify what happens when strings overlap.
 1.20 02-May-2009  wiz Improve formatting and punctuation for "NUL-terminate".
 1.19 02-May-2009  wiz Sort sections.
 1.18 01-May-2009  perry Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.17 16-Oct-2006  wiz branches: 1.17.28;
nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.16 08-Sep-2003  wiz Use St -isoC-9X instead of St -isoC9X, to be in sync with groff.
 1.15 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.14 06-May-2003  wiz s/>/\*[Gt]/
 1.13 06-May-2003  lukem Clarify what strncpy() does when the length of `src' is `len'.
Noted by Christoph Kaegi on tech-userlevel@.
Add missing "function".
 1.12 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.11 11-Aug-2002  yamt improve EXAMPLES.
from openbsd.
 1.10 07-Feb-2002  ross Generate <>& symbolically.
 1.9 22-Mar-2001  kleink Sprinkle some restrict qualifiers.
 1.8 28-Sep-1999  lukem branches: 1.8.8;
xref strlcpy & strlcat
 1.7 22-Mar-1999  garbled branches: 1.7.2; 1.7.4;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.6 05-Feb-1998  perry add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 14-Nov-1997  mrg add missing .Nm entries. from spz@serpens.swb.de.
 1.3 09-Oct-1997  lukem branches: 1.3.2;
rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.2.1 14-Nov-1997  mrg pull up from trunk: add missing .Nm entries. from spz@serpens.swb.de.
 1.7.4.1 27-Dec-1999  wrstuden Pull up to last week's -current.
 1.7.2.1 05-Jul-2000  he Pull up revision 1.8 (requested by he):
Add reference to newly added strlcat() and strlcpy().
 1.8.8.4 13-Aug-2002  nathanw Catch up to -current.
 1.8.8.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.8.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.8.1 08-Oct-2001  nathanw Catch up to -current.
 1.17.28.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.23.26.1 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.
 1.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.5 04-Feb-1996  jtc gcc -Wall cleanup from John Birrell <jb@cimlogic.com.au>.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 11-Aug-2002  yamt bring in EXAMPLES from openbsd.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.3 13-Aug-2002  nathanw Catch up to -current.
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.19 19-Jul-2014  lneto lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
 1.18 21-Mar-2012  christos branches: 1.18.2; 1.18.8;
size_t -> uint8_t
 1.17 30-Jul-2009  dsl branches: 1.17.6;
Use a 'register only' str[c]spn() on 64 bit systems.
 1.16 30-Jul-2008  joerg branches: 1.16.6;
Before using the slightly more involved bitmap tables,
check that the charset for strspn/strcspn is non-trivial.
An empty charset is either a direct return or a strlen and
a single charset a simple loop.
 1.15 23-Feb-2008  christos branches: 1.15.4;
use the proper variable.
 1.14 23-Feb-2008  christos fix lint issues.
 1.13 22-Feb-2008  joerg Also cast before anding the characters.
 1.12 22-Feb-2008  joerg Add some explicit casts to stop GCC complains about signed char shifts.
 1.11 22-Feb-2008  joerg Replace O(nm) versions of strspn, strcspn and strpbrk with O(n+m)
implementations based on the suggestions I made for DragonFly's libc
ages ago. For charset with more than one entry and iterating over the
first two characters of s, this is consistently faster on amd64.
 1.10 07-Aug-2003  agc branches: 1.10.22; 1.10.28;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.28.1 24-Mar-2008  keiichi sync with head.
 1.10.22.1 23-Mar-2008  matt sync with HEAD
 1.15.4.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.16.6.2 30-Jul-2008  joerg Before using the slightly more involved bitmap tables,
check that the charset for strspn/strcspn is non-trivial.
An empty charset is either a direct return or a strlen and
a single charset a simple loop.
 1.16.6.1 30-Jul-2008  joerg file strcspn.c was added on branch christos-time_t on 2008-07-30 16:14:00 +0000
 1.17.6.1 17-Apr-2012  yamt sync with head
 1.18.8.1 10-Aug-2014  tls Rebase.
 1.18.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.19 09-Dec-2024  nros memccpy, strdup and strndup are in C23

7.26.2.2 memccpy
7.26.2.6 strdup
7.26.2.7 strndup
 1.18 29-Jan-2009  wiz branches: 1.18.60;
Bump date for new STANDARDS section.
 1.17 28-Jan-2009  gdt Note that strdup is specified by POSIX.1.
 1.16 22-Jun-2008  wiz branches: 1.16.6;
Note that strndup was recently (4.0) added. Bump date.
 1.15 16-Oct-2006  wiz branches: 1.15.18;
nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.14 13-Aug-2006  wiz Mark up NULL.
 1.13 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.12 07-Aug-2003  agc branches: 1.12.12;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.10 11-Aug-2002  yamt bring in EXAMPLES and ERRORS from openbsd.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 05-Jul-2000  enami branches: 1.8.2;
s/Xt/Xr/
 1.7 05-Feb-1998  perry add LIBRARY section to man page
 1.6 03-Feb-1998  perry .Bx'ize
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 01-Dec-1993  jtc Manpage formatting tweaks.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.8.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.12.12.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.15.18.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.16.6.2 22-Jun-2008  wiz Note that strndup was recently (4.0) added. Bump date.
 1.16.6.1 22-Jun-2008  wiz file strdup.3 was added on branch christos-time_t on 2008-06-22 11:02:08 +0000
 1.18.60.1 02-Aug-2025  perseant Sync with HEAD
 1.14 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.13 07-Aug-2003  agc branches: 1.13.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 13-Oct-1998  kleink Need an internal name for strdup().
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 15-Jun-1995  jtc branches: 1.6.4;
don't include <sys/cdefs.h>, it's a 'private' header
 1.5 14-Apr-1995  jtc bcopy -> memcpy
 1.4 11-Jun-1994  jtc Remove unneeded #include <stddef.h> because <string.h> #defines NULL too.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.4.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.13.56.1 30-Oct-2012  yamt sync with head
 1.24 04-Apr-2020  dholland Move the note about sys_errlist[] users to COMPATIBILITY, and strengthen it.
 1.23 04-Apr-2020  dholland Add missing ERRORS section.
 1.22 04-Apr-2020  dholland Minor clarification. And a typo. Bump date.
 1.21 25-Mar-2020  kre Delete the BUGS paragraph about the "missing" const qualifier for the
result type of strerror() (and strerror_l()). While that once should
really have been present, when strerror() was invented, there was no
"const" qualifier in C to apply, and now the way the code is writtem
(really needs to be because of NLS support) the const is no longer
really appropriate.

Applications still shouldn't attempt to modify the result however.
 1.20 25-Mar-2020  kre Document strerror_l()

While here also document (but comment it out since it isn't
available - yet) strerror_lr(). To include that, simply
uncomment the relevant lines, and (twice I think) s/returns/return/
on lines just after currently commented out lines (that is, it
currently says, "A returns" after the comments are returned, we
need it to be "A and B return" - the "and B" appears when the comment
markers are removed, removing the 's' from returns must be done manually.

In addition to adding strerror_l() some additional enhancements were
made to the general strerror() doc.
 1.19 03-Jul-2017  wiz branches: 1.19.6;
Remove workaround for ancient HTML generation code.
 1.18 09-May-2015  dholland Update HISTORY from OpenBSD: strerror from 4.3 Reno, perror from v4.
(this page was claiming both were from 4.4, which is clearly rubbish)
 1.17 25-Oct-2010  wiz Bump date.
 1.16 24-Oct-2010  dholland Mention err/warn. Note that they're generally preferred to perror().
Might want to strengthen the wording.
 1.15 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.14 22-May-2006  wiz Punctuation nit.
 1.13 22-May-2006  kleink Clarify that strerror() doesn't return EINVAL but stores in errno;
prompted by Thomas Klausner.
 1.12 29-Jul-2005  wiz < -> \*[Lt], end sentence with a dot, add comma
in enumeration, add RCS Id (lost in previous), fix numbering of license clauses
(broken in previous).
 1.11 28-Jul-2005  christos PR/30845: Luke Mewburn: strerror_r(3) missing
- Merge 4.4BSD strerror.3 man page changes that summarize information
for all the error printing functions. This makes the perror(3) page
obsolete.
- Implement all error functions in terms of strerror_r(), including
__strerror() which is not used internally. Can it be removed?
- Bump version for strerror_r
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 07-Feb-2002  ross Generate <>& symbolically.
 1.7 22-Mar-1999  garbled branches: 1.7.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.6 05-Feb-1998  perry add LIBRARY section to man page
 1.5 09-Oct-1997  lukem rcsid police
 1.4 03-Jul-1995  jtc remove bogus sys_errlist(3) cross reference
 1.3 02-Aug-1994  jtc branches: 1.3.2;
Minor touch ups to match strsignal(3) man page
 1.2 10-Jan-1994  jtc Fix spelling errors.
 1.1 07-Oct-1993  jtc branches: 1.1.1;
Moved strerror.[c3] from libc/stdio to libc/string.
Since perror is not permitted to change strerror()'s static buffer, I have
changed both functions to pass their own buffers to the new library-internal
function _strerror() that actually does the error message string look up.
Split strerror manpage into strerror and perror manpages.
 1.1.1.1 30-Jan-1998  perry import lite-2
 1.3.2.2 02-Aug-1994  jtc Minor touch ups to match strsignal(3) man page
 1.3.2.1 02-Aug-1994  jtc file strerror.3 was added on branch netbsd-1-0 on 1994-08-02 05:02:14 +0000
 1.7.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.7.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.19.6.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.18 25-Mar-2020  kre Protect against malloc failure corrupting errno, which is not
permitted of these functions.
 1.17 20-Jan-2015  christos branches: 1.17.16;
Fix non _REENTRANT build.
 1.16 02-Sep-2013  joerg Missing alias for strerror_l.
 1.15 19-Aug-2013  joerg Add strerror_l.
 1.14 26-Jan-2006  kleink branches: 1.14.44; 1.14.50;
Must include "namespace.h" for strerror_r()'s internal name.
 1.13 28-Jul-2005  christos PR/30845: Luke Mewburn: strerror_r(3) missing
- Merge 4.4BSD strerror.3 man page changes that summarize information
for all the error printing functions. This makes the perror(3) page
obsolete.
- Implement all error functions in terms of strerror_r(), including
__strerror() which is not used internally. Can it be removed?
- Bump version for strerror_r
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 15-Nov-1998  christos delint
 1.10 27-Jul-1998  mycroft Make these compile without __AUDIT__.
 1.9 26-Jul-1998  mycroft const poisoning.
 1.8 16-Feb-1998  lukem don't assume buf is NL_TEXTMAX long
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.5 12-Oct-1994  deraadt fix typo
 1.4 06-Oct-1994  jtc Change size of array passed to __strerror() from 128 to NL_TEXTMAX.
 1.3 03-Sep-1994  jtc __strerror() and __strsignal() have been broken out into their own files
and use message catalogs if NLS is defined.
Increased the size of char buffers used by strerror() and strsignal();
the error and signal strings may be much longer in some locales.
 1.2 09-Oct-1993  jtc Helper function _strerror is in the user's namespace, renamed it to
__strerror().
 1.1 07-Oct-1993  jtc branches: 1.1.1;
Moved strerror.[c3] from libc/stdio to libc/string.
Since perror is not permitted to change strerror()'s static buffer, I have
changed both functions to pass their own buffers to the new library-internal
function _strerror() that actually does the error message string look up.
Split strerror manpage into strerror and perror manpages.
 1.1.1.1 30-Jan-1998  perry import lite-2
 1.14.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14.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.17.16.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.6 08-Jun-2024  joerg Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.
 1.5 25-Mar-2020  kre branches: 1.5.6;

Arrange that strerror(-1) prints "Unknown error: -1" and not the
unsigned equivalent of -1.

While here, guarantee, even when !NLS, that nothing here (not even
snprintf deciding to complain about EILSEQ or something) can ever
alter errno (ie: always save and restore it, not only in the NLS case).
The functions here must never alter errno, whatever happens.
 1.4 10-Jan-2017  christos branches: 1.4.14;
PR/51814: Ngie Cooper: add <stdio.h> since sys_nerr is declared there on
FreeBSD.
 1.3 19-Aug-2013  joerg branches: 1.3.8;
Add strerror_l.
 1.2 30-Jul-2005  christos branches: 1.2.44; 1.2.50;
- 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.1 28-Jul-2005  christos PR/30845: Luke Mewburn: strerror_r(3) missing
- Merge 4.4BSD strerror.3 man page changes that summarize information
for all the error printing functions. This makes the perror(3) page
obsolete.
- Implement all error functions in terms of strerror_r(), including
__strerror() which is not used internally. Can it be removed?
- Bump version for strerror_r
 1.2.50.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.2.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.3.8.1 20-Mar-2017  pgoyette Sync with HEAD
 1.4.14.1 08-Apr-2020  martin Merge changes from current as of 20200406
 1.5.6.1 13-Oct-2024  martin Pull up following revision(s) (requested by riastradh in ticket #971):

lib/libc/locale/setlocale_local.h: revision 1.18
lib/libc/string/strerror_r.c: revision 1.6
lib/libc/locale/setlocale.c: revision 1.66
lib/libc/string/Makefile.inc: revision 1.90
lib/libc/locale/global_locale.c: revision 1.29

Redo l10n support in the strerror family.

Instead of opening the message catelog whenever strerror is called,
keep track of the translations in the locale cache. For the C locale,
the builtin sys_errlist is used directly. Other locales will open
the catalog file on the first strerror call and build a translation
table, so that further calls in this locale can just use an array
lookup.
 1.2 12-Jan-2017  christos branches: 1.2.4;
put back strerror_ss, it will be used shortly.
 1.1 12-Jan-2017  christos Add strerror_ss_r to be used by syslog_ss
 1.2.4.2 20-Mar-2017  pgoyette Sync with HEAD
 1.2.4.1 12-Jan-2017  pgoyette file strerror_ss.c was added on branch pgoyette-localcount on 2017-03-20 06:56:58 +0000
 1.4 23-Aug-2017  christos PR/52499: Justin: stresep uses memmove with of-by-one length
 1.3 12-Feb-2017  maya branches: 1.3.4;
overlapping strcpy is UB. use memmove
from asan+ubsan
 1.2 06-Dec-2007  seb branches: 1.2.54; 1.2.58;
Fix stresep(3) handling of consecutive quoted delimiter characters.
Approved by christos@
 1.1 12-Aug-2006  christos branches: 1.1.2; 1.1.10;
- Add strndup and stresep
- Use stresep so in fstab so that we can mount paths with white space in them.
 1.1.10.1 09-Jan-2008  matt sync with HEAD
 1.1.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.2.58.1 21-Apr-2017  bouyer Sync with HEAD
 1.2.54.1 20-Mar-2017  pgoyette Sync with HEAD
 1.3.4.1 14-May-2018  martin Pull up following revision(s) (requested by maya in ticket #822):

lib/libc/string/stresep.c: revision 1.4
tests/lib/libc/string/t_stresep.c: revision 1.4

PR/52499: Justin: stresep uses memmove with of-by-one length
Add test from PR/52499
 1.6 23-Apr-1997  mrg move str[fp]time into libc/time.
 1.5 29-Feb-1996  jtc Fix swapped description of %x and %X format specifiers
 1.4 15-Dec-1993  jtc More manpage tweaks.
 1.3 19-Aug-1993  jtc Added the additional ``%'' format specifiers and the ``E'' and ``O''
format modifiers that are needed for a 1003.2 compliant date(1). The
modifiers don't actually do anything at present and are not documented.
It's too confusing to the user to describe localization features when
they aren't implemented yet. It is safe to do this, as the modifiers
fall back to the default behavior if the locale doesn't support alternate
eras or numeric formats.

But, in anticipation of _some_ locale support, all month and day names and
abbrevs, certain time formats, am/pm, etc. are now accessed through variables.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.13 23-Apr-1997  mrg move str[fp]time into libc/time.
 1.12 20-Dec-1996  cgd args for _fmt(), _secs(), and _add() should all be const (!!)
 1.11 01-Jun-1996  jtc Fix computation of ISO 8601 Week Of Year
 1.10 04-Feb-1996  jtc branches: 1.10.4;
gcc -Wall cleanup from John Birrell <jb@cimlogic.com.au>.
 1.9 28-Dec-1995  jtc Fixed %u to expand to a single digit
 1.8 29-Sep-1994  jtc Minor tweaks to prepare for checkin of real i18n code.
 1.7 25-May-1994  jtc Get the day, month, format, etc. strings from the current time locale
structure instead of static data.
 1.6 22-Apr-1994  jtc POSIX.1 says that strftime() must call tzset() as an application can change
the TZ environment variable while it is running.

Arnold Robbins' strftime() implementation from comp.sources.unix caches
the value of TZ to avoid calling tzset() (it's expensive) unless it has
been changed. But since POSIX.1 also requires ctime(), localtime(),
and mktime() to call tzset(), I think that it is better for tzset()
itself to determine whether or not to parse a new timezone file.
 1.5 07-Apr-1994  deraadt fix for "%R" from <seanv@cs.uq.edu.au>
 1.4 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.3 19-Aug-1993  jtc Added the additional ``%'' format specifiers and the ``E'' and ``O''
format modifiers that are needed for a 1003.2 compliant date(1). The
modifiers don't actually do anything at present and are not documented.
It's too confusing to the user to describe localization features when
they aren't implemented yet. It is safe to do this, as the modifiers
fall back to the default behavior if the locale doesn't support alternate
eras or numeric formats.

But, in anticipation of _some_ locale support, all month and day names and
abbrevs, certain time formats, am/pm, etc. are now accessed through variables.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.4.1 01-Jun-1996  jtc pull up ISO week fix from vers 1.11
 1.18 26-Apr-2017  abhinav Clean up the NAME section.

The entries in the NAME section of these man pages have man pages of their
own, so it doesn't make sense to have their names here, instead they
should be just described in the body (similar to what we do in math(3) man page).

This also helps whatis(1) and apropos(1), as otherwise you would see multiple
results with the same name in the output, while there is actually only one page
with that name.

Good example is:

$ apropos -n 2 -M realloc
realloc (3) general memory allocation operations
realloc (3) general purpose memory allocation functions

The first line is there because memory(3) man page had realloc in its
NAME section. This commit will fix this issue.

ok wiz@
 1.17 14-Jul-2016  abhinav Fix grammar.
 1.16 01-May-2009  perry Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.15 17-Feb-2007  wiz branches: 1.15.22;
Add strings(3), collecting information about strings.h.
Add Xr for it to string(3).

XXX: if someone could make a HISTORY section, I'd appreciate it
 1.14 17-Feb-2007  wiz o Removed functions which were moved to strings.h header
o Added some missing functions from string.h
o Update SEE ALSO and STANDARDS
o Bump date.

From Slava Semushin in private mail.
 1.13 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.10 07-Feb-2002  ross Generate <>& symbolically.
 1.9 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.8 22-Mar-1999  garbled branches: 1.8.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.7 06-Mar-1999  mycroft Fix minor formatting error.
 1.6 14-Sep-1998  kleink Add a pointer to strtok_r().
 1.5 05-Feb-1998  perry add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.8.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.15.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.3 17-Jun-2017  abhinav Remove names from the NAME section which have their own man pages.
This is similar to the changes made in string(3) and memory(3) man pages previously.

The reasin being that, when you do `whatis ffs', an extra entry will be there in
the output for this page, which is confusing and unncessary.

Bump date for changes in the NAME section.
 1.2 14-Jul-2016  abhinav Use .In for header file.
 1.1 17-Feb-2007  wiz Add strings(3), collecting information about strings.h.
Add Xr for it to string(3).

XXX: if someone could make a HISTORY section, I'd appreciate it
 1.17 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.16 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.15 15-May-2003  itojun latest copyright notice (more loose). noted by wiz
 1.14 24-Apr-2002  bjh21 Re-introduce inclusion of config.h for libnbcompat, since the namespace.h trick
no longer works.
 1.13 24-Apr-2002  kleink Protect inclusion of namespace.h with _LIBC.
 1.12 17-Apr-2002  kleink Need internal names for strlcat() and strlcpy().
 1.11 31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.10 21-Jan-2002  tv Add hooks for reachover builds from src/tools/compat.
 1.9 16-Nov-2001  itojun sync comment with latest openbsd code
 1.8 13-Jan-2001  itojun branches: 1.8.2;
pull in openbsd strlcat.c 1.3 -> 1.4.
Reverse the order of two loop invariant to make 'strlcat(0, "foo", 0)'
not get a SEGV; Richard Kettlewell <rjk@greenend.org.uk>
 1.7 03-Jan-2001  lukem remove register
 1.6 24-Nov-2000  itojun sync with latest openbsd.
comment in strlcat(3) was wrong about return value.
 1.5 20-Sep-1999  lukem branches: 1.5.8; 1.5.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.4 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.3 10-Sep-1999  lukem due to an overwhelming rush of complaints, remove the check for NULL
pointers. apparantly a lot of developers feel that potentially dumping
core is better than returning a status of `0 bytes copied'...
 1.2 08-Sep-1999  lukem add netbsd rcsid's
update for knf (return value on separate line to function name...)
check dst and src aren't null pointers before trying to use them
enable strlcat/strlcpy
 1.1 08-Sep-1999  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 08-Sep-1999  lukem strlcpy() and strlcat() by Todd Miller <Todd.Miller@courtesan.com>, via openbsd
 1.5.10.2 05-Jul-2000  he Pull up revisions 1.1-1.3 (requested by he):
Add strlcpy() and strlcat() to libc.
 1.5.10.1 20-Sep-1999  he file strlcat.c was added on branch netbsd-1-4 on 2000-07-05 20:59:41 +0000
 1.5.8.2 26-Apr-2002  he Pull up revision 1.13 (requested by kleink):
Make it possible to build strlcat() and strlcpy() outside the
libc environment.
 1.5.8.1 22-Apr-2002  he Pull up revision 1.12 (via patch, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.8.2.4 25-Apr-2002  nathanw Catch up to -current.
 1.8.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.8.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.25 02-Apr-2025  gutteridge strlcpy.3: bump date to reflect recent significant changes
 1.24 30-Mar-2025  riastradh strlcpy(3): Pick some nits in the prose.
 1.23 30-Mar-2025  riastradh strlcpy(3): Another attempt at reworking the description for clarity.

These functions have extremely sharp edges that are apparently still
inadequately documented. Put the full behaviour of both functions
more clearly up front, emphasize that src MUST be NUL-terminated up
front, and add another WARNING for another sharp edge that wasn't
made clear enough.
 1.22 01-Nov-2024  nia libc: Expose some newly-standard C functions in POSIX.1-2024 mode
 1.21 11-Aug-2023  riastradh branches: 1.21.2;
strlcpy(3): Tweak markup.
 1.20 11-Aug-2023  riastradh strlcpy(3), strncpy(3): Omit needless (void) casts in examples.

The return values are not critical.
 1.19 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.
 1.18 11-Aug-2023  riastradh strlcpy(3): Nix stray space between `NUL' and `-terminating'.
 1.17 11-Aug-2023  uwe strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".
 1.16 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)
 1.15 11-Aug-2023  riastradh strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

XXX pullup-10
XXX pullup-9
XXX pullup-8
 1.14 28-Aug-2022  hgutch branches: 1.14.2;
Change back various occurrences of \*[Le], \*[Ge] (less/greater equal)
and \*(ua (upwards arrow) to literal "<=", ">=" and "^" whenever
appropriate (e.g., in code examples).
 1.13 14-Apr-2010  wiz Join URL.
 1.12 14-Apr-2010  jruoho Add the USENIX paper of Miller and de Raadt to SEE ALSO.
 1.11 26-Jun-2003  wiz There is no FreeBSD-3.3.0, only FreeBSD-3.3.
 1.10 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 16-Nov-2001  itojun sync with latest openbsd one. this one describes corner case of strlcat better
 1.7 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.6 02-Mar-2001  cgd branches: 1.6.2;
update the date; pointed out by mycroft
 1.5 02-Mar-2001  cgd don't forget the LIBRARY section
 1.4 25-Jan-2001  jdolecek remove bogus comment from EXAMPLE section
Add HISTORY section, mentioning strlcpy()/strlcat() first appeared
in OpenBSD 2.4 and when this came to NetBSD and FreeBSD
 1.3 24-Nov-2000  itojun sync with latest openbsd.
comment in strlcat(3) was wrong about return value.
 1.2 08-Sep-1999  lukem branches: 1.2.10;
add netbsd rcsid's
update for knf (return value on separate line to function name...)
check dst and src aren't null pointers before trying to use them
enable strlcat/strlcpy
 1.1 08-Sep-1999  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 08-Sep-1999  lukem strlcpy() and strlcat() by Todd Miller <Todd.Miller@courtesan.com>, via openbsd
 1.2.10.2 05-Jul-2000  he Pull up revisions 1.1-1.2 (new, requested by he):
Add strlcpy() and strlcat() to libc.
 1.2.10.1 08-Sep-1999  he file strlcpy.3 was added on branch netbsd-1-4 on 2000-07-05 21:00:52 +0000
 1.6.2.4 22-Mar-2002  nathanw Catch up to -current.
 1.6.2.3 08-Mar-2002  nathanw Catch up to -current.
 1.6.2.2 28-Jan-2002  nathanw Catch up to -current.
 1.6.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.14.2.1 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.
 1.21.2.1 02-Aug-2025  perseant Sync with HEAD
 1.15 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.14 27-Oct-2003  lukem Overhaul how `build.sh tools' are used:

* Rename "config.h" to "nbtool_config.h" and
HAVE_CONFIG_H to HAVE_NBTOOL_CONFIG_H.
This makes in more obvious in the source when we're using
tools/compat/config.h versus "standard autoconf" config.h

* Consistently move the inclusion of nbtool_config.h to before
<sys/cdefs.h> so that the former can provide __RCSID() (et al),
and there's no need to protect those macros any more.

These changes should make it easier to "tool-ify" a program by adding:
#if HAVE_NBTOOL_CONFIG_H
#include "nbtool_config.h"
#endif
to the top of the source files (for the general case).
 1.13 15-May-2003  itojun latest copyright notice (more loose). noted by wiz
 1.12 24-Apr-2002  bjh21 Re-introduce inclusion of config.h for libnbcompat, since the namespace.h trick
no longer works.
 1.11 24-Apr-2002  kleink Protect inclusion of namespace.h with _LIBC.
 1.10 17-Apr-2002  kleink Need internal names for strlcat() and strlcpy().
 1.9 31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.8 21-Jan-2002  tv Add hooks for reachover builds from src/tools/compat.
 1.7 13-Jan-2001  itojun branches: 1.7.2;
pull in openbsd strlcat.c 1.3 -> 1.4.
Reverse the order of two loop invariant to make 'strlcat(0, "foo", 0)'
not get a SEGV; Richard Kettlewell <rjk@greenend.org.uk>
 1.6 03-Jan-2001  lukem remove register
 1.5 20-Sep-1999  lukem branches: 1.5.8; 1.5.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.4 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.3 10-Sep-1999  lukem due to an overwhelming rush of complaints, remove the check for NULL
pointers. apparantly a lot of developers feel that potentially dumping
core is better than returning a status of `0 bytes copied'...
 1.2 08-Sep-1999  lukem add netbsd rcsid's
update for knf (return value on separate line to function name...)
check dst and src aren't null pointers before trying to use them
enable strlcat/strlcpy
 1.1 08-Sep-1999  lukem branches: 1.1.1;
Initial revision
 1.1.1.1 08-Sep-1999  lukem strlcpy() and strlcat() by Todd Miller <Todd.Miller@courtesan.com>, via openbsd
 1.5.10.2 05-Jul-2000  he Pull up revisions 1.1-1.3 (new, requested by he):
Add strlcpy() and strlcat() to libc.
 1.5.10.1 20-Sep-1999  he file strlcpy.c was added on branch netbsd-1-4 on 2000-07-05 21:00:21 +0000
 1.5.8.2 26-Apr-2002  he Pull up revision 1.11 (requested by kleink):
Make it possible to build strlcat() and strlcpy() outside the
libc environment.
 1.5.8.1 22-Apr-2002  he Pull up revision 1.10 (via patch, requested by kleink):
Use internal names for strlcat() and strlcpy().
 1.7.2.4 25-Apr-2002  nathanw Catch up to -current.
 1.7.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.7.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.7.2.1 28-Jan-2002  nathanw Catch up to -current.
 1.9 01-May-2009  perry Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.8 07-Aug-2003  agc branches: 1.8.42;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.8.42.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.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 31-Jan-2004  uebayasi Minor KNF.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.17 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.16 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.15 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.14 01-Oct-2002  wiz New sentence, new line. From Robert Elz.
 1.13 07-Feb-2002  ross Generate <>& symbolically.
 1.12 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.11 29-Jun-2000  kleink branches: 1.11.2;
The declaration lives in <unistd.h>, actually; from Patrick Welche in PR
lib/10294.
 1.10 03-Aug-1999  wrstuden branches: 1.10.8;
Add and document support for using new archive state mode flags. Now
archived files will show up as either "a" (S_ARCH1) or "A" (S_ARCH2)
in ls -l. As noted, archive state is fs-dependent, and not maintained
by most fs's.
 1.9 05-Feb-1998  perry add LIBRARY section to man page
 1.8 30-Jan-1998  perry update to lite-2
 1.7 09-Oct-1997  lukem rcsid police
 1.6 19-Aug-1997  mikel fix typos and remove obsolete RETURN VALUES section; from Krister
Walfridsson in PR lib/3999, with one minor change by myself
 1.5 08-Mar-1997  mouse alternate -> alternative, per PR 2643
 1.4 30-Jan-1997  matthias Teach strmode(3) about whiteouts. They get w 'w' now.
 1.3 10-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.8.1 29-Jun-2000  thorpej Pull up rev. 1.11:
The declaration lives in <unistd.h>, actually; from Patrick Welche in PR
lib/10294.
 1.11.2.4 18-Oct-2002  nathanw Catch up to -current.
 1.11.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.11.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.11.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.19 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.18 07-Oct-2006  apb branches: 1.18.42;
Include nbtool_config.h for tools build. This was part of the
patch supplied by Wim Lewis in PR 31232.
 1.17 07-Oct-2006  elad PR/31232: Wim Lewis: tools/compat doesn't check for pre-existence of
strmode()

Commited slightly different diff, input and okay from apb@
 1.16 20-Jun-2004  jmc Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')

Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).

Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.

Fixes PR's: PR#17762 PR#25944
 1.15 07-Aug-2003  agc branches: 1.15.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.14 25-Jul-2003  atatat More properly host-tool-ify stat
 1.13 31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.12 29-Jan-2002  tv Make almost all tools compile and run properly on non-NetBSD hosts. (In
particular, most tools now run correctly on Solaris 7.)
 1.11 20-Sep-1999  lukem branches: 1.11.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 03-Aug-1999  wrstuden Add and document support for using new archive state mode flags. Now
archived files will show up as either "a" (S_ARCH1) or "A" (S_ARCH2)
in ls -l. As noted, archive state is fs-dependent, and not maintained
by most fs's.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 16-Oct-1997  christos These two don't belong in string.h, but unistd.h
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 30-Jan-1997  matthias Teach strmode(3) about whiteouts. They get w 'w' now.
 1.3 26-Aug-1993  jtc branches: 1.3.8;
Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.8.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.11.10.2 22-Mar-2002  nathanw Catch up to -current.
 1.11.10.1 08-Mar-2002  nathanw Catch up to -current.
 1.15.2.1 22-Jun-2004  tron Pull up revision 1.16 (requested by jmc in ticket #527):
Completely rework how tools/compat is done. Purge all uses/references to
_NETBSD_SOURCE as this makes cross building from older/newer versions of
NetBSD harder, not easier (and also makes the resulting tools 'different')
Wrap all required code with the inclusion of nbtool_config.h, attempt to
only use POSIX code in all places (or when reasonable test w. configure and
provide definitions: ala u_int, etc).
Reviewed by lukem. Tested on FreeBSD 4.9, Redhat Linux ES3, NetBSD 1.6.2 x86
NetBSD current (x86 and amd64) and Solaris 9.
Fixes PR's: PR#17762 PR#25944
 1.18.42.1 30-Oct-2012  yamt sync with head
 1.13 27-Dec-2013  christos moved to common
 1.12 25-Jun-2012  abs branches: 1.12.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.11 03-Jun-2007  christos branches: 1.11.36;
Make these work with _FORTIFY_SOURCE, by overriding the fortified definitions
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.11.36.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.11.36.1 30-Oct-2012  yamt sync with head
 1.12.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.14 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.13 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.12 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.11 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.10 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.9 03-Feb-1998  perry remove obsolete register declarations
 1.8 30-Jan-1998  perry update to lite-2
 1.7 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.6 24-Oct-1996  cgd pull up from libkern:
>when casting const pointers, preserve const qualifiers. (-Wcast-qual)
 1.5 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.16 13-Aug-2023  riastradh branches: 1.16.4;
strncpy(3): More on how strlcpy is not a safe strncpy replacement.
 1.15 11-Aug-2023  riastradh strncpy(3): Fix column sizing.
 1.14 11-Aug-2023  riastradh strlcpy(3), strncpy(3): Omit needless (void) casts in examples.

The return values are not critical.
 1.13 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.
 1.12 11-Aug-2023  riastradh strncpy(3): Tiny wording tweak.
 1.11 11-Aug-2023  riastradh strncpy(3): Reword to make sentence structure parallel.
 1.10 11-Aug-2023  riastradh strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.
 1.9 11-Aug-2023  riastradh strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.
 1.8 11-Aug-2023  riastradh strncpy(3): Rework the example in an attempt to improve exposition.
 1.7 11-Aug-2023  riastradh strncpy(3): Note strcpy(3) man page revision this forked from.
 1.6 11-Aug-2023  riastradh strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)
 1.5 11-Aug-2023  uwe strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect
Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
 1.4 11-Aug-2023  uwe strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
 1.3 11-Aug-2023  riastradh strncpy(3): Slightly more consistency about NUL vs '\0' in the text.
 1.2 11-Aug-2023  riastradh strncpy(3): Qualify example of strlcpy(3) with a major caveat.
 1.1 11-Aug-2023  riastradh strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.
 1.16.4.2 20-Sep-2024  martin Pull up following revision(s) (requested by rin in ticket #891):

lib/libc/string/strncpy.3: revision 1.10
lib/libc/string/strncpy.3: revision 1.11
lib/libc/string/strncpy.3: revision 1.12
lib/libc/string/strncpy.3: revision 1.13
lib/libc/string/strncpy.3: revision 1.14
lib/libc/string/strncpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.20
lib/libc/string/strncpy.3: revision 1.16
lib/libc/string/strncpy.3: revision 1.1
lib/libc/string/strlcpy.3: revision 1.21
lib/libc/string/strncpy.3: revision 1.2
lib/libc/string/strncpy.3: revision 1.3
lib/libc/string/strncpy.3: revision 1.4
lib/libc/string/strncpy.3: revision 1.5
lib/libc/string/strncpy.3: revision 1.6
lib/libc/string/Makefile.inc: revision 1.88
lib/libc/string/strncpy.3: revision 1.7
lib/libc/string/Makefile.inc: revision 1.89
lib/libc/string/strncpy.3: revision 1.8
lib/libc/string/strncpy.3: revision 1.9
lib/libc/string/strcpy.3: revision 1.24
lib/libc/string/strcpy.3: revision 1.25
lib/libc/string/strcpy.3: revision 1.26
lib/libc/string/strcpy.3: revision 1.27
lib/libc/string/strlcpy.3: revision 1.15
lib/libc/string/strlcpy.3: revision 1.16
lib/libc/string/strlcpy.3: revision 1.17
lib/libc/string/strlcpy.3: revision 1.18
lib/libc/string/strlcpy.3: revision 1.19

strlcpy(3): Rework man page to clarify relation to strncpy(3).

Add caveats explaining when strlcpy(3) and strlcat(3) are dangerously
inadequate or inappropriate.

strncpy(3), stpncpy(3): Split man page out of strcpy(3), stpcpy(3).

These are for substantively different purposes (fixed-width fields
with optional NUL padding vs NUL-terminated strings), so they don't
belong together.

Be more specific about the security issues.

strncpy(3): Qualify example of strlcpy(3) with a major caveat.

strncpy(3): Slightly more consistency about NUL vs '\0' in the text.

Install strncpy.3 to fix build
strncpy(3): use .Sm off/on around a fancy expression to avoid lots of Ns
strncpy(3): markup tweaks

NUL is a character name, not a defined name, use .Tn
.Ns has implicit .No effect

Use \*q for ASCII quotes (.Dq uses fancy typographical ones)
strcpy(3), strlcpy(3), strncpy(3): Use `.Tn NUL' for the zero byte.

Let's be consistent within these man pages. (If someone else really
likes the unpronounceable `.Ql \e0' better, that's fine, you can go
through and systematically change all the man pages to use that after
we're done clarifying strcpy(3), strncpy(3), and strlcpy(3).)

strncpy(3): Note strcpy(3) man page revision this forked from.

strncpy(3): Rework the example in an attempt to improve exposition.

strcpy(3): Note that strlcpy(3) is a safer replacement for strcpy(3).

Suggest snprintf("%s") as a more portable alternative too.

Note that both strlcpy and snprintf still require the input to be
NUL-terminated.

strlcpy(3): don't use \*[Ge] for >= - it's wrong for source code

In the PostScript output it produces the single mathematical "greater
or equal" symbol, not the ">=".

strlcpy(3): Nix stray space between `NUL' and `-terminating'.

strncpy(3): Take another whack at clarifying this.

Emphasize the fixed-buffer nature of it, and that NUL-termination is
neither required on input nor guaranteed on output.

strncpy(3): Fix typo -- stpncpy, not stpcpy which is different.

strncpy(3): Reword to make sentence structure parallel.

strncpy(3): Tiny wording tweak.

strcpy(3), strlcpy(3), strncpy(3): Just say `byte', not `character'.

strlcpy(3), strncpy(3): Omit needless (void) casts in examples.
The return values are not critical.

strlcpy(3): Tweak markup.

strncpy(3): Fix column sizing.

strncpy(3): More on how strlcpy is not a safe strncpy replacement.
 1.16.4.1 13-Aug-2023  martin file strncpy.3 was added on branch netbsd-10 on 2024-09-20 11:22:28 +0000
 1.13 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.10 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.9 26-Mar-1998  cgd when deciding whether to use standard system include files or libkern.h,
check _STANDALONE as well as _KERNEL. _KERNEL is incorrect for use when
building boot blocks, and it looks like the rest of the code is already
using _STANDALONE for this purpose.
 1.8 03-Feb-1998  perry remove obsolete register declarations
 1.7 30-Jan-1998  perry update to lite-2
 1.6 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.5 18-Apr-1996  cgd don't include user-land headers compiling for libkern. (sync with libkern.)
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4 03-Jul-2007  nakayama Add strndup(3) to libnbcompat, since estrndup(3) added into efun.c calls it.
 1.3 14-Jan-2007  cbiere Avoid lint warning.
 1.2 14-Jan-2007  cbiere Look only at the first `n' characters to avoid traversing a potentially
huge string for nothing.
 1.1 12-Aug-2006  christos branches: 1.1.2;
- Add strndup and stresep
- Use stresep so in fstab so that we can mount paths with white space in them.
 1.1.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.2 01-Sep-2011  jym Make strnlen(3) accessible in kernel. ok christos@.
 1.1 01-May-2009  perry branches: 1.1.2;
Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.1.2.2 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.2.1 01-May-2009  jym file strnlen.c was added on branch jym-xensuspend on 2009-05-13 19:18:27 +0000
 1.1 24-Sep-2014  christos add strnstr.c from FreeBSD
 1.9 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.21 19-Jul-2014  lneto lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
 1.20 22-Nov-2011  joerg branches: 1.20.6; 1.20.16;
Handle simple cases (strlen(charset) <= 1) more efficiently.
 1.19 24-Sep-2008  christos branches: 1.19.2; 1.19.6;
pacify lint.
 1.18 24-Sep-2008  christos fix newer gcc warning.
 1.17 24-Sep-2008  christos From Ilya Dogolazky ilya.dogolazky at teleca dot fi:

The new algorithm does not use any array initialisation.
Instead of that the only integer variable "index" is initialized.
It is not using any bitwise operations and shifts as well.

The well-known algorithm (an efficient representation for sparse sets) is
mentioned as exercise 2.12 in "The Design and Analysis of Computer Algorithms"
by Alfred Aho, John Hopcroft and Jeffrey Ullman. It is described here
http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.30.7319
and here
http://research.swtch.com/2008/03/using-uninitialized-memory-for-fun-and.html
 1.16 23-Feb-2008  christos fix lint issues.
 1.15 22-Feb-2008  joerg Also cast before anding the characters.
 1.14 22-Feb-2008  joerg Add some explicit casts to stop GCC complains about signed char shifts.
 1.13 22-Feb-2008  joerg Replace O(nm) versions of strspn, strcspn and strpbrk with O(n+m)
implementations based on the suggestions I made for DragonFly's libc
ages ago. For charset with more than one entry and iterating over the
first two characters of s, this is consistently faster on amd64.
 1.12 29-Nov-2005  christos branches: 1.12.10; 1.12.16;
WARNS=4
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 15-Nov-1998  christos delint
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.12.16.1 24-Mar-2008  keiichi sync with head.
 1.12.10.1 23-Mar-2008  matt sync with HEAD
 1.19.6.2 24-Sep-2008  christos pacify lint.
 1.19.6.1 24-Sep-2008  christos file strpbrk.c was added on branch christos-time_t on 2008-09-24 16:58:54 +0000
 1.19.2.1 17-Apr-2012  yamt sync with head
 1.20.16.1 10-Aug-2014  tls Rebase.
 1.20.6.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.10 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 11-Aug-2002  yamt bring in EXAMPLES from openbsd.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.3 13-Aug-2002  nathanw Catch up to -current.
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.2 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.1 04-Aug-1998  perry Replace complicated and ugly makefile gook to make memmove,memcpy by
-Ding the bcopy.c source (and similarly strchr from index.c, strrchr
from rindex.c) with stub .c files for memmove, memcpy, strchr and
strrchr that simply #define the appropriate thing and #include the
appropriate .c file. Inspired by the way many m-d .S files handle the
same thing. This radically simplifies the Makefile.inc for libc/string
(and libkern).
 1.20 03-Jul-2017  wiz Remove workaround for ancient HTML generation code.
 1.19 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.18 13-Aug-2006  wiz stresep, not strnsep. Remove duplicate "the". Bump date for previous.
 1.17 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.16 13-Apr-2004  wiz branches: 1.16.6;
One too many punctuation fixed in previous.
 1.15 13-Apr-2004  wiz Punctuation fixes; mark up NULL.
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.12 20-Aug-2002  wiz Use Dq instead of single quotes.
 1.11 11-Aug-2002  yamt - correct how to check empty field.
- improve examples.
from OpenBSD.
 1.10 07-Feb-2002  ross generate & symbolically
 1.9 07-Feb-2002  ross Generate <>& symbolically.
 1.8 28-Sep-2000  hubertf branches: 1.8.2;
The 'delim' argument is const, document it as such.
 1.7 05-Feb-1998  perry branches: 1.7.10;
add LIBRARY section to man page
 1.6 03-Feb-1998  perry .Bx'ize
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 10-Jan-1994  jtc Fix spelling errors.
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.7.10.1 28-Sep-2000  hubertf Pull up rev. 1.8 to netbsd-1-5 branch, OK'd by thorpej:
> The 'delim' argument is const, document it as such.
 1.8.2.4 27-Aug-2002  nathanw Catch up to -current.
 1.8.2.3 13-Aug-2002  nathanw Catch up to -current.
 1.8.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.16.6.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.15 13-Nov-2006  dyoung Add strsep(3) to libkern.

To avoid code duplication, move strsep.c to the kernel/userland
common files.

Soon I will commit source-address selection (options IPSELSRC).
It will use strsep(3).
 1.14 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.13 31-Jan-2002  tv Roll in fixes to permit cross-compiling from non-NetBSD hosts. This
round has been tested on Solaris/x86 and Linux hosts.

* Add host tools cap_mkdb, ctags, m4, uudecode.
* Protect __RCSID() and __COPYRIGHT() better.
* Reduce the number of places that need to include "config.h", to keep
sources closer to their "vanilla" versions.
* Add more compat #defines and autoconf-checked functions.
 1.12 28-Jan-2002  tv Make compilable from src/tools/compat.
 1.11 22-Jan-2000  mycroft branches: 1.11.6;
Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.10 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 13-Oct-1998  kleink Need an internal name for strsep().
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc branches: 1.4.4;
don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.4.4.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.11.6.2 22-Mar-2002  nathanw Catch up to -current.
 1.11.6.1 08-Mar-2002  nathanw Catch up to -current.
 1.10 22-Jul-2009  kleink Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 22-Mar-1999  garbled branches: 1.6.12;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.5 11-Mar-1998  fair #include <string.h> now says #include <unistd.h> which matches the source code, per PR#4451. This should be checked for POSIX compliance, however.
 1.4 05-Feb-1998  perry add LIBRARY section to man page
 1.3 09-Oct-1997  lukem rcsid police
 1.2 03-Jul-1995  jtc added intro(2) cross reference
 1.1 02-Aug-1994  jtc branches: 1.1.2;
Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.1.2.2 02-Aug-1994  jtc Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.1.2.1 02-Aug-1994  jtc file strsignal.3 was added on branch netbsd-1-0 on 1994-08-02 05:01:25 +0000
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.15 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.14 22-Jul-2009  kleink branches: 1.14.6;
Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.
 1.13 29-Nov-2005  christos WARNS=4
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.10 15-Nov-1998  christos delint
 1.9 27-Jul-1998  mycroft Make these compile without __AUDIT__.
 1.8 26-Jul-1998  mycroft const poisoning.
 1.7 16-Oct-1997  christos These two don't belong in string.h, but unistd.h
 1.6 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.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 23-Jan-1997  mrg - convert unsafe strcpy(), strcat() and sprintf() to the `n' versions.
- some KNF.
 1.3 06-Oct-1994  jtc Change size of array passed to __strsignal() from 128 to NL_TEXTMAX.
 1.2 03-Sep-1994  jtc __strerror() and __strsignal() have been broken out into their own files
and use message catalogs if NLS is defined.
Increased the size of char buffers used by strerror() and strsignal();
the error and signal strings may be much longer in some locales.
 1.1 02-Aug-1994  jtc branches: 1.1.2;
Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.1.2.2 02-Aug-1994  jtc Add strsignal() function like on Solaris.
We might want to be able to retrieve a locale-specific signal description
(from a message catalog) and we need a function call API for that feature.
 1.1.2.1 02-Aug-1994  jtc file strsignal.c was added on branch netbsd-1-0 on 1994-08-02 05:01:24 +0000
 1.14.6.1 30-Oct-2012  yamt sync with head
 1.11 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.10 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.8 11-Aug-2002  yamt bring in EXAMPLES from openbsd.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 09-Oct-1997  lukem rcsid police
 1.3 16-Jan-1996  jtc Fix manpage typoes; PR #1905
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.3 13-Aug-2002  nathanw Catch up to -current.
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.19 19-Jul-2014  lneto lua: updated from 5.1 to 5.3 work3

* lua(1):
- changed lua_Integer to intmax_t
- updated distrib/sets/lists and etc/mtree
- updated bsd.lua.mk
- fixed bozohttpd (lua-bozo.c)
- compatibilized bindings: gpio, sqlite
* lua(4):
- removed floating-point and libc dependencies using '#ifndef _KERNEL'
- fixed division by zero and exponentiation
- libkern: added isalnum(), iscntrl(), isgraph(), isprint() and ispunct()
- acpica: removed isprint() from acnetbsd.h
- libc: moved strcspn.c, strpbrk.c and strspn.c to common
- removed stub headers
- compatibilized bindings: luapmf, luasystm
* reorganized luaconf.h
* updated doc/CHANGES and doc/RESPONSIBLE
 1.18 21-Mar-2012  christos branches: 1.18.2; 1.18.8;
size_t -> uint8_t
 1.17 30-Jul-2009  dsl branches: 1.17.6;
Use a 'register only' str[c]spn() on 64 bit systems.
 1.16 30-Jul-2008  joerg branches: 1.16.6;
Before using the slightly more involved bitmap tables,
check that the charset for strspn/strcspn is non-trivial.
An empty charset is either a direct return or a strlen and
a single charset a simple loop.
 1.15 23-Feb-2008  christos branches: 1.15.4;
use the proper variable.
 1.14 23-Feb-2008  christos fix lint issues.
 1.13 22-Feb-2008  joerg Also cast before anding the characters.
 1.12 22-Feb-2008  joerg Add some explicit casts to stop GCC complains about signed char shifts.
 1.11 22-Feb-2008  joerg Replace O(nm) versions of strspn, strcspn and strpbrk with O(n+m)
implementations based on the suggestions I made for DragonFly's libc
ages ago. For charset with more than one entry and iterating over the
first two characters of s, this is consistently faster on amd64.
 1.10 07-Aug-2003  agc branches: 1.10.22; 1.10.28;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.28.1 24-Mar-2008  keiichi sync with head.
 1.10.22.1 23-Mar-2008  matt sync with HEAD
 1.15.4.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.16.6.2 30-Jul-2008  joerg Before using the slightly more involved bitmap tables,
check that the charset for strspn/strcspn is non-trivial.
An empty charset is either a direct return or a strlen and
a single charset a simple loop.
 1.16.6.1 30-Jul-2008  joerg file strspn.c was added on branch christos-time_t on 2008-07-30 16:14:00 +0000
 1.17.6.1 17-Apr-2012  yamt sync with head
 1.18.8.1 10-Aug-2014  tls Rebase.
 1.18.2.1 20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.12 24-Sep-2014  wiz NUL byte instead of null byte.
 1.11 24-Sep-2014  christos add strnstr from FreeBSD
 1.10 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.9 03-Jul-2004  junyoung Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.
 1.8 07-Aug-2003  agc branches: 1.8.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 05-Feb-1998  perry branches: 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.8.2.1 12-Jul-2004  he Pull up revision 1.9 (requested by junyoung in ticket #638):
Add strcasestr(3), case insensitive version of strstr(3).
 1.13 20-Dec-2005  christos Use reach-over sources from common/lib/libc
 1.12 29-Nov-2005  christos WARNS=4
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 15-Nov-1998  christos delint
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.23 29-Aug-2008  dholland branches: 1.23.6;
Grammar police.
 1.22 16-Oct-2006  wiz branches: 1.22.18;
nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.21 11-Oct-2004  dsl Remove sentence about the inability to simultaenously tokenise multiple
strings - should have been removes then strtok_r() was added.
 1.20 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.19 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.18 02-Oct-2002  christos NUL character, NULL pointer.
 1.17 02-Oct-2002  jschauma tyop: NUL -> NULL
 1.16 11-Aug-2002  yamt bring in EXAMPLES from openbsd.
 1.15 07-Feb-2002  ross Generate <>& symbolically.
 1.14 16-Sep-2001  wiz Whitespace fixes and sort SEE ALSO.
 1.13 22-Mar-2001  kleink Sprinkle some restrict qualifiers.
 1.12 11-Oct-2000  phil branches: 1.12.2;
Document the behaviour with consecutive separator characters.
 1.11 20-Jul-2000  kleink Add a description of strtok_r(3), and rip out the obsoleteness claim.
 1.10 22-Mar-1999  garbled branches: 1.10.10;
Last of the .Os cleanups. .Os is defined in the tmac.doc-common file,
so we shouldn't override it with versions in the manpages. Wheee!
 1.9 14-Sep-1998  kleink Make makewhatis find strtok_r(3).
 1.8 28-Apr-1998  fair Principally, change foo(N) to .Xr foo N
Also, do some other mdoc tagging.
 1.7 05-Feb-1998  perry add LIBRARY section to man page
 1.6 30-Jan-1998  perry update to lite-2
 1.5 09-Oct-1997  lukem rcsid police
 1.4 12-Nov-1996  jtc Add strtok_r() for reentrant (thread-aware) programs
 1.3 13-May-1995  jtc strtok replaces the separator character, not the token, with a NUL.
(Fix from PR #891.)
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10.10.1 20-Jul-2000  kleink Pull up rev. 1.11 (approved by thorpej):
Describe strtok_r(3).
 1.12.2.4 13-Aug-2002  nathanw Catch up to -current.
 1.12.2.3 22-Mar-2002  nathanw Catch up to -current.
 1.12.2.2 08-Mar-2002  nathanw Catch up to -current.
 1.12.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.22.18.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.23.6.2 29-Aug-2008  dholland Grammar police.
 1.23.6.1 29-Aug-2008  dholland file strtok.3 was added on branch christos-time_t on 2008-08-29 05:48:41 +0000
 1.12 27-Oct-2004  dsl Implement strtok() in terms of strtok_r()
 1.11 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.9 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.8 15-Nov-1998  christos delint
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 11-Jun-1994  jtc Remove unneeded #include <stddef.h> because <string.h> #defines NULL too.
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.10 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.9 07-Aug-2003  agc branches: 1.9.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 22-Jan-2000  mycroft Delint.
Remove trailing ; from uses of __weak_alias(). The macro inserts this if
needed.
 1.7 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.6 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.5 15-Nov-1998  christos delint
 1.4 27-Sep-1998  kleink Add an internal name for strtok_r().
 1.3 03-Feb-1998  perry remove obsolete register declarations
 1.2 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.1 12-Nov-1996  jtc Add strtok_r() for reentrant (thread-aware) programs
 1.9.56.1 30-Oct-2012  yamt sync with head
 1.12 18-Mar-2019  mrg restore the removed "function does something horrible" description,
but leave the real description as well.
 1.11 18-Feb-2007  wiz branches: 1.11.78;
Bump date for previous.
 1.10 18-Feb-2007  hubertf Try to tell what this really does.
Including a BUGS section on why it doesn't.

*roff code by wiz@, with some input from
Slava Semushin <slava.semushin@gmail.com>
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 22-Mar-2001  kleink Sprinkle some restrict qualifiers.
 1.5 05-Feb-1998  perry branches: 1.5.8; 1.5.12;
add LIBRARY section to man page
 1.4 30-Jan-1998  perry update to lite-2
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.5.12.3 22-Mar-2002  nathanw Catch up to -current.
 1.5.12.2 08-Mar-2002  nathanw Catch up to -current.
 1.5.12.1 08-Oct-2001  nathanw Catch up to -current.
 1.5.8.1 28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.11.78.1 10-Jun-2019  christos Sync with HEAD
 1.14 17-May-2013  joerg Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.13 19-Apr-2013  joerg Add dummy strcoll_l and strxfrm_l.
 1.12 25-Jun-2012  abs branches: 1.12.2;
Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.11 07-Aug-2003  agc branches: 1.11.56;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.10 22-Dec-2001  lukem only _DIAGASSERT(dst != NULL) if n != 0
 1.9 20-Sep-1999  lukem branches: 1.9.6; 1.9.10;
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.4 15-Jun-1995  jtc don't include <sys/cdefs.h>, it's a 'private' header
 1.3 26-Aug-1993  jtc Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.9.10.1 28-Jan-2002  nathanw Catch up to -current.
 1.9.6.2 23-Jun-2000  minoura Import of most recent XPG4DL dated 2000.06.23.
 1.9.6.1 28-May-2000  minoura Citrus Project XPG4DL, an implementation of I18N (locale) framework,
is imported.
 1.11.56.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.11.56.1 30-Oct-2012  yamt sync with head
 1.12.2.1 23-Jun-2013  tls resync from head
 1.15 30-Apr-2010  jruoho .Nm -> .Fn.
 1.14 29-Apr-2010  jruoho Fix markup.
 1.13 29-Apr-2010  jruoho Note the recent changes.
 1.12 17-Apr-2010  wiz Remove trailing whitespace.
 1.11 17-Apr-2010  christos Change and document for POSIX compliance.
 1.10 17-Apr-2010  christos add restrict
 1.9 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.8 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.7 07-Feb-2002  ross Generate <>& symbolically.
 1.6 05-Feb-1998  perry branches: 1.6.12;
add LIBRARY section to man page
 1.5 30-Jan-1998  perry update to lite-2
 1.4 12-Jan-1998  kleink Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.
 1.3 09-Oct-1997  lukem rcsid police
 1.2 01-Aug-1993  mycroft Add RCS indentifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.6.12.2 22-Mar-2002  nathanw Catch up to -current.
 1.6.12.1 08-Mar-2002  nathanw Catch up to -current.
 1.20 28-Dec-2022  riastradh swab(3): Rewrite this to be understandable.

And make the tests work, and exercise all lengths up to 100.

Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141

XXX pullup-8
XXX pullup-9
XXX pullup-10
 1.19 28-Dec-2022  kre PR lib/57141 - never decrement len without actually performing a STEP.
 1.18 04-Jan-2011  martin branches: 1.18.38; 1.18.48; 1.18.56;
Special-case the (unlikely in practice) call with len = 2 - previously
the code would not have swapped anything. Problem pointed out by
sparc64 automatic test run.
 1.17 18-Apr-2010  apb The number of byte pairs to swap is len/2, not len/2+1.
 1.16 18-Apr-2010  apb Bitwise operations on signed types are well-defined if the values
happen to be positive, and indeed the values here were guaranteed
to be positive, but some compilers complained anyway, so convert
the bitwise operations to arithmetic operations.
 1.15 18-Apr-2010  christos simplify
 1.14 17-Apr-2010  christos fix lint
 1.13 17-Apr-2010  christos Change and document for POSIX compliance.
 1.12 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.11 22-May-2001  christos fix incorrect loop sentinel caused by previous de-linting.
 1.10 26-Jan-2001  wiz branches: 1.10.2;
ANSIfy and de-lint. Reviewed by christos.
 1.9 20-Sep-1999  lukem back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
 1.8 16-Sep-1999  lukem * use _DIAGASSERT() to check pointer arguments against NULL and file
descriptors against -1 (as appropriate).
* add actual checks which to detect stuff that would trigger_DIAGASSERT(),
and attempt to return a sane error condition.
* knf some code
* remove some `register' decls.

the first two items result in the addition of code similar to the
following in various functions:

_DIAGASSERT(path != NULL)
#ifdef _DIAGNOSTIC
if (path == NULL) {
errno = EFAULT;
return (-1);
}
#endif
 1.7 03-Feb-1998  perry remove obsolete register declarations
 1.6 30-Jan-1998  perry update to lite-2
 1.5 12-Jan-1998  kleink Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.
 1.4 13-Jul-1997  christos Fix RCSID's
Use "extern.h" where appropriate.
 1.3 26-Aug-1993  jtc branches: 1.3.8;
Declare rcsid strings so they are stored in text segment.
 1.2 01-Aug-1993  mycroft Add RCS identifiers.
 1.1 21-Mar-1993  cgd branches: 1.1.1;
Initial revision
 1.1.1.2 30-Jan-1998  perry import lite-2
 1.1.1.1 21-Mar-1993  cgd initial import of 386bsd-0.1 sources
 1.3.8.1 20-Sep-1996  jtc snapshot namespace cleanup: net, etc.
 1.10.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.18.56.1 22-Feb-2023  martin Pull up following revision(s) (requested by riastradh in ticket #98):

tests/lib/libc/string/t_swab.c: revision 1.3
lib/libc/string/swab.c: revision 1.20

swab(3): Rewrite this to be understandable.

And make the tests work, and exercise all lengths up to 100.
Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141
 1.18.48.1 22-Feb-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1601):

tests/lib/libc/string/t_swab.c: revision 1.3
lib/libc/string/swab.c: revision 1.20

swab(3): Rewrite this to be understandable.

And make the tests work, and exercise all lengths up to 100.
Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141
 1.18.38.1 22-Feb-2023  martin Pull up following revision(s) (requested by riastradh in ticket #1798):

tests/lib/libc/string/t_swab.c: revision 1.3
lib/libc/string/swab.c: revision 1.20

swab(3): Rewrite this to be understandable.

And make the tests work, and exercise all lengths up to 100.
Evidently the previous definition, presumably tightly optimized for
1980s-era compilers and CPUs, was too hard to understand, because it
was incorrectly tested for two decades and broken for years.

PR lib/57141
 1.6 14-Jul-2016  abhinav Fix sentence.
 1.5 14-Jul-2016  abhinav Fix grammar and be consistent between using 0 and zero.
 1.4 13-Jul-2016  abhinav Add STANDARDS section, referencing IEEE std 1003.1-2008
ok wiz@
 1.3 16-Dec-2010  wiz Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
 1.2 02-Sep-2006  wiz Mark up NULL; the character is nul, not null; sort SEE ALSO;
add RCS Id at top of file.
 1.1 26-Aug-2006  christos branches: 1.1.2;
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
 1.1.2.1 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.4 17-May-2013  joerg Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.3 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.2 26-Aug-2006  christos branches: 1.2.2; 1.2.44; 1.2.50;
Add copyright notices.
 1.1 22-Aug-2006  christos PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
 1.2.50.1 23-Jun-2013  tls resync from head
 1.2.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.2.2.2 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.2.2.1 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.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.4 04-Jun-2005  dsl Only advance 'p' once each time around the loop....
 1.3 30-May-2005  christos It is really pointless to come up with new implementations of the wide string
functions instead of using the narrow string ones. Make this look like
strchr, so that wcschr(L"foo", L'\0') does not return NULL as it should.
 1.2 03-Jan-2001  lukem branches: 1.2.8; 1.2.10;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.10.2 04-Jun-2005  riz Pull up revision 1.4 (requested by dsl in ticket #422):
Only advance 'p' once each time around the loop....
 1.2.10.1 30-May-2005  tron Pull up revision 1.3 (requested by christos in ticket #357):
It is really pointless to come up with new implementations of the wide string
functions instead of using the narrow string ones. Make this look like
strchr, so that wcschr(L"foo", L'\0') does not return NULL as it should.
 1.2.8.2 04-Jun-2005  riz Pull up revision 1.4 (requested by dsl in ticket #1977):
Only advance 'p' once each time around the loop....
 1.2.8.1 31-May-2005  riz Pull up revision 1.3 (requested by christos in ticket #1872):
It is really pointless to come up with new implementations of the wide string
functions instead of using the narrow string ones. Make this look like
strchr, so that wcschr(L"foo", L'\0') does not return NULL as it should.
 1.9 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.8 11-Jan-2009  christos branches: 1.8.8;
merge christos-time_t
 1.7 05-Jan-2009  tnozaki 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
 1.6 02-Jan-2009  tnozaki Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.5 07-Aug-2003  agc branches: 1.5.38; 1.5.40;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 06-Apr-2003  tshiozak - support for the additional code area of zh_CN.GB18030 locale,
- make sure that __nbrune_t is unsigned 32bit clean and
- fix wrong copyright notice in the last commit.
this patch is contributed by Takehiko NOZAKI <sigsegv at s25 dot xrea dot com>.
 1.3 05-Jan-2001  itojun fix wcs*cmp() behavior when the wide char string is equal. from soda
XXX assumes wchar_t == int.
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.5.40.2 10-Jan-2009  christos sync with head.
 1.5.40.1 04-Jan-2009  christos merge with head.
 1.5.38.2 15-Jan-2009  snj Pull up following revision(s) (requested by jmcneill in ticket #270):
lib/libc/locale/fix_grouping.c: revision 1.3
lib/libc/locale/iswctype_sb.c: revision 1.7
lib/libc/locale/rune.h: revision 1.14
lib/libc/locale/runetype.h: file removal
lib/libc/locale/runetype_local.h: revision 1.1
lib/libc/stdio/fparseln.c: revision 1.8
lib/libc/string/wcscmp.c: revision 1.7
lib/libc/string/wcsncmp.c: revision 1.7
lib/libc/string/wmemcmp.c: revision 1.5
tools/compat/configure: regen
tools/compat/configure.ac: revision 1.68
tools/compat/nbtool_config.h.in: regen
usr.bin/mklocale/Makefile: revision 1.15
usr.bin/mklocale/lex.l: revision 1.16
usr.bin/mklocale/yacc.y: revision 1.27
1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.
2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.
3. fix build breakage when CITRUS=no was set.
 1.5.38.1 15-Jan-2009  snj Pull up following revision(s) (requested by tnozaki in ticket #222):
distrib/sets/lists/base/mi: revision 1.788
distrib/utils/libhack/Makefile.inc: revision 1.23
distrib/utils/libhack/Makefile: revision 1.22
etc/mtree/NetBSD.dist: revision 1.387
include/locale.h: revision 1.15
lib/libc/citrus/Makefile.inc: revision 1.6
lib/libc/citrus/citrus_aliasname_local.h: revision 1.1
lib/libc/citrus/citrus_bcs.h: revision 1.5
lib/libc/citrus/citrus_bcs_strtol.c: revision 1.1
lib/libc/citrus/citrus_bcs_strtoul.c: revision 1.1
lib/libc/citrus/citrus_csmapper.c: revision 1.9
lib/libc/citrus/citrus_fix_grouping.h: revision 1.1
lib/libc/citrus/citrus_lc_ctype.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.h: revision 1.1
lib/libc/citrus/citrus_lc_monetary.c: revision 1.1
lib/libc/citrus/citrus_lc_monetary.h: revision 1.1
lib/libc/citrus/citrus_lc_numeric.c: revision 1.1
lib/libc/citrus/citrus_lc_numeric.h: revision 1.1
lib/libc/citrus/citrus_lc_template.h: revision 1.1
lib/libc/citrus/citrus_lc_template_decl.h: revision 1.1
lib/libc/citrus/citrus_lc_time.c: revision 1.1
lib/libc/citrus/citrus_lc_time.h: revision 1.1
lib/libc/citrus/citrus_module.c: revision 1.8
lib/libc/citrus/citrus_namespace.h: revision 1.7
lib/libc/citrus/modules/citrus_euc.c: revision 1.13
lib/libc/gen/Makefile.inc: revision 1.166
lib/libc/gen/isctype.c: revision 1.17 via patch
lib/libc/gen/tolower_.c: revision 1.10
lib/libc/gen/toupper_.c: revision 1.10
lib/libc/iconv/Makefile.inc: revision 1.3
lib/libc/iconv/iconv.c: revision 1.7
lib/libc/locale/Makefile.inc: revision 1.53
lib/libc/locale/___runetype_mb.c: file removal
lib/libc/locale/_wctrans.c: revision 1.7
lib/libc/locale/_wctrans_local.h: revision 1.3
lib/libc/locale/_wctype.c: revision 1.1
lib/libc/locale/_wctype_local.h: revision 1.1
lib/libc/locale/aliasname.c: revision 1.3
lib/libc/locale/aliasname_local.h: revision 1.2
lib/libc/locale/bsdctype.c: revision 1.1
lib/libc/locale/bsdctype.h: revision 1.1
lib/libc/locale/ctypeio.c: revision 1.8
lib/libc/locale/ctypeio.h: revision 1.2
lib/libc/locale/current_locale.c: revision 1.1
lib/libc/locale/dummy_lc_collate.c: revision 1.1
lib/libc/locale/dummy_lc_template.h: revision 1.1
lib/libc/locale/fix_grouping.c: revision 1.1
lib/libc/locale/fix_grouping.h: revision 1.1
lib/libc/locale/generic_lc_all.c: revision 1.1
lib/libc/locale/generic_lc_template.h: revision 1.1
lib/libc/locale/generic_lc_template_decl.h: revision 1.1
lib/libc/locale/global_locale.c: revision 1.1
lib/libc/locale/iswctype.c: file removal
lib/libc/locale/iswctype_mb.c: revision 1.1
lib/libc/locale/iswctype_sb.c: revision 1.6
lib/libc/locale/lcmessages.c: file removal
lib/libc/locale/lcmessages.h: file removal
lib/libc/locale/lcmonetary.c: file removal
lib/libc/locale/lcmonetary.h: file removal
lib/libc/locale/lcnumeric.c: file removal
lib/libc/locale/lcnumeric.h: file removal
lib/libc/locale/lctime.c: file removal
lib/libc/locale/lctime.h: file removal
lib/libc/locale/localeconv.c: revision 1.15
lib/libc/locale/localeio.c: revision 1.2
lib/libc/locale/localeio.h: revision 1.2
lib/libc/locale/localeio_lc_ctype.c: revision 1.1
lib/libc/locale/localeio_lc_messages.c: revision 1.1
lib/libc/locale/localeio_lc_monetary.c: revision 1.1
lib/libc/locale/localeio_lc_numeric.c: revision 1.1
lib/libc/locale/localeio_lc_time.c: revision 1.1
lib/libc/locale/multibyte.h: revision 1.4
lib/libc/locale/multibyte_amd1.c: revision 1.6
lib/libc/locale/multibyte_c90.c: revision 1.5
lib/libc/locale/nb_lc_messages_misc.h: revision 1.1
lib/libc/locale/nb_lc_monetary_misc.h: revision 1.1
lib/libc/locale/nb_lc_numeric_misc.h: revision 1.1
lib/libc/locale/nb_lc_template.h: revision 1.1
lib/libc/locale/nb_lc_template_decl.h: revision 1.1
lib/libc/locale/nb_lc_time_misc.h: revision 1.1
lib/libc/locale/nl_langinfo.c: revision 1.12
lib/libc/locale/rune.c: revision 1.31
lib/libc/locale/rune.h: revision 1.13
lib/libc/locale/rune_local.h: revision 1.11
lib/libc/locale/runeglue.c: revision 1.14
lib/libc/locale/runetable.c: revision 1.18
lib/libc/locale/setlocale.c: revision 1.55 via patch
lib/libc/locale/setlocale_local.h: revision 1.1
lib/libc/locale/setrunelocale.c: file removal
lib/libc/nls/Makefile.inc: revision 1.9
lib/libc/nls/catopen.c: revision 1.26
lib/libc/string/Makefile.inc: revision 1.68
lib/libc/string/wcscmp.c: revision 1.6
lib/libc/string/wcsncmp.c: revision 1.6
lib/libc/string/wcswidth.c: file removal
lib/libc/string/wmemcmp.c: revision 1.4
regress/lib/libc/locale/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/en_US.UTF-8.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.exp.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.in.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.exp.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.in.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.SJIS.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.eucJP.exp.uue: revision 1.2
regress/lib/libc/locale/ctype2/Makefile: revision 1.5
regress/lib/libc/locale/ctype2/ja_JP.ISO-2022-JP-2.in.uue: revision 1.1
regress/lib/libc/locale/ctype2/ja_JP.ISO2022-JP2.in.uue: file removal
regress/lib/libc/locale/ctype3/Makefile: revision 1.5
regress/lib/libc/locale/mbtowc/Makefile: revision 1.3
regress/lib/libc/locale/mbtowc/ja_JP.ISO-2022-JP: revision 1.1
regress/lib/libc/locale/mbtowc/ja_JP.ISO2022-JP: file removal
regress/lib/libc/locale/wcstod/wcstod_test.c: revision 1.2
share/locale/Makefile.locale: revision 1.1
share/locale/Makefile: revision 1.5
share/locale/ctype/Makefile: revision 1.28
share/locale/locale.alias: revision 1.11
share/locale/messages/Makefile: revision 1.5
share/locale/messages/en_US.ISO8859-1.src: file removal
share/locale/messages/en_US.US-ASCII.src: revision 1.1
share/locale/messages/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/messages/ja_JP.ct.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-2.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-5.src: revision 1.1
share/locale/messages/sr_YU.ISO8859-2.src: file removal
share/locale/messages/sr_YU.ISO8859-5.src: file removal
share/locale/messages/sr_YU.UTF-8.src: file removal
share/locale/messages/zh_CN.GB18030.src: file removal
share/locale/messages/zh_TW.eucTW.src: revision 1.1
share/locale/monetary/Makefile: revision 1.5
share/locale/monetary/af_ZA.ISO8859-1.src: revision 1.2
share/locale/monetary/am_ET.UTF-8.src: revision 1.2
share/locale/monetary/be_BY.CP1131.src: file removal
share/locale/monetary/be_BY.CP1251.src: revision 1.2
share/locale/monetary/be_BY.ISO8859-5.src: revision 1.2
share/locale/monetary/be_BY.UTF-8.src: revision 1.2
share/locale/monetary/bg_BG.CP1251.src: revision 1.2
share/locale/monetary/bg_BG.UTF-8.src: revision 1.2
share/locale/monetary/ca_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/cs_CZ.ISO8859-2.src: revision 1.2
share/locale/monetary/cs_CZ.UTF-8.src: revision 1.2
share/locale/monetary/da_DK.ISO8859-1.src: revision 1.2
share/locale/monetary/de_AT.ISO8859-1.src: revision 1.2
share/locale/monetary/de_CH.ISO8859-1.src: revision 1.2
share/locale/monetary/de_DE.ISO8859-1.src: revision 1.2
share/locale/monetary/el_GR.ISO8859-7.src: revision 1.2
share/locale/monetary/en_AU.ISO8859-1.src: revision 1.2
share/locale/monetary/en_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.UTF-8.src: revision 1.2
share/locale/monetary/en_IE.UTF-8.src: revision 1.2
share/locale/monetary/en_NZ.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.US-ASCII.src: revision 1.1
share/locale/monetary/es_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/et_EE.ISO8859-15.src: revision 1.2
share/locale/monetary/fi_FI.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_FR.ISO8859-1.src: revision 1.2
share/locale/monetary/he_IL.UTF-8.src: revision 1.2
share/locale/monetary/hi_IN.ISCII-DEV.src: revision 1.2
share/locale/monetary/hr_HR.ISO8859-2.src: revision 1.2
share/locale/monetary/hu_HU.ISO8859-2.src: revision 1.2
share/locale/monetary/hy_AM.ARMSCII-8.src: revision 1.2
share/locale/monetary/hy_AM.UTF-8.src: revision 1.2
share/locale/monetary/is_IS.ISO8859-1.src: revision 1.2
share/locale/monetary/it_IT.ISO8859-1.src: revision 1.2
share/locale/monetary/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/monetary/ja_JP.UTF-8.src: revision 1.2
share/locale/monetary/ja_JP.eucJP.src: revision 1.2
share/locale/monetary/kk_KZ.PT154.src: revision 1.2
share/locale/monetary/kk_KZ.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.eucKR.src: revision 1.2
share/locale/monetary/lt_LT.ISO8859-13.src: revision 1.2
share/locale/monetary/mn_MN.UTF-8.src: revision 1.2
share/locale/monetary/nl_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/nl_NL.ISO8859-1.src: revision 1.2
share/locale/monetary/no_NO.ISO8859-1.src: revision 1.2
share/locale/monetary/pl_PL.ISO8859-2.src: revision 1.2
share/locale/monetary/pl_PL.UTF-8.src: revision 1.2
share/locale/monetary/pt_BR.ISO8859-1.src: revision 1.2
share/locale/monetary/pt_PT.ISO8859-1.src: revision 1.2
share/locale/monetary/ro_RO.ISO8859-2.src: revision 1.2
share/locale/monetary/ru_RU.CP1251.src: revision 1.2
share/locale/monetary/ru_RU.CP866.src: revision 1.2
share/locale/monetary/ru_RU.ISO8859-5.src: revision 1.2
share/locale/monetary/ru_RU.KOI8-R.src: revision 1.2
share/locale/monetary/ru_RU.UTF-8.src: revision 1.2
share/locale/monetary/sk_SK.ISO8859-2.src: revision 1.2
share/locale/monetary/sl_SI.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_ME.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_RS.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_YU.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_YU.ISO8859-5.src: revision 1.2
share/locale/monetary/sr_YU.UTF-8.src: revision 1.2
share/locale/monetary/sv_SE.ISO8859-1.src: revision 1.2
share/locale/monetary/tr_TR.ISO8859-9.src: revision 1.2
share/locale/monetary/uk_UA.CP1251.src: revision 1.2
share/locale/monetary/uk_UA.ISO8859-5.src: revision 1.2
share/locale/monetary/uk_UA.KOI8-U.src: revision 1.2
share/locale/monetary/uk_UA.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.GB18030.src: revision 1.2
share/locale/monetary/zh_CN.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.eucCN.src: revision 1.2
share/locale/monetary/zh_HK.Big5hkscs.src: revision 1.1
share/locale/monetary/zh_HK.UTF-8.src: revision 1.2
share/locale/monetary/zh_TW.Big5.src: revision 1.2
share/locale/numeric/Makefile: revision 1.4
share/locale/numeric/am_ET.UTF-8.src: file removal
share/locale/numeric/en_US.ISO8859-1.src: file removal
share/locale/numeric/en_US.US-ASCII.src: revision 1.1
share/locale/numeric/ja_JP.eucJP.src: file removal
share/locale/numeric/ko_KR.eucKR.src: file removal
share/locale/numeric/mn_MN.UTF-8.src: file removal
share/locale/numeric/sr_ME.ISO8859-2.src: revision 1.1
share/locale/numeric/sr_YU.ISO8859-2.src: file removal
share/locale/numeric/sr_YU.ISO8859-5.src: file removal
share/locale/numeric/zh_CN.eucCN.src: file removal
share/locale/time/Makefile: revision 1.5
share/locale/time/en_US.ISO8859-1.src: file removal
share/locale/time/en_US.US-ASCII.src: revision 1.1
share/locale/time/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/time/ja_JP.ct.src: revision 1.1
share/locale/time/sr_ME.ISO8859-2.src: revision 1.1
share/locale/time/sr_ME.ISO8859-5.src: revision 1.1
share/locale/time/sr_ME.UTF-8.src: revision 1.1
share/locale/time/sr_YU.ISO8859-2.src: file removal
share/locale/time/sr_YU.ISO8859-5.src: file removal
share/locale/time/sr_YU.UTF-8.src: file removal
share/locale/time/zh_CN.GB18030.src: file removal
share/locale/time/zh_TW.eucTW.src: revision 1.1
usr.bin/locale/locale.c: revision 1.6
usr.bin/mklocale/Makefile: revision 1.12
usr.bin/mklocale/lex.l: revision 1.14
usr.bin/mklocale/mklocaledb.c: revision 1.1
usr.bin/mklocale/yacc.y: revision 1.25
usr.sbin/chrtbl/Makefile: revision 1.8
usr.sbin/chrtbl/ctypeio.c: revision 1.1
usr.sbin/chrtbl/ctypeio.h: revision 1.1
Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES}
db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).
[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].
[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().
[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<
old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.8.8.1 30-Oct-2012  yamt sync with head
 1.4 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.3 13-Oct-2005  tnozaki branches: 1.3.44;
wcscpy - cleanup
wcsncpy - SUSv6 if s2 is shorter than n, s1 should be filled with L'\0' until n.
 1.2 03-Jan-2001  lukem branches: 1.2.10;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.10.1 12-Jul-2006  tron Pull up following revision(s) (requested by tnozaki in ticket #1386):
lib/libc/string/wcscpy.c: revision 1.3
lib/libc/string/wcsncpy.c: revision 1.3
wcscpy - cleanup
wcsncpy - SUSv3 if s2 is shorter than n, s1 should be filled with L'\0' until n.
 1.3.44.1 30-Oct-2012  yamt sync with head
 1.4 24-Nov-2011  joerg In wcscspn and wcspbrk, handle set size of 0 and 1 explicitly.
For larger sets, use a bloom filter to avoid the inner loop for most of
the input. The current implementation uses a simple modular hash as
first function (well suited for input e.g. in ISO Latin character sets)
and a more complex multiplicative hash as second function with a filter
size of 512 Bit. This reduces the typical run time to O(n+m).
 1.3 21-Nov-2011  joerg Clean up a bit in preparation for more serious changes
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 17-Apr-2012  yamt sync with head
 1.4 25-Nov-2011  joerg branches: 1.4.4;
If we have to cast, do it properly.
 1.3 25-Nov-2011  dholland Use CHAR_BIT; don't hardwire 8. Fix logic slightly to work with arbitrary
CHAR_BIT. Compiler output unchanged (on amd64).
 1.2 25-Nov-2011  tron Add explicit casts to make lint happy and fix the NetBSD/i386 build.
 1.1 24-Nov-2011  joerg In wcscspn and wcspbrk, handle set size of 0 and 1 explicitly.
For larger sets, use a bloom filter to avoid the inner loop for most of
the input. The current implementation uses a simple modular hash as
first function (well suited for input e.g. in ISO Latin character sets)
and a more complex multiplicative hash as second function with a filter
size of 512 Bit. This reduces the typical run time to O(n+m).
 1.4.4.2 17-Apr-2012  yamt sync with head
 1.4.4.1 25-Nov-2011  yamt file wcscspn_bloom.h was added on branch yamt-pagecache on 2012-04-17 00:05:25 +0000
 1.4 28-Dec-2012  wiz Add "wide" to description. From OpenBSD via Ingo Schwarze.
 1.3 16-Dec-2010  wiz branches: 1.3.6; 1.3.12;
Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
 1.2 02-Sep-2006  wiz Mark up NULL; the character is nul, not null; sort SEE ALSO;
add RCS Id at top of file.
 1.1 26-Aug-2006  christos branches: 1.1.2;
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
 1.1.2.1 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.3.12.1 25-Feb-2013  tls resync with head
 1.3.6.1 23-Jan-2013  yamt sync with head
 1.6 12-Mar-2022  christos reallocarr returns errno. preserve it.
 1.5 29-Oct-2021  nia reallocarr does not set errno.
 1.4 29-Oct-2021  nia wcsdup(3): use reallocarr to catch integer overflow
 1.3 26-May-2008  haad branches: 1.3.6;
Remove unneeded #include <string.h>, found by Adam Hoka.

Ok'ed by martin@.
 1.2 26-Aug-2006  christos branches: 1.2.2; 1.2.18; 1.2.20;
Add copyright notices.
 1.1 22-Aug-2006  christos PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
 1.2.20.1 23-Jun-2008  wrstuden Sync w/ -current. 34 merge conflicts to follow.
 1.2.18.1 04-Jun-2008  yamt sync with head
 1.2.2.2 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.2.2.1 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.3.6.2 26-May-2008  haad Remove unneeded #include <string.h>, found by Adam Hoka.

Ok'ed by martin@.
 1.3.6.1 26-May-2008  haad file wcsdup.c was added on branch christos-time_t on 2008-05-26 13:17:49 +0000
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
remove register
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
remove register
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.4 17-May-2013  joerg Provide explicit LC_C_LOCALE accessor and drop the various NULL checks.
Provide LC_GLOBAL_LOCALE in a way that works with all locale functions.
Merge constant data used by the initial global locale and the C locale.
Drop function call layer for _current_locale() and directly return the
locale reference, not a pointer to it. Use protected access for global
variables, so that libc references can avoid the GOT overhead.
 1.3 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.2 26-Aug-2006  christos branches: 1.2.2; 1.2.44; 1.2.50;
Add copyright notices.
 1.1 22-Aug-2006  christos PR/34238: Aleksey Cheusov: add wcsdup, wcscasecmp and wcsncasecmp functions
 1.2.50.1 23-Jun-2013  tls resync from head
 1.2.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.2.2.2 01-Sep-2006  riz Pull up following revision(s) (requested by tron in ticket #78):
lib/libc/string/wcsdup.c: revision 1.2
lib/libc/string/wcsdup.3: revision 1.1
lib/libc/string/wcscasecmp.3: revision 1.1
lib/libc/string/wcscasecmp.c: revision 1.2
distrib/sets/lists/comp/mi: revision 1.917
lib/libc/string/Makefile.inc: revision 1.64
lib/libc/string/Makefile.inc: revision 1.65
lib/libc/string/wcsncasecmp.c: revision 1.2
Add copyright notices.
PR/34238: Aleksey Cheusov: man pages for wcsdup, wcscasecmp and wcsncasecmp
functions
add man pages for wcsdup, wcscasecmp, wcsncasecmp
fix xtos's pasto
 1.2.2.1 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.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.9 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.8 11-Jan-2009  christos branches: 1.8.8;
merge christos-time_t
 1.7 05-Jan-2009  tnozaki 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
 1.6 02-Jan-2009  tnozaki Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.5 07-Aug-2003  agc branches: 1.5.38; 1.5.40;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.4 06-Apr-2003  tshiozak - support for the additional code area of zh_CN.GB18030 locale,
- make sure that __nbrune_t is unsigned 32bit clean and
- fix wrong copyright notice in the last commit.
this patch is contributed by Takehiko NOZAKI <sigsegv at s25 dot xrea dot com>.
 1.3 05-Jan-2001  itojun fix wcs*cmp() behavior when the wide char string is equal. from soda
XXX assumes wchar_t == int.
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.5.40.2 10-Jan-2009  christos sync with head.
 1.5.40.1 04-Jan-2009  christos merge with head.
 1.5.38.2 15-Jan-2009  snj Pull up following revision(s) (requested by jmcneill in ticket #270):
lib/libc/locale/fix_grouping.c: revision 1.3
lib/libc/locale/iswctype_sb.c: revision 1.7
lib/libc/locale/rune.h: revision 1.14
lib/libc/locale/runetype.h: file removal
lib/libc/locale/runetype_local.h: revision 1.1
lib/libc/stdio/fparseln.c: revision 1.8
lib/libc/string/wcscmp.c: revision 1.7
lib/libc/string/wcsncmp.c: revision 1.7
lib/libc/string/wmemcmp.c: revision 1.5
tools/compat/configure: regen
tools/compat/configure.ac: revision 1.68
tools/compat/nbtool_config.h.in: regen
usr.bin/mklocale/Makefile: revision 1.15
usr.bin/mklocale/lex.l: revision 1.16
usr.bin/mklocale/yacc.y: revision 1.27
1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.
2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.
3. fix build breakage when CITRUS=no was set.
 1.5.38.1 15-Jan-2009  snj Pull up following revision(s) (requested by tnozaki in ticket #222):
distrib/sets/lists/base/mi: revision 1.788
distrib/utils/libhack/Makefile.inc: revision 1.23
distrib/utils/libhack/Makefile: revision 1.22
etc/mtree/NetBSD.dist: revision 1.387
include/locale.h: revision 1.15
lib/libc/citrus/Makefile.inc: revision 1.6
lib/libc/citrus/citrus_aliasname_local.h: revision 1.1
lib/libc/citrus/citrus_bcs.h: revision 1.5
lib/libc/citrus/citrus_bcs_strtol.c: revision 1.1
lib/libc/citrus/citrus_bcs_strtoul.c: revision 1.1
lib/libc/citrus/citrus_csmapper.c: revision 1.9
lib/libc/citrus/citrus_fix_grouping.h: revision 1.1
lib/libc/citrus/citrus_lc_ctype.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.h: revision 1.1
lib/libc/citrus/citrus_lc_monetary.c: revision 1.1
lib/libc/citrus/citrus_lc_monetary.h: revision 1.1
lib/libc/citrus/citrus_lc_numeric.c: revision 1.1
lib/libc/citrus/citrus_lc_numeric.h: revision 1.1
lib/libc/citrus/citrus_lc_template.h: revision 1.1
lib/libc/citrus/citrus_lc_template_decl.h: revision 1.1
lib/libc/citrus/citrus_lc_time.c: revision 1.1
lib/libc/citrus/citrus_lc_time.h: revision 1.1
lib/libc/citrus/citrus_module.c: revision 1.8
lib/libc/citrus/citrus_namespace.h: revision 1.7
lib/libc/citrus/modules/citrus_euc.c: revision 1.13
lib/libc/gen/Makefile.inc: revision 1.166
lib/libc/gen/isctype.c: revision 1.17 via patch
lib/libc/gen/tolower_.c: revision 1.10
lib/libc/gen/toupper_.c: revision 1.10
lib/libc/iconv/Makefile.inc: revision 1.3
lib/libc/iconv/iconv.c: revision 1.7
lib/libc/locale/Makefile.inc: revision 1.53
lib/libc/locale/___runetype_mb.c: file removal
lib/libc/locale/_wctrans.c: revision 1.7
lib/libc/locale/_wctrans_local.h: revision 1.3
lib/libc/locale/_wctype.c: revision 1.1
lib/libc/locale/_wctype_local.h: revision 1.1
lib/libc/locale/aliasname.c: revision 1.3
lib/libc/locale/aliasname_local.h: revision 1.2
lib/libc/locale/bsdctype.c: revision 1.1
lib/libc/locale/bsdctype.h: revision 1.1
lib/libc/locale/ctypeio.c: revision 1.8
lib/libc/locale/ctypeio.h: revision 1.2
lib/libc/locale/current_locale.c: revision 1.1
lib/libc/locale/dummy_lc_collate.c: revision 1.1
lib/libc/locale/dummy_lc_template.h: revision 1.1
lib/libc/locale/fix_grouping.c: revision 1.1
lib/libc/locale/fix_grouping.h: revision 1.1
lib/libc/locale/generic_lc_all.c: revision 1.1
lib/libc/locale/generic_lc_template.h: revision 1.1
lib/libc/locale/generic_lc_template_decl.h: revision 1.1
lib/libc/locale/global_locale.c: revision 1.1
lib/libc/locale/iswctype.c: file removal
lib/libc/locale/iswctype_mb.c: revision 1.1
lib/libc/locale/iswctype_sb.c: revision 1.6
lib/libc/locale/lcmessages.c: file removal
lib/libc/locale/lcmessages.h: file removal
lib/libc/locale/lcmonetary.c: file removal
lib/libc/locale/lcmonetary.h: file removal
lib/libc/locale/lcnumeric.c: file removal
lib/libc/locale/lcnumeric.h: file removal
lib/libc/locale/lctime.c: file removal
lib/libc/locale/lctime.h: file removal
lib/libc/locale/localeconv.c: revision 1.15
lib/libc/locale/localeio.c: revision 1.2
lib/libc/locale/localeio.h: revision 1.2
lib/libc/locale/localeio_lc_ctype.c: revision 1.1
lib/libc/locale/localeio_lc_messages.c: revision 1.1
lib/libc/locale/localeio_lc_monetary.c: revision 1.1
lib/libc/locale/localeio_lc_numeric.c: revision 1.1
lib/libc/locale/localeio_lc_time.c: revision 1.1
lib/libc/locale/multibyte.h: revision 1.4
lib/libc/locale/multibyte_amd1.c: revision 1.6
lib/libc/locale/multibyte_c90.c: revision 1.5
lib/libc/locale/nb_lc_messages_misc.h: revision 1.1
lib/libc/locale/nb_lc_monetary_misc.h: revision 1.1
lib/libc/locale/nb_lc_numeric_misc.h: revision 1.1
lib/libc/locale/nb_lc_template.h: revision 1.1
lib/libc/locale/nb_lc_template_decl.h: revision 1.1
lib/libc/locale/nb_lc_time_misc.h: revision 1.1
lib/libc/locale/nl_langinfo.c: revision 1.12
lib/libc/locale/rune.c: revision 1.31
lib/libc/locale/rune.h: revision 1.13
lib/libc/locale/rune_local.h: revision 1.11
lib/libc/locale/runeglue.c: revision 1.14
lib/libc/locale/runetable.c: revision 1.18
lib/libc/locale/setlocale.c: revision 1.55 via patch
lib/libc/locale/setlocale_local.h: revision 1.1
lib/libc/locale/setrunelocale.c: file removal
lib/libc/nls/Makefile.inc: revision 1.9
lib/libc/nls/catopen.c: revision 1.26
lib/libc/string/Makefile.inc: revision 1.68
lib/libc/string/wcscmp.c: revision 1.6
lib/libc/string/wcsncmp.c: revision 1.6
lib/libc/string/wcswidth.c: file removal
lib/libc/string/wmemcmp.c: revision 1.4
regress/lib/libc/locale/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/en_US.UTF-8.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.exp.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.in.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.exp.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.in.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.SJIS.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.eucJP.exp.uue: revision 1.2
regress/lib/libc/locale/ctype2/Makefile: revision 1.5
regress/lib/libc/locale/ctype2/ja_JP.ISO-2022-JP-2.in.uue: revision 1.1
regress/lib/libc/locale/ctype2/ja_JP.ISO2022-JP2.in.uue: file removal
regress/lib/libc/locale/ctype3/Makefile: revision 1.5
regress/lib/libc/locale/mbtowc/Makefile: revision 1.3
regress/lib/libc/locale/mbtowc/ja_JP.ISO-2022-JP: revision 1.1
regress/lib/libc/locale/mbtowc/ja_JP.ISO2022-JP: file removal
regress/lib/libc/locale/wcstod/wcstod_test.c: revision 1.2
share/locale/Makefile.locale: revision 1.1
share/locale/Makefile: revision 1.5
share/locale/ctype/Makefile: revision 1.28
share/locale/locale.alias: revision 1.11
share/locale/messages/Makefile: revision 1.5
share/locale/messages/en_US.ISO8859-1.src: file removal
share/locale/messages/en_US.US-ASCII.src: revision 1.1
share/locale/messages/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/messages/ja_JP.ct.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-2.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-5.src: revision 1.1
share/locale/messages/sr_YU.ISO8859-2.src: file removal
share/locale/messages/sr_YU.ISO8859-5.src: file removal
share/locale/messages/sr_YU.UTF-8.src: file removal
share/locale/messages/zh_CN.GB18030.src: file removal
share/locale/messages/zh_TW.eucTW.src: revision 1.1
share/locale/monetary/Makefile: revision 1.5
share/locale/monetary/af_ZA.ISO8859-1.src: revision 1.2
share/locale/monetary/am_ET.UTF-8.src: revision 1.2
share/locale/monetary/be_BY.CP1131.src: file removal
share/locale/monetary/be_BY.CP1251.src: revision 1.2
share/locale/monetary/be_BY.ISO8859-5.src: revision 1.2
share/locale/monetary/be_BY.UTF-8.src: revision 1.2
share/locale/monetary/bg_BG.CP1251.src: revision 1.2
share/locale/monetary/bg_BG.UTF-8.src: revision 1.2
share/locale/monetary/ca_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/cs_CZ.ISO8859-2.src: revision 1.2
share/locale/monetary/cs_CZ.UTF-8.src: revision 1.2
share/locale/monetary/da_DK.ISO8859-1.src: revision 1.2
share/locale/monetary/de_AT.ISO8859-1.src: revision 1.2
share/locale/monetary/de_CH.ISO8859-1.src: revision 1.2
share/locale/monetary/de_DE.ISO8859-1.src: revision 1.2
share/locale/monetary/el_GR.ISO8859-7.src: revision 1.2
share/locale/monetary/en_AU.ISO8859-1.src: revision 1.2
share/locale/monetary/en_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.UTF-8.src: revision 1.2
share/locale/monetary/en_IE.UTF-8.src: revision 1.2
share/locale/monetary/en_NZ.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.US-ASCII.src: revision 1.1
share/locale/monetary/es_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/et_EE.ISO8859-15.src: revision 1.2
share/locale/monetary/fi_FI.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_FR.ISO8859-1.src: revision 1.2
share/locale/monetary/he_IL.UTF-8.src: revision 1.2
share/locale/monetary/hi_IN.ISCII-DEV.src: revision 1.2
share/locale/monetary/hr_HR.ISO8859-2.src: revision 1.2
share/locale/monetary/hu_HU.ISO8859-2.src: revision 1.2
share/locale/monetary/hy_AM.ARMSCII-8.src: revision 1.2
share/locale/monetary/hy_AM.UTF-8.src: revision 1.2
share/locale/monetary/is_IS.ISO8859-1.src: revision 1.2
share/locale/monetary/it_IT.ISO8859-1.src: revision 1.2
share/locale/monetary/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/monetary/ja_JP.UTF-8.src: revision 1.2
share/locale/monetary/ja_JP.eucJP.src: revision 1.2
share/locale/monetary/kk_KZ.PT154.src: revision 1.2
share/locale/monetary/kk_KZ.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.eucKR.src: revision 1.2
share/locale/monetary/lt_LT.ISO8859-13.src: revision 1.2
share/locale/monetary/mn_MN.UTF-8.src: revision 1.2
share/locale/monetary/nl_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/nl_NL.ISO8859-1.src: revision 1.2
share/locale/monetary/no_NO.ISO8859-1.src: revision 1.2
share/locale/monetary/pl_PL.ISO8859-2.src: revision 1.2
share/locale/monetary/pl_PL.UTF-8.src: revision 1.2
share/locale/monetary/pt_BR.ISO8859-1.src: revision 1.2
share/locale/monetary/pt_PT.ISO8859-1.src: revision 1.2
share/locale/monetary/ro_RO.ISO8859-2.src: revision 1.2
share/locale/monetary/ru_RU.CP1251.src: revision 1.2
share/locale/monetary/ru_RU.CP866.src: revision 1.2
share/locale/monetary/ru_RU.ISO8859-5.src: revision 1.2
share/locale/monetary/ru_RU.KOI8-R.src: revision 1.2
share/locale/monetary/ru_RU.UTF-8.src: revision 1.2
share/locale/monetary/sk_SK.ISO8859-2.src: revision 1.2
share/locale/monetary/sl_SI.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_ME.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_RS.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_YU.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_YU.ISO8859-5.src: revision 1.2
share/locale/monetary/sr_YU.UTF-8.src: revision 1.2
share/locale/monetary/sv_SE.ISO8859-1.src: revision 1.2
share/locale/monetary/tr_TR.ISO8859-9.src: revision 1.2
share/locale/monetary/uk_UA.CP1251.src: revision 1.2
share/locale/monetary/uk_UA.ISO8859-5.src: revision 1.2
share/locale/monetary/uk_UA.KOI8-U.src: revision 1.2
share/locale/monetary/uk_UA.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.GB18030.src: revision 1.2
share/locale/monetary/zh_CN.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.eucCN.src: revision 1.2
share/locale/monetary/zh_HK.Big5hkscs.src: revision 1.1
share/locale/monetary/zh_HK.UTF-8.src: revision 1.2
share/locale/monetary/zh_TW.Big5.src: revision 1.2
share/locale/numeric/Makefile: revision 1.4
share/locale/numeric/am_ET.UTF-8.src: file removal
share/locale/numeric/en_US.ISO8859-1.src: file removal
share/locale/numeric/en_US.US-ASCII.src: revision 1.1
share/locale/numeric/ja_JP.eucJP.src: file removal
share/locale/numeric/ko_KR.eucKR.src: file removal
share/locale/numeric/mn_MN.UTF-8.src: file removal
share/locale/numeric/sr_ME.ISO8859-2.src: revision 1.1
share/locale/numeric/sr_YU.ISO8859-2.src: file removal
share/locale/numeric/sr_YU.ISO8859-5.src: file removal
share/locale/numeric/zh_CN.eucCN.src: file removal
share/locale/time/Makefile: revision 1.5
share/locale/time/en_US.ISO8859-1.src: file removal
share/locale/time/en_US.US-ASCII.src: revision 1.1
share/locale/time/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/time/ja_JP.ct.src: revision 1.1
share/locale/time/sr_ME.ISO8859-2.src: revision 1.1
share/locale/time/sr_ME.ISO8859-5.src: revision 1.1
share/locale/time/sr_ME.UTF-8.src: revision 1.1
share/locale/time/sr_YU.ISO8859-2.src: file removal
share/locale/time/sr_YU.ISO8859-5.src: file removal
share/locale/time/sr_YU.UTF-8.src: file removal
share/locale/time/zh_CN.GB18030.src: file removal
share/locale/time/zh_TW.eucTW.src: revision 1.1
usr.bin/locale/locale.c: revision 1.6
usr.bin/mklocale/Makefile: revision 1.12
usr.bin/mklocale/lex.l: revision 1.14
usr.bin/mklocale/mklocaledb.c: revision 1.1
usr.bin/mklocale/yacc.y: revision 1.25
usr.sbin/chrtbl/Makefile: revision 1.8
usr.sbin/chrtbl/ctypeio.c: revision 1.1
usr.sbin/chrtbl/ctypeio.h: revision 1.1
Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES}
db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).
[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].
[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().
[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<
old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.8.8.1 30-Oct-2012  yamt sync with head
 1.4 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.3 13-Oct-2005  tnozaki branches: 1.3.44;
wcscpy - cleanup
wcsncpy - SUSv6 if s2 is shorter than n, s1 should be filled with L'\0' until n.
 1.2 03-Jan-2001  lukem branches: 1.2.10;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.10.1 12-Jul-2006  tron Pull up following revision(s) (requested by tnozaki in ticket #1386):
lib/libc/string/wcscpy.c: revision 1.3
lib/libc/string/wcsncpy.c: revision 1.3
wcscpy - cleanup
wcsncpy - SUSv3 if s2 is shorter than n, s1 should be filled with L'\0' until n.
 1.3.44.1 30-Oct-2012  yamt sync with head
 1.2 15-Oct-2016  kamil branches: 1.2.2;
Add NetBSD CVS Id on top of the wcsnlen.c file
 1.1 15-Oct-2016  kamil Import wcsnlen(3) to libc

The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
 1.2.2.2 04-Nov-2016  pgoyette Sync with HEAD
 1.2.2.1 15-Oct-2016  pgoyette file wcsnlen.c was added on branch pgoyette-localcount on 2016-11-04 14:48:53 +0000
 1.5 24-Nov-2011  joerg In wcscspn and wcspbrk, handle set size of 0 and 1 explicitly.
For larger sets, use a bloom filter to avoid the inner loop for most of
the input. The current implementation uses a simple modular hash as
first function (well suited for input e.g. in ISO Latin character sets)
and a more complex multiplicative hash as second function with a filter
size of 512 Bit. This reduces the typical run time to O(n+m).
 1.4 21-Nov-2011  joerg Clean up a bit in preparation for more serious changes
 1.3 29-Nov-2005  christos branches: 1.3.44;
WARNS=4
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.3.44.1 17-Apr-2012  yamt sync with head
 1.4 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.3 29-Nov-2005  christos branches: 1.3.44;
WARNS=4
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.3.44.1 30-Oct-2012  yamt sync with head
 1.4 21-Nov-2011  joerg Clean up a bit in preparation for more serious changes
 1.3 21-Sep-2001  yamt branches: 1.3.58;
make it works.
 1.2 03-Jan-2001  lukem branches: 1.2.2;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.2.1 08-Oct-2001  nathanw Catch up to -current.
 1.3.58.1 17-Apr-2012  yamt sync with head
 1.5 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.4 29-Nov-2005  christos branches: 1.4.44;
WARNS=4
 1.3 05-Mar-2003  tshiozak changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.4.44.1 30-Oct-2012  yamt sync with head
 1.6 16-Dec-2010  wiz Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
 1.5 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.4 24-Jan-2004  wiz Lots of grammar and wording changes from jmc@openbsd, with some
additional consistency changes by me.
 1.3 08-Sep-2003  wiz Use St -isoC-9X instead of St -isoC9X, to be in sync with groff.
 1.2 07-Mar-2003  tshiozak add original FreeBSD RCS ID.
NOTE: these files were obtained from FreeBSD and fitted for NetBSD
by sigsegv@infoseek.jp.
 1.1 05-Mar-2003  tshiozak changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.4 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.3 10-Jul-2003  tshiozak branches: 1.3.56;
make _DIAGNOSTIC happy.
 1.2 07-Mar-2003  tshiozak add original FreeBSD RCS ID.
NOTE: these files were obtained from FreeBSD and fitted for NetBSD
by sigsegv@infoseek.jp.
 1.1 05-Mar-2003  tshiozak changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.3.56.1 30-Oct-2012  yamt sync with head
 1.1 05-Mar-2003  tshiozak changes related to lib/20576 and lib/20577.
- add wcstok() and wcswcs(),
- add wcstok(3),
- move btowc() and wctob() into each ctype modules,
- bump ctype interface ABI version,
- bump i18n modules' minor and
- update sets.
and fix a stupid bug in _RUNE_ISCACHED macro.
 1.2 16-Oct-2006  wiz nul/null/NULL cleanup:
when talking about characters/bytes, use "nul" and "nul-terminate"
when talking about pointers, use "null pointer" or ".Dv NULL"
 1.1 03-Jun-2006  tnozaki fix lib/33476:
added following manpages (derived from FreeBSD),
wcwidth(3) wcswidth(3)
wcstol(3) wcstoll(3) wcstoimax(3)
wcstoul(3) wcstoull(3) wcstoumax(3)
and update doc/TODO.i18n.
 1.6 02-Jan-2009  tnozaki Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.5 12-Aug-2008  tnozaki branches: 1.5.4; 1.5.6;
SUSv3 says, if not printable wide-character exists, return -1.
 1.4 12-Aug-2008  tnozaki SUSv3 says, wcwidth(wc) returns:
1) wc is nul wide-character, return 0.
2) wc is printable wide-character, return column width.
3) else, return -1.
but our implementation, case 3) returns 0. it's wrong!
 1.3 09-Feb-2005  kleink branches: 1.3.26;
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.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.3.26.1 18-Sep-2008  wrstuden Sync with wrstuden-revivesa-base-2.
 1.5.6.2 04-Jan-2009  christos merge with head.
 1.5.6.1 12-Aug-2008  christos file wcswidth.c was added on branch christos-time_t on 2009-01-04 17:02:20 +0000
 1.5.4.1 15-Jan-2009  snj Pull up following revision(s) (requested by tnozaki in ticket #222):
distrib/sets/lists/base/mi: revision 1.788
distrib/utils/libhack/Makefile.inc: revision 1.23
distrib/utils/libhack/Makefile: revision 1.22
etc/mtree/NetBSD.dist: revision 1.387
include/locale.h: revision 1.15
lib/libc/citrus/Makefile.inc: revision 1.6
lib/libc/citrus/citrus_aliasname_local.h: revision 1.1
lib/libc/citrus/citrus_bcs.h: revision 1.5
lib/libc/citrus/citrus_bcs_strtol.c: revision 1.1
lib/libc/citrus/citrus_bcs_strtoul.c: revision 1.1
lib/libc/citrus/citrus_csmapper.c: revision 1.9
lib/libc/citrus/citrus_fix_grouping.h: revision 1.1
lib/libc/citrus/citrus_lc_ctype.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.h: revision 1.1
lib/libc/citrus/citrus_lc_monetary.c: revision 1.1
lib/libc/citrus/citrus_lc_monetary.h: revision 1.1
lib/libc/citrus/citrus_lc_numeric.c: revision 1.1
lib/libc/citrus/citrus_lc_numeric.h: revision 1.1
lib/libc/citrus/citrus_lc_template.h: revision 1.1
lib/libc/citrus/citrus_lc_template_decl.h: revision 1.1
lib/libc/citrus/citrus_lc_time.c: revision 1.1
lib/libc/citrus/citrus_lc_time.h: revision 1.1
lib/libc/citrus/citrus_module.c: revision 1.8
lib/libc/citrus/citrus_namespace.h: revision 1.7
lib/libc/citrus/modules/citrus_euc.c: revision 1.13
lib/libc/gen/Makefile.inc: revision 1.166
lib/libc/gen/isctype.c: revision 1.17 via patch
lib/libc/gen/tolower_.c: revision 1.10
lib/libc/gen/toupper_.c: revision 1.10
lib/libc/iconv/Makefile.inc: revision 1.3
lib/libc/iconv/iconv.c: revision 1.7
lib/libc/locale/Makefile.inc: revision 1.53
lib/libc/locale/___runetype_mb.c: file removal
lib/libc/locale/_wctrans.c: revision 1.7
lib/libc/locale/_wctrans_local.h: revision 1.3
lib/libc/locale/_wctype.c: revision 1.1
lib/libc/locale/_wctype_local.h: revision 1.1
lib/libc/locale/aliasname.c: revision 1.3
lib/libc/locale/aliasname_local.h: revision 1.2
lib/libc/locale/bsdctype.c: revision 1.1
lib/libc/locale/bsdctype.h: revision 1.1
lib/libc/locale/ctypeio.c: revision 1.8
lib/libc/locale/ctypeio.h: revision 1.2
lib/libc/locale/current_locale.c: revision 1.1
lib/libc/locale/dummy_lc_collate.c: revision 1.1
lib/libc/locale/dummy_lc_template.h: revision 1.1
lib/libc/locale/fix_grouping.c: revision 1.1
lib/libc/locale/fix_grouping.h: revision 1.1
lib/libc/locale/generic_lc_all.c: revision 1.1
lib/libc/locale/generic_lc_template.h: revision 1.1
lib/libc/locale/generic_lc_template_decl.h: revision 1.1
lib/libc/locale/global_locale.c: revision 1.1
lib/libc/locale/iswctype.c: file removal
lib/libc/locale/iswctype_mb.c: revision 1.1
lib/libc/locale/iswctype_sb.c: revision 1.6
lib/libc/locale/lcmessages.c: file removal
lib/libc/locale/lcmessages.h: file removal
lib/libc/locale/lcmonetary.c: file removal
lib/libc/locale/lcmonetary.h: file removal
lib/libc/locale/lcnumeric.c: file removal
lib/libc/locale/lcnumeric.h: file removal
lib/libc/locale/lctime.c: file removal
lib/libc/locale/lctime.h: file removal
lib/libc/locale/localeconv.c: revision 1.15
lib/libc/locale/localeio.c: revision 1.2
lib/libc/locale/localeio.h: revision 1.2
lib/libc/locale/localeio_lc_ctype.c: revision 1.1
lib/libc/locale/localeio_lc_messages.c: revision 1.1
lib/libc/locale/localeio_lc_monetary.c: revision 1.1
lib/libc/locale/localeio_lc_numeric.c: revision 1.1
lib/libc/locale/localeio_lc_time.c: revision 1.1
lib/libc/locale/multibyte.h: revision 1.4
lib/libc/locale/multibyte_amd1.c: revision 1.6
lib/libc/locale/multibyte_c90.c: revision 1.5
lib/libc/locale/nb_lc_messages_misc.h: revision 1.1
lib/libc/locale/nb_lc_monetary_misc.h: revision 1.1
lib/libc/locale/nb_lc_numeric_misc.h: revision 1.1
lib/libc/locale/nb_lc_template.h: revision 1.1
lib/libc/locale/nb_lc_template_decl.h: revision 1.1
lib/libc/locale/nb_lc_time_misc.h: revision 1.1
lib/libc/locale/nl_langinfo.c: revision 1.12
lib/libc/locale/rune.c: revision 1.31
lib/libc/locale/rune.h: revision 1.13
lib/libc/locale/rune_local.h: revision 1.11
lib/libc/locale/runeglue.c: revision 1.14
lib/libc/locale/runetable.c: revision 1.18
lib/libc/locale/setlocale.c: revision 1.55 via patch
lib/libc/locale/setlocale_local.h: revision 1.1
lib/libc/locale/setrunelocale.c: file removal
lib/libc/nls/Makefile.inc: revision 1.9
lib/libc/nls/catopen.c: revision 1.26
lib/libc/string/Makefile.inc: revision 1.68
lib/libc/string/wcscmp.c: revision 1.6
lib/libc/string/wcsncmp.c: revision 1.6
lib/libc/string/wcswidth.c: file removal
lib/libc/string/wmemcmp.c: revision 1.4
regress/lib/libc/locale/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/en_US.UTF-8.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.exp.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.in.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.exp.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.in.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.SJIS.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.eucJP.exp.uue: revision 1.2
regress/lib/libc/locale/ctype2/Makefile: revision 1.5
regress/lib/libc/locale/ctype2/ja_JP.ISO-2022-JP-2.in.uue: revision 1.1
regress/lib/libc/locale/ctype2/ja_JP.ISO2022-JP2.in.uue: file removal
regress/lib/libc/locale/ctype3/Makefile: revision 1.5
regress/lib/libc/locale/mbtowc/Makefile: revision 1.3
regress/lib/libc/locale/mbtowc/ja_JP.ISO-2022-JP: revision 1.1
regress/lib/libc/locale/mbtowc/ja_JP.ISO2022-JP: file removal
regress/lib/libc/locale/wcstod/wcstod_test.c: revision 1.2
share/locale/Makefile.locale: revision 1.1
share/locale/Makefile: revision 1.5
share/locale/ctype/Makefile: revision 1.28
share/locale/locale.alias: revision 1.11
share/locale/messages/Makefile: revision 1.5
share/locale/messages/en_US.ISO8859-1.src: file removal
share/locale/messages/en_US.US-ASCII.src: revision 1.1
share/locale/messages/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/messages/ja_JP.ct.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-2.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-5.src: revision 1.1
share/locale/messages/sr_YU.ISO8859-2.src: file removal
share/locale/messages/sr_YU.ISO8859-5.src: file removal
share/locale/messages/sr_YU.UTF-8.src: file removal
share/locale/messages/zh_CN.GB18030.src: file removal
share/locale/messages/zh_TW.eucTW.src: revision 1.1
share/locale/monetary/Makefile: revision 1.5
share/locale/monetary/af_ZA.ISO8859-1.src: revision 1.2
share/locale/monetary/am_ET.UTF-8.src: revision 1.2
share/locale/monetary/be_BY.CP1131.src: file removal
share/locale/monetary/be_BY.CP1251.src: revision 1.2
share/locale/monetary/be_BY.ISO8859-5.src: revision 1.2
share/locale/monetary/be_BY.UTF-8.src: revision 1.2
share/locale/monetary/bg_BG.CP1251.src: revision 1.2
share/locale/monetary/bg_BG.UTF-8.src: revision 1.2
share/locale/monetary/ca_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/cs_CZ.ISO8859-2.src: revision 1.2
share/locale/monetary/cs_CZ.UTF-8.src: revision 1.2
share/locale/monetary/da_DK.ISO8859-1.src: revision 1.2
share/locale/monetary/de_AT.ISO8859-1.src: revision 1.2
share/locale/monetary/de_CH.ISO8859-1.src: revision 1.2
share/locale/monetary/de_DE.ISO8859-1.src: revision 1.2
share/locale/monetary/el_GR.ISO8859-7.src: revision 1.2
share/locale/monetary/en_AU.ISO8859-1.src: revision 1.2
share/locale/monetary/en_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.UTF-8.src: revision 1.2
share/locale/monetary/en_IE.UTF-8.src: revision 1.2
share/locale/monetary/en_NZ.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.US-ASCII.src: revision 1.1
share/locale/monetary/es_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/et_EE.ISO8859-15.src: revision 1.2
share/locale/monetary/fi_FI.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_FR.ISO8859-1.src: revision 1.2
share/locale/monetary/he_IL.UTF-8.src: revision 1.2
share/locale/monetary/hi_IN.ISCII-DEV.src: revision 1.2
share/locale/monetary/hr_HR.ISO8859-2.src: revision 1.2
share/locale/monetary/hu_HU.ISO8859-2.src: revision 1.2
share/locale/monetary/hy_AM.ARMSCII-8.src: revision 1.2
share/locale/monetary/hy_AM.UTF-8.src: revision 1.2
share/locale/monetary/is_IS.ISO8859-1.src: revision 1.2
share/locale/monetary/it_IT.ISO8859-1.src: revision 1.2
share/locale/monetary/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/monetary/ja_JP.UTF-8.src: revision 1.2
share/locale/monetary/ja_JP.eucJP.src: revision 1.2
share/locale/monetary/kk_KZ.PT154.src: revision 1.2
share/locale/monetary/kk_KZ.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.eucKR.src: revision 1.2
share/locale/monetary/lt_LT.ISO8859-13.src: revision 1.2
share/locale/monetary/mn_MN.UTF-8.src: revision 1.2
share/locale/monetary/nl_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/nl_NL.ISO8859-1.src: revision 1.2
share/locale/monetary/no_NO.ISO8859-1.src: revision 1.2
share/locale/monetary/pl_PL.ISO8859-2.src: revision 1.2
share/locale/monetary/pl_PL.UTF-8.src: revision 1.2
share/locale/monetary/pt_BR.ISO8859-1.src: revision 1.2
share/locale/monetary/pt_PT.ISO8859-1.src: revision 1.2
share/locale/monetary/ro_RO.ISO8859-2.src: revision 1.2
share/locale/monetary/ru_RU.CP1251.src: revision 1.2
share/locale/monetary/ru_RU.CP866.src: revision 1.2
share/locale/monetary/ru_RU.ISO8859-5.src: revision 1.2
share/locale/monetary/ru_RU.KOI8-R.src: revision 1.2
share/locale/monetary/ru_RU.UTF-8.src: revision 1.2
share/locale/monetary/sk_SK.ISO8859-2.src: revision 1.2
share/locale/monetary/sl_SI.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_ME.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_RS.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_YU.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_YU.ISO8859-5.src: revision 1.2
share/locale/monetary/sr_YU.UTF-8.src: revision 1.2
share/locale/monetary/sv_SE.ISO8859-1.src: revision 1.2
share/locale/monetary/tr_TR.ISO8859-9.src: revision 1.2
share/locale/monetary/uk_UA.CP1251.src: revision 1.2
share/locale/monetary/uk_UA.ISO8859-5.src: revision 1.2
share/locale/monetary/uk_UA.KOI8-U.src: revision 1.2
share/locale/monetary/uk_UA.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.GB18030.src: revision 1.2
share/locale/monetary/zh_CN.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.eucCN.src: revision 1.2
share/locale/monetary/zh_HK.Big5hkscs.src: revision 1.1
share/locale/monetary/zh_HK.UTF-8.src: revision 1.2
share/locale/monetary/zh_TW.Big5.src: revision 1.2
share/locale/numeric/Makefile: revision 1.4
share/locale/numeric/am_ET.UTF-8.src: file removal
share/locale/numeric/en_US.ISO8859-1.src: file removal
share/locale/numeric/en_US.US-ASCII.src: revision 1.1
share/locale/numeric/ja_JP.eucJP.src: file removal
share/locale/numeric/ko_KR.eucKR.src: file removal
share/locale/numeric/mn_MN.UTF-8.src: file removal
share/locale/numeric/sr_ME.ISO8859-2.src: revision 1.1
share/locale/numeric/sr_YU.ISO8859-2.src: file removal
share/locale/numeric/sr_YU.ISO8859-5.src: file removal
share/locale/numeric/zh_CN.eucCN.src: file removal
share/locale/time/Makefile: revision 1.5
share/locale/time/en_US.ISO8859-1.src: file removal
share/locale/time/en_US.US-ASCII.src: revision 1.1
share/locale/time/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/time/ja_JP.ct.src: revision 1.1
share/locale/time/sr_ME.ISO8859-2.src: revision 1.1
share/locale/time/sr_ME.ISO8859-5.src: revision 1.1
share/locale/time/sr_ME.UTF-8.src: revision 1.1
share/locale/time/sr_YU.ISO8859-2.src: file removal
share/locale/time/sr_YU.ISO8859-5.src: file removal
share/locale/time/sr_YU.UTF-8.src: file removal
share/locale/time/zh_CN.GB18030.src: file removal
share/locale/time/zh_TW.eucTW.src: revision 1.1
usr.bin/locale/locale.c: revision 1.6
usr.bin/mklocale/Makefile: revision 1.12
usr.bin/mklocale/lex.l: revision 1.14
usr.bin/mklocale/mklocaledb.c: revision 1.1
usr.bin/mklocale/yacc.y: revision 1.25
usr.sbin/chrtbl/Makefile: revision 1.8
usr.sbin/chrtbl/ctypeio.c: revision 1.1
usr.sbin/chrtbl/ctypeio.h: revision 1.1
Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES}
db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).
[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].
[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().
[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<
old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.19 01-Nov-2024  nia libc: Expose some newly-standard C functions in POSIX.1-2024 mode
 1.18 31-Jul-2023  christos branches: 1.18.2;
new gdb needs wmempcpy, give it to it.
 1.17 15-Oct-2016  kamil Import wcsnlen(3) to libc

The wcsnlen(3) function conforms to POSIX.1-2008 and is an addition to the
ISO C standard.

size_t wcsnlen(const wchar_t *s, size_t maxlen);

The wcsnlen(3) function computes the number of wide-characters in a wide-
-string to which s points, not including NULL terminating wide-character
code and checking no more than maxlen wide-characters. This function never
examines wide-characters beyond a wide-string of maxlen size.


This function is a safer version of wcslen(3):

size_t wcslen(const wchar_t *s);


Update STANDARDS section of wmemchr(3) describing wide-character functions.
 1.16 14-Jul-2016  abhinav branches: 1.16.2;
Add comma to separate the Nm entries.
 1.15 16-Dec-2010  wiz Observe the following spelling:
- wide character (noun)
- wide-character (adjective)

Inspired by jmc@OpenBSD.
 1.14 02-May-2009  wiz Remove duplicate entry.
 1.13 01-May-2009  perry Add versions of stpcpy(3), stpncpy(3), strnlen(3), all from FreeBSD.
These are defined in the latest POSIX

Also make related updates to documentation, mostly from FreeBSD,
though I cleaned a few other things up along the way.

Bump shlib_version.

We are still missing strcoll_l, strerror_l, strsignal, strxfrm_l to be
POSIX conformant.
 1.12 14-Oct-2006  wiz branches: 1.12.28;
New sentence, new line.
 1.11 13-Oct-2006  tnozaki PR/30809 added manpages of wcswcs(3) and wcscoll(3), wcsxfrm(3)
(wcs?width and wprintf are already in repository).
 1.10 24-Jan-2004  wiz Lots of grammar and wording changes from jmc@openbsd, with some
additional consistency changes by me.
 1.9 08-Sep-2003  wiz Use St -isoC-9X instead of St -isoC9X, to be in sync with groff.
 1.8 07-Aug-2003  agc Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22280, verified by myself.
 1.7 16-Apr-2003  wiz Use
.In header.h
instead of
.Fd #include \*[Lt]header.h\*[Gt]
Much easier to read and write, and supported by groff for ages.
Okayed by ross.
 1.6 07-Feb-2002  ross Generate <>& symbolically.
 1.5 02-Jan-2001  itojun branches: 1.5.2;
wording (correct?)
 1.4 02-Jan-2001  itojun comma at EOL -> period
 1.3 02-Jan-2001  kleink Fix grammar nits, and update the STANDARDS section.
 1.2 29-Dec-2000  kleink Sprinkle some __restrict into <wchar.h>.
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.5.2.2 22-Mar-2002  nathanw Catch up to -current.
 1.5.2.1 08-Mar-2002  nathanw Catch up to -current.
 1.12.28.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.16.2.1 04-Nov-2016  pgoyette Sync with HEAD
 1.18.2.1 02-Aug-2025  perseant Sync with HEAD
 1.4 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.3 29-Nov-2005  christos branches: 1.3.44;
WARNS=4
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.3.44.1 30-Oct-2012  yamt sync with head
 1.7 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.6 11-Jan-2009  christos branches: 1.6.8;
merge christos-time_t
 1.5 05-Jan-2009  tnozaki 1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.

2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.

3. fix build breakage when CITRUS=no was set.
 1.4 02-Jan-2009  tnozaki Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES} db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).

[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].

[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().

[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<

old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.3 06-Apr-2003  tshiozak branches: 1.3.38; 1.3.40;
- support for the additional code area of zh_CN.GB18030 locale,
- make sure that __nbrune_t is unsigned 32bit clean and
- fix wrong copyright notice in the last commit.
this patch is contributed by Takehiko NOZAKI <sigsegv at s25 dot xrea dot com>.
 1.2 03-Jan-2001  lukem sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.3.40.2 10-Jan-2009  christos sync with head.
 1.3.40.1 04-Jan-2009  christos merge with head.
 1.3.38.2 15-Jan-2009  snj Pull up following revision(s) (requested by jmcneill in ticket #270):
lib/libc/locale/fix_grouping.c: revision 1.3
lib/libc/locale/iswctype_sb.c: revision 1.7
lib/libc/locale/rune.h: revision 1.14
lib/libc/locale/runetype.h: file removal
lib/libc/locale/runetype_local.h: revision 1.1
lib/libc/stdio/fparseln.c: revision 1.8
lib/libc/string/wcscmp.c: revision 1.7
lib/libc/string/wcsncmp.c: revision 1.7
lib/libc/string/wmemcmp.c: revision 1.5
tools/compat/configure: regen
tools/compat/configure.ac: revision 1.68
tools/compat/nbtool_config.h.in: regen
usr.bin/mklocale/Makefile: revision 1.15
usr.bin/mklocale/lex.l: revision 1.16
usr.bin/mklocale/yacc.y: revision 1.27
1. reworking PR lib/40317:
libnbcompat already contains empty fparseln.lo
so previous fix doesn't work correctly.
i've just added broken fparseln check to configure script.
2. reworking cross build breakage under FreeBSD/MacOS X.
FreeBSD/MacOS X still have public /usr/include/runetype.h
derived from 4.4BSD-Lite. so i renamed out private header from
src/lib/libc/locale/runetype.h to src/lib/libc/locale/runetype_local.h
to solve this problems.
3. fix build breakage when CITRUS=no was set.
 1.3.38.1 15-Jan-2009  snj Pull up following revision(s) (requested by tnozaki in ticket #222):
distrib/sets/lists/base/mi: revision 1.788
distrib/utils/libhack/Makefile.inc: revision 1.23
distrib/utils/libhack/Makefile: revision 1.22
etc/mtree/NetBSD.dist: revision 1.387
include/locale.h: revision 1.15
lib/libc/citrus/Makefile.inc: revision 1.6
lib/libc/citrus/citrus_aliasname_local.h: revision 1.1
lib/libc/citrus/citrus_bcs.h: revision 1.5
lib/libc/citrus/citrus_bcs_strtol.c: revision 1.1
lib/libc/citrus/citrus_bcs_strtoul.c: revision 1.1
lib/libc/citrus/citrus_csmapper.c: revision 1.9
lib/libc/citrus/citrus_fix_grouping.h: revision 1.1
lib/libc/citrus/citrus_lc_ctype.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.c: revision 1.1
lib/libc/citrus/citrus_lc_messages.h: revision 1.1
lib/libc/citrus/citrus_lc_monetary.c: revision 1.1
lib/libc/citrus/citrus_lc_monetary.h: revision 1.1
lib/libc/citrus/citrus_lc_numeric.c: revision 1.1
lib/libc/citrus/citrus_lc_numeric.h: revision 1.1
lib/libc/citrus/citrus_lc_template.h: revision 1.1
lib/libc/citrus/citrus_lc_template_decl.h: revision 1.1
lib/libc/citrus/citrus_lc_time.c: revision 1.1
lib/libc/citrus/citrus_lc_time.h: revision 1.1
lib/libc/citrus/citrus_module.c: revision 1.8
lib/libc/citrus/citrus_namespace.h: revision 1.7
lib/libc/citrus/modules/citrus_euc.c: revision 1.13
lib/libc/gen/Makefile.inc: revision 1.166
lib/libc/gen/isctype.c: revision 1.17 via patch
lib/libc/gen/tolower_.c: revision 1.10
lib/libc/gen/toupper_.c: revision 1.10
lib/libc/iconv/Makefile.inc: revision 1.3
lib/libc/iconv/iconv.c: revision 1.7
lib/libc/locale/Makefile.inc: revision 1.53
lib/libc/locale/___runetype_mb.c: file removal
lib/libc/locale/_wctrans.c: revision 1.7
lib/libc/locale/_wctrans_local.h: revision 1.3
lib/libc/locale/_wctype.c: revision 1.1
lib/libc/locale/_wctype_local.h: revision 1.1
lib/libc/locale/aliasname.c: revision 1.3
lib/libc/locale/aliasname_local.h: revision 1.2
lib/libc/locale/bsdctype.c: revision 1.1
lib/libc/locale/bsdctype.h: revision 1.1
lib/libc/locale/ctypeio.c: revision 1.8
lib/libc/locale/ctypeio.h: revision 1.2
lib/libc/locale/current_locale.c: revision 1.1
lib/libc/locale/dummy_lc_collate.c: revision 1.1
lib/libc/locale/dummy_lc_template.h: revision 1.1
lib/libc/locale/fix_grouping.c: revision 1.1
lib/libc/locale/fix_grouping.h: revision 1.1
lib/libc/locale/generic_lc_all.c: revision 1.1
lib/libc/locale/generic_lc_template.h: revision 1.1
lib/libc/locale/generic_lc_template_decl.h: revision 1.1
lib/libc/locale/global_locale.c: revision 1.1
lib/libc/locale/iswctype.c: file removal
lib/libc/locale/iswctype_mb.c: revision 1.1
lib/libc/locale/iswctype_sb.c: revision 1.6
lib/libc/locale/lcmessages.c: file removal
lib/libc/locale/lcmessages.h: file removal
lib/libc/locale/lcmonetary.c: file removal
lib/libc/locale/lcmonetary.h: file removal
lib/libc/locale/lcnumeric.c: file removal
lib/libc/locale/lcnumeric.h: file removal
lib/libc/locale/lctime.c: file removal
lib/libc/locale/lctime.h: file removal
lib/libc/locale/localeconv.c: revision 1.15
lib/libc/locale/localeio.c: revision 1.2
lib/libc/locale/localeio.h: revision 1.2
lib/libc/locale/localeio_lc_ctype.c: revision 1.1
lib/libc/locale/localeio_lc_messages.c: revision 1.1
lib/libc/locale/localeio_lc_monetary.c: revision 1.1
lib/libc/locale/localeio_lc_numeric.c: revision 1.1
lib/libc/locale/localeio_lc_time.c: revision 1.1
lib/libc/locale/multibyte.h: revision 1.4
lib/libc/locale/multibyte_amd1.c: revision 1.6
lib/libc/locale/multibyte_c90.c: revision 1.5
lib/libc/locale/nb_lc_messages_misc.h: revision 1.1
lib/libc/locale/nb_lc_monetary_misc.h: revision 1.1
lib/libc/locale/nb_lc_numeric_misc.h: revision 1.1
lib/libc/locale/nb_lc_template.h: revision 1.1
lib/libc/locale/nb_lc_template_decl.h: revision 1.1
lib/libc/locale/nb_lc_time_misc.h: revision 1.1
lib/libc/locale/nl_langinfo.c: revision 1.12
lib/libc/locale/rune.c: revision 1.31
lib/libc/locale/rune.h: revision 1.13
lib/libc/locale/rune_local.h: revision 1.11
lib/libc/locale/runeglue.c: revision 1.14
lib/libc/locale/runetable.c: revision 1.18
lib/libc/locale/setlocale.c: revision 1.55 via patch
lib/libc/locale/setlocale_local.h: revision 1.1
lib/libc/locale/setrunelocale.c: file removal
lib/libc/nls/Makefile.inc: revision 1.9
lib/libc/nls/catopen.c: revision 1.26
lib/libc/string/Makefile.inc: revision 1.68
lib/libc/string/wcscmp.c: revision 1.6
lib/libc/string/wcsncmp.c: revision 1.6
lib/libc/string/wcswidth.c: file removal
lib/libc/string/wmemcmp.c: revision 1.4
regress/lib/libc/locale/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/Makefile: revision 1.4
regress/lib/libc/locale/ctype1/en_US.UTF-8.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.exp.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO-2022-JP.in.uue: revision 1.1
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.exp.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.ISO2022-JP.in.uue: file removal
regress/lib/libc/locale/ctype1/ja_JP.SJIS.exp.uue: revision 1.2
regress/lib/libc/locale/ctype1/ja_JP.eucJP.exp.uue: revision 1.2
regress/lib/libc/locale/ctype2/Makefile: revision 1.5
regress/lib/libc/locale/ctype2/ja_JP.ISO-2022-JP-2.in.uue: revision 1.1
regress/lib/libc/locale/ctype2/ja_JP.ISO2022-JP2.in.uue: file removal
regress/lib/libc/locale/ctype3/Makefile: revision 1.5
regress/lib/libc/locale/mbtowc/Makefile: revision 1.3
regress/lib/libc/locale/mbtowc/ja_JP.ISO-2022-JP: revision 1.1
regress/lib/libc/locale/mbtowc/ja_JP.ISO2022-JP: file removal
regress/lib/libc/locale/wcstod/wcstod_test.c: revision 1.2
share/locale/Makefile.locale: revision 1.1
share/locale/Makefile: revision 1.5
share/locale/ctype/Makefile: revision 1.28
share/locale/locale.alias: revision 1.11
share/locale/messages/Makefile: revision 1.5
share/locale/messages/en_US.ISO8859-1.src: file removal
share/locale/messages/en_US.US-ASCII.src: revision 1.1
share/locale/messages/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/messages/ja_JP.ct.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-2.src: revision 1.1
share/locale/messages/sr_ME.ISO8859-5.src: revision 1.1
share/locale/messages/sr_YU.ISO8859-2.src: file removal
share/locale/messages/sr_YU.ISO8859-5.src: file removal
share/locale/messages/sr_YU.UTF-8.src: file removal
share/locale/messages/zh_CN.GB18030.src: file removal
share/locale/messages/zh_TW.eucTW.src: revision 1.1
share/locale/monetary/Makefile: revision 1.5
share/locale/monetary/af_ZA.ISO8859-1.src: revision 1.2
share/locale/monetary/am_ET.UTF-8.src: revision 1.2
share/locale/monetary/be_BY.CP1131.src: file removal
share/locale/monetary/be_BY.CP1251.src: revision 1.2
share/locale/monetary/be_BY.ISO8859-5.src: revision 1.2
share/locale/monetary/be_BY.UTF-8.src: revision 1.2
share/locale/monetary/bg_BG.CP1251.src: revision 1.2
share/locale/monetary/bg_BG.UTF-8.src: revision 1.2
share/locale/monetary/ca_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/cs_CZ.ISO8859-2.src: revision 1.2
share/locale/monetary/cs_CZ.UTF-8.src: revision 1.2
share/locale/monetary/da_DK.ISO8859-1.src: revision 1.2
share/locale/monetary/de_AT.ISO8859-1.src: revision 1.2
share/locale/monetary/de_CH.ISO8859-1.src: revision 1.2
share/locale/monetary/de_DE.ISO8859-1.src: revision 1.2
share/locale/monetary/el_GR.ISO8859-7.src: revision 1.2
share/locale/monetary/en_AU.ISO8859-1.src: revision 1.2
share/locale/monetary/en_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.ISO8859-1.src: revision 1.2
share/locale/monetary/en_GB.UTF-8.src: revision 1.2
share/locale/monetary/en_IE.UTF-8.src: revision 1.2
share/locale/monetary/en_NZ.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.ISO8859-1.src: revision 1.2
share/locale/monetary/en_US.US-ASCII.src: revision 1.1
share/locale/monetary/es_ES.ISO8859-1.src: revision 1.2
share/locale/monetary/et_EE.ISO8859-15.src: revision 1.2
share/locale/monetary/fi_FI.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_CA.ISO8859-1.src: revision 1.2
share/locale/monetary/fr_FR.ISO8859-1.src: revision 1.2
share/locale/monetary/he_IL.UTF-8.src: revision 1.2
share/locale/monetary/hi_IN.ISCII-DEV.src: revision 1.2
share/locale/monetary/hr_HR.ISO8859-2.src: revision 1.2
share/locale/monetary/hu_HU.ISO8859-2.src: revision 1.2
share/locale/monetary/hy_AM.ARMSCII-8.src: revision 1.2
share/locale/monetary/hy_AM.UTF-8.src: revision 1.2
share/locale/monetary/is_IS.ISO8859-1.src: revision 1.2
share/locale/monetary/it_IT.ISO8859-1.src: revision 1.2
share/locale/monetary/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/monetary/ja_JP.UTF-8.src: revision 1.2
share/locale/monetary/ja_JP.eucJP.src: revision 1.2
share/locale/monetary/kk_KZ.PT154.src: revision 1.2
share/locale/monetary/kk_KZ.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.UTF-8.src: revision 1.2
share/locale/monetary/ko_KR.eucKR.src: revision 1.2
share/locale/monetary/lt_LT.ISO8859-13.src: revision 1.2
share/locale/monetary/mn_MN.UTF-8.src: revision 1.2
share/locale/monetary/nl_BE.ISO8859-1.src: revision 1.2
share/locale/monetary/nl_NL.ISO8859-1.src: revision 1.2
share/locale/monetary/no_NO.ISO8859-1.src: revision 1.2
share/locale/monetary/pl_PL.ISO8859-2.src: revision 1.2
share/locale/monetary/pl_PL.UTF-8.src: revision 1.2
share/locale/monetary/pt_BR.ISO8859-1.src: revision 1.2
share/locale/monetary/pt_PT.ISO8859-1.src: revision 1.2
share/locale/monetary/ro_RO.ISO8859-2.src: revision 1.2
share/locale/monetary/ru_RU.CP1251.src: revision 1.2
share/locale/monetary/ru_RU.CP866.src: revision 1.2
share/locale/monetary/ru_RU.ISO8859-5.src: revision 1.2
share/locale/monetary/ru_RU.KOI8-R.src: revision 1.2
share/locale/monetary/ru_RU.UTF-8.src: revision 1.2
share/locale/monetary/sk_SK.ISO8859-2.src: revision 1.2
share/locale/monetary/sl_SI.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_ME.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_RS.ISO8859-2.src: revision 1.1
share/locale/monetary/sr_YU.ISO8859-2.src: revision 1.2
share/locale/monetary/sr_YU.ISO8859-5.src: revision 1.2
share/locale/monetary/sr_YU.UTF-8.src: revision 1.2
share/locale/monetary/sv_SE.ISO8859-1.src: revision 1.2
share/locale/monetary/tr_TR.ISO8859-9.src: revision 1.2
share/locale/monetary/uk_UA.CP1251.src: revision 1.2
share/locale/monetary/uk_UA.ISO8859-5.src: revision 1.2
share/locale/monetary/uk_UA.KOI8-U.src: revision 1.2
share/locale/monetary/uk_UA.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.GB18030.src: revision 1.2
share/locale/monetary/zh_CN.UTF-8.src: revision 1.2
share/locale/monetary/zh_CN.eucCN.src: revision 1.2
share/locale/monetary/zh_HK.Big5hkscs.src: revision 1.1
share/locale/monetary/zh_HK.UTF-8.src: revision 1.2
share/locale/monetary/zh_TW.Big5.src: revision 1.2
share/locale/numeric/Makefile: revision 1.4
share/locale/numeric/am_ET.UTF-8.src: file removal
share/locale/numeric/en_US.ISO8859-1.src: file removal
share/locale/numeric/en_US.US-ASCII.src: revision 1.1
share/locale/numeric/ja_JP.eucJP.src: file removal
share/locale/numeric/ko_KR.eucKR.src: file removal
share/locale/numeric/mn_MN.UTF-8.src: file removal
share/locale/numeric/sr_ME.ISO8859-2.src: revision 1.1
share/locale/numeric/sr_YU.ISO8859-2.src: file removal
share/locale/numeric/sr_YU.ISO8859-5.src: file removal
share/locale/numeric/zh_CN.eucCN.src: file removal
share/locale/time/Makefile: revision 1.5
share/locale/time/en_US.ISO8859-1.src: file removal
share/locale/time/en_US.US-ASCII.src: revision 1.1
share/locale/time/ja_JP.ISO-2022-JP.src: revision 1.1
share/locale/time/ja_JP.ct.src: revision 1.1
share/locale/time/sr_ME.ISO8859-2.src: revision 1.1
share/locale/time/sr_ME.ISO8859-5.src: revision 1.1
share/locale/time/sr_ME.UTF-8.src: revision 1.1
share/locale/time/sr_YU.ISO8859-2.src: file removal
share/locale/time/sr_YU.ISO8859-5.src: file removal
share/locale/time/sr_YU.UTF-8.src: file removal
share/locale/time/zh_CN.GB18030.src: file removal
share/locale/time/zh_TW.eucTW.src: revision 1.1
usr.bin/locale/locale.c: revision 1.6
usr.bin/mklocale/Makefile: revision 1.12
usr.bin/mklocale/lex.l: revision 1.14
usr.bin/mklocale/mklocaledb.c: revision 1.1
usr.bin/mklocale/yacc.y: revision 1.25
usr.sbin/chrtbl/Makefile: revision 1.8
usr.sbin/chrtbl/ctypeio.c: revision 1.1
usr.sbin/chrtbl/ctypeio.h: revision 1.1
Fixes PR lib/39662, shortcomings in LC_{MONETARY,NUMERIC,TIME,MESSAGES}
db format.
ok'ed by core and releng.
(thanks for agc@, snj@ and i'm sorry for long time patience).
[libc]
- localeio.[ch] and lc*.[ch] in src/lib/libc/locale was replaced by
new locale-db implementation using citrus_db backend,
see src/lib/libc/citrus/citrus_lc_*.[ch].
- add citrus_bcs_strtou?l.c. don't use strtou?l locale implementation
internally, because they're locale-aware function.
- add some stubs for multi-locale issue, see {current,global}_locale.c.
- remove some obsolete file, setrunelocale.c, ___runetype_mb.c.
- remove __savectype() from ctypeio.[ch].
[tools]
- mklocale(1): add new option ``-t'' that generates new style
LC_{MONETARY,NUMERIC,TIME,MESSAGES} locale-db format.
- chrtbl(1): added ctypeio.[ch] for __savectype().
[locale-db]
- added en_US.US-ASCII locale.
- removed some shareable locale definition file:
en_US.US-ASCII -> en_US.ISO8859-1, en_US.UTF-8
zh_CN.eucCN -> zh_CN.GB18030
and more...see src/share/locale/*/Makefile.
- remove obsoleted locale sr_YU, added new locale sr_ME, sr_RS.
- change locale name ja_JP.ISO2022-JP* -> ja_JP.ISO-2022-JP*
for X11's locale.alias file alignments.
- fix regression test, wrong wcs?width(3), NAN/INF usage.

i tested release-build following arch:
i386, amd64, hpc{mips,arm,sh}, sparc64, vax.

citrus_lc_*.[ch] also can read old-plain-text style locale-db.
so that backward compatibility is keeped, but lc*.[ch] can't read
new citrus_db'ed locale-db and localeio.c never check sanity,
so forward compatibility is broken ;-<
old mklocale(1) doesn't know -t option, so you have to rebuild toolchain.
 1.6.8.1 30-Oct-2012  yamt sync with head
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head
 1.1 31-Jul-2023  christos new gdb needs wmempcpy, give it to it.
 1.3 25-Jun-2012  abs Update old-style definitions to ANSI, remove a couple of register
definitions along the way. Fixed gcc 4.1 build (thank you vax)
 1.2 03-Jan-2001  lukem branches: 1.2.60;
sprinkle in _DIAGASSERT() as appropriate
 1.1 23-Dec-2000  itojun move wcs* and wmem* from lib/libc/locale to lib/libc/string.
 1.2.60.1 30-Oct-2012  yamt sync with head

RSS XML Feed