History log of /netbsd-current/include/string.h
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
# 1.54 01-Aug-2023 christos

Add companion mempcpy to wmempcpy, bump.


Revision tags: netbsd-10-base
# 1.53 09-Aug-2021 andvar

fix various typos in compatibility, mainly in comments.


Revision tags: netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.52 20-Feb-2018 kamil

Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.51 12-Oct-2016 christos

branches: 1.51.6;
add strchrnull


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.50 10-Mar-2016 leot

branches: 1.50.2;
strndup() is part of XSI from The Open Group Base Specification Issue 7 and had
a similar history of stpcpy(), stpncpy() and strnlen().
Make it visible under XOPEN_SOURCE>=700 too (not just _NETBSD_SOURCE).

ok dholland@


# 1.49 24-Sep-2014 christos

add strnstr from FreeBSD


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.48 28-Aug-2013 riastradh

Publish explicit_memset and consttime_memequal in userland libc.

Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)


# 1.47 28-Aug-2013 riastradh

Make explicit_memset match memset's return value.


# 1.46 27-Aug-2013 joerg

Remove outdated comment.


# 1.45 19-Aug-2013 joerg

Add strerror_l.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.44 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.43 21-Apr-2013 joerg

__BEGIN_DECLS/__END_DECLS


# 1.42 19-Apr-2013 joerg

Add dummy strcoll_l and strxfrm_l.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.41 30-Aug-2012 drochner

branches: 1.41.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.


Revision tags: yamt-pagecache-base5
# 1.40 20-Apr-2012 joerg

Do not wrap other header files with extern "C".


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211
# 1.39 22-Jul-2009 kleink

branches: 1.39.8;
Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.38 01-May-2009 perry

note that we have strsignal but it is in the wrong include file.


# 1.37 01-May-2009 perry

Add prototypes for stpcpy, stpncpy, strnlen, added in the latest POSIX.

Implementations in libc to follow.

For POSIX compliance, we are still missing:

strcoll_l
strerror_l
strsignal
strxfrm_l


# 1.36 10-Apr-2009 christos

add memrchr


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.35 19-Oct-2007 christos

branches: 1.35.18;
kill _NETBSD_TOOLS.


# 1.34 18-Oct-2007 christos

Introduce _NETBSD_TOOLS for symbols the are needed in tools build


Revision tags: matt-mips64-base
# 1.33 02-Aug-2007 kristerw

branches: 1.33.2; 1.33.4;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.32 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


Revision tags: netbsd-4-base
# 1.31 12-Aug-2006 christos

branches: 1.31.2; 1.31.4;
Add stresep and strndup.


Revision tags: abandoned-netbsd-4-base
# 1.30 28-Jul-2005 christos

branches: 1.30.2;
Add strerror_r.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.29 13-Mar-2005 perry

Add prototype for memmem(3). It is API compatible with the version in Linux.


# 1.28 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.27 12-Jul-2004 kleink

Move the strcasestr() prototype to the local extensions section.
Also __P() it; this should be consistent within a single header.


# 1.26 03-Jul-2004 junyoung

Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.


Revision tags: netbsd-2-0-base
# 1.25 07-Aug-2003 agc

branches: 1.25.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.24 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.23 22-Mar-2001 kleink

Sprinkle some restrict qualifiers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.22 10-Jan-2000 kleink

branches: 1.22.6;
Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.21 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 09-Sep-1999 kleink

strlcat() and strlcpy() aren't ISO/IEC 9899:1990.


# 1.19 08-Sep-1999 lukem

prototypes for strlcat() and strlcpy()


Revision tags: netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.18 27-Jul-1998 mycroft

branches: 1.18.2;
Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software. *sigh*


# 1.17 26-Jul-1998 mycroft

KNF nit.


# 1.16 26-Jul-1998 mycroft

const poisoning.


# 1.15 06-May-1998 kleink

Make strtok_r() available to _XOPEN_SOURCE >= 500, and fix the protection of
memccpy() and strdup().


# 1.14 27-Apr-1998 tv

Move the #include <strings.h> line inside a !defined(_XOPEN_SOURCE) block
(not just !POSIX and !ANSI)


# 1.13 03-Feb-1998 perry

restore include of sys/featuretest.h


# 1.12 02-Feb-1998 perry

remove sys/featuretest.h -- why did kleink add it?


# 1.11 02-Feb-1998 perry

merge lite-2


# 1.10 02-Feb-1998 kleink

Per XPG4.2, move the prototypes of bcmp(), bcopy(), bzero(), ffs(), index(),
rindex(), strcasecmp() and strncasecmp() to <strings.h>. For now, include
<strings.h> to get these prototypes; this should go away eventually.
Also, protect the prototypes of strtok_r() and strsep().


# 1.9 12-Jan-1998 kleink

Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 16-Oct-1997 christos

move setmode and strsignal to unistd.h


# 1.7 13-Jul-1997 christos

Add missing strtok_r prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.5 02-Aug-1994 jtc

branches: 1.5.2;
Added prototype for new function strsignal()


Revision tags: netbsd-1-0-base
# 1.4 21-May-1994 cgd

add _BSD's to ansi types


# 1.3 11-Oct-1993 jtc

Changed preprocessor conditional so non-standard functions would not be
declared in a _POSIX_SOURCE environment.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


# 1.53 09-Aug-2021 andvar

fix various typos in compatibility, mainly in comments.


Revision tags: cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.52 20-Feb-2018 kamil

Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.51 12-Oct-2016 christos

branches: 1.51.6;
add strchrnull


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.50 10-Mar-2016 leot

branches: 1.50.2;
strndup() is part of XSI from The Open Group Base Specification Issue 7 and had
a similar history of stpcpy(), stpncpy() and strnlen().
Make it visible under XOPEN_SOURCE>=700 too (not just _NETBSD_SOURCE).

ok dholland@


# 1.49 24-Sep-2014 christos

add strnstr from FreeBSD


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.48 28-Aug-2013 riastradh

Publish explicit_memset and consttime_memequal in userland libc.

Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)


# 1.47 28-Aug-2013 riastradh

Make explicit_memset match memset's return value.


# 1.46 27-Aug-2013 joerg

Remove outdated comment.


# 1.45 19-Aug-2013 joerg

Add strerror_l.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.44 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.43 21-Apr-2013 joerg

__BEGIN_DECLS/__END_DECLS


# 1.42 19-Apr-2013 joerg

Add dummy strcoll_l and strxfrm_l.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.41 30-Aug-2012 drochner

branches: 1.41.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.


Revision tags: yamt-pagecache-base5
# 1.40 20-Apr-2012 joerg

Do not wrap other header files with extern "C".


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211
# 1.39 22-Jul-2009 kleink

branches: 1.39.8;
Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.38 01-May-2009 perry

note that we have strsignal but it is in the wrong include file.


# 1.37 01-May-2009 perry

Add prototypes for stpcpy, stpncpy, strnlen, added in the latest POSIX.

Implementations in libc to follow.

For POSIX compliance, we are still missing:

strcoll_l
strerror_l
strsignal
strxfrm_l


# 1.36 10-Apr-2009 christos

add memrchr


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.35 19-Oct-2007 christos

branches: 1.35.18;
kill _NETBSD_TOOLS.


# 1.34 18-Oct-2007 christos

Introduce _NETBSD_TOOLS for symbols the are needed in tools build


Revision tags: matt-mips64-base
# 1.33 02-Aug-2007 kristerw

branches: 1.33.2; 1.33.4;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.32 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


Revision tags: netbsd-4-base
# 1.31 12-Aug-2006 christos

branches: 1.31.2; 1.31.4;
Add stresep and strndup.


Revision tags: abandoned-netbsd-4-base
# 1.30 28-Jul-2005 christos

branches: 1.30.2;
Add strerror_r.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.29 13-Mar-2005 perry

Add prototype for memmem(3). It is API compatible with the version in Linux.


# 1.28 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.27 12-Jul-2004 kleink

Move the strcasestr() prototype to the local extensions section.
Also __P() it; this should be consistent within a single header.


# 1.26 03-Jul-2004 junyoung

Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.


Revision tags: netbsd-2-0-base
# 1.25 07-Aug-2003 agc

branches: 1.25.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.24 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.23 22-Mar-2001 kleink

Sprinkle some restrict qualifiers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.22 10-Jan-2000 kleink

branches: 1.22.6;
Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.21 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 09-Sep-1999 kleink

strlcat() and strlcpy() aren't ISO/IEC 9899:1990.


# 1.19 08-Sep-1999 lukem

prototypes for strlcat() and strlcpy()


Revision tags: netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.18 27-Jul-1998 mycroft

branches: 1.18.2;
Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software. *sigh*


# 1.17 26-Jul-1998 mycroft

KNF nit.


# 1.16 26-Jul-1998 mycroft

const poisoning.


# 1.15 06-May-1998 kleink

Make strtok_r() available to _XOPEN_SOURCE >= 500, and fix the protection of
memccpy() and strdup().


# 1.14 27-Apr-1998 tv

Move the #include <strings.h> line inside a !defined(_XOPEN_SOURCE) block
(not just !POSIX and !ANSI)


# 1.13 03-Feb-1998 perry

restore include of sys/featuretest.h


# 1.12 02-Feb-1998 perry

remove sys/featuretest.h -- why did kleink add it?


# 1.11 02-Feb-1998 perry

merge lite-2


# 1.10 02-Feb-1998 kleink

Per XPG4.2, move the prototypes of bcmp(), bcopy(), bzero(), ffs(), index(),
rindex(), strcasecmp() and strncasecmp() to <strings.h>. For now, include
<strings.h> to get these prototypes; this should go away eventually.
Also, protect the prototypes of strtok_r() and strsep().


# 1.9 12-Jan-1998 kleink

Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 16-Oct-1997 christos

move setmode and strsignal to unistd.h


# 1.7 13-Jul-1997 christos

Add missing strtok_r prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.5 02-Aug-1994 jtc

branches: 1.5.2;
Added prototype for new function strsignal()


Revision tags: netbsd-1-0-base
# 1.4 21-May-1994 cgd

add _BSD's to ansi types


# 1.3 11-Oct-1993 jtc

Changed preprocessor conditional so non-standard functions would not be
declared in a _POSIX_SOURCE environment.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.52 20-Feb-2018 kamil

Mark in string.h: memccpy(3) and strdup(3) as _POSIX_C_SOURCE >= 2001


Revision tags: matt-nb8-mediatek-base perseant-stdc-iso10646-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107 pgoyette-localcount-20161104
# 1.51 12-Oct-2016 christos

branches: 1.51.6;
add strchrnull


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.50 10-Mar-2016 leot

branches: 1.50.2;
strndup() is part of XSI from The Open Group Base Specification Issue 7 and had
a similar history of stpcpy(), stpncpy() and strnlen().
Make it visible under XOPEN_SOURCE>=700 too (not just _NETBSD_SOURCE).

ok dholland@


# 1.49 24-Sep-2014 christos

add strnstr from FreeBSD


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.48 28-Aug-2013 riastradh

Publish explicit_memset and consttime_memequal in userland libc.

Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)


# 1.47 28-Aug-2013 riastradh

Make explicit_memset match memset's return value.


# 1.46 27-Aug-2013 joerg

Remove outdated comment.


# 1.45 19-Aug-2013 joerg

Add strerror_l.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.44 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.43 21-Apr-2013 joerg

__BEGIN_DECLS/__END_DECLS


# 1.42 19-Apr-2013 joerg

Add dummy strcoll_l and strxfrm_l.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.41 30-Aug-2012 drochner

branches: 1.41.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.


Revision tags: yamt-pagecache-base5
# 1.40 20-Apr-2012 joerg

Do not wrap other header files with extern "C".


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211
# 1.39 22-Jul-2009 kleink

branches: 1.39.8;
Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.38 01-May-2009 perry

note that we have strsignal but it is in the wrong include file.


# 1.37 01-May-2009 perry

Add prototypes for stpcpy, stpncpy, strnlen, added in the latest POSIX.

Implementations in libc to follow.

For POSIX compliance, we are still missing:

strcoll_l
strerror_l
strsignal
strxfrm_l


# 1.36 10-Apr-2009 christos

add memrchr


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.35 19-Oct-2007 christos

branches: 1.35.18;
kill _NETBSD_TOOLS.


# 1.34 18-Oct-2007 christos

Introduce _NETBSD_TOOLS for symbols the are needed in tools build


Revision tags: matt-mips64-base
# 1.33 02-Aug-2007 kristerw

branches: 1.33.2; 1.33.4;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.32 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


Revision tags: netbsd-4-base
# 1.31 12-Aug-2006 christos

branches: 1.31.2; 1.31.4;
Add stresep and strndup.


Revision tags: abandoned-netbsd-4-base
# 1.30 28-Jul-2005 christos

branches: 1.30.2;
Add strerror_r.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.29 13-Mar-2005 perry

Add prototype for memmem(3). It is API compatible with the version in Linux.


# 1.28 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.27 12-Jul-2004 kleink

Move the strcasestr() prototype to the local extensions section.
Also __P() it; this should be consistent within a single header.


# 1.26 03-Jul-2004 junyoung

Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.


Revision tags: netbsd-2-0-base
# 1.25 07-Aug-2003 agc

branches: 1.25.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.24 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.23 22-Mar-2001 kleink

Sprinkle some restrict qualifiers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.22 10-Jan-2000 kleink

branches: 1.22.6;
Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.21 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 09-Sep-1999 kleink

strlcat() and strlcpy() aren't ISO/IEC 9899:1990.


# 1.19 08-Sep-1999 lukem

prototypes for strlcat() and strlcpy()


Revision tags: netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.18 27-Jul-1998 mycroft

branches: 1.18.2;
Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software. *sigh*


# 1.17 26-Jul-1998 mycroft

KNF nit.


# 1.16 26-Jul-1998 mycroft

const poisoning.


# 1.15 06-May-1998 kleink

Make strtok_r() available to _XOPEN_SOURCE >= 500, and fix the protection of
memccpy() and strdup().


# 1.14 27-Apr-1998 tv

Move the #include <strings.h> line inside a !defined(_XOPEN_SOURCE) block
(not just !POSIX and !ANSI)


# 1.13 03-Feb-1998 perry

restore include of sys/featuretest.h


# 1.12 02-Feb-1998 perry

remove sys/featuretest.h -- why did kleink add it?


# 1.11 02-Feb-1998 perry

merge lite-2


# 1.10 02-Feb-1998 kleink

Per XPG4.2, move the prototypes of bcmp(), bcopy(), bzero(), ffs(), index(),
rindex(), strcasecmp() and strncasecmp() to <strings.h>. For now, include
<strings.h> to get these prototypes; this should go away eventually.
Also, protect the prototypes of strtok_r() and strsep().


# 1.9 12-Jan-1998 kleink

Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 16-Oct-1997 christos

move setmode and strsignal to unistd.h


# 1.7 13-Jul-1997 christos

Add missing strtok_r prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.5 02-Aug-1994 jtc

branches: 1.5.2;
Added prototype for new function strsignal()


Revision tags: netbsd-1-0-base
# 1.4 21-May-1994 cgd

add _BSD's to ansi types


# 1.3 11-Oct-1993 jtc

Changed preprocessor conditional so non-standard functions would not be
declared in a _POSIX_SOURCE environment.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision


Revision tags: pgoyette-localcount-20161104
# 1.51 12-Oct-2016 christos

add strchrnull


Revision tags: localcount-20160914 pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base
# 1.50 10-Mar-2016 leot

branches: 1.50.2;
strndup() is part of XSI from The Open Group Base Specification Issue 7 and had
a similar history of stpcpy(), stpncpy() and strnlen().
Make it visible under XOPEN_SOURCE>=700 too (not just _NETBSD_SOURCE).

ok dholland@


# 1.49 24-Sep-2014 christos

add strnstr from FreeBSD


Revision tags: netbsd-7-0-2-RELEASE netbsd-7-nhusb-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 tls-maxphys-base
# 1.48 28-Aug-2013 riastradh

Publish explicit_memset and consttime_memequal in userland libc.

Remove the double-underscore from the userland versions, and do the
weak alias dance instead, now that these are public parts of libc.

As discussed on tech-userlevel:

https://mail-index.netbsd.org/tech-userlevel/2013/06/24/msg007843.html
(option 3)


# 1.47 28-Aug-2013 riastradh

Make explicit_memset match memset's return value.


# 1.46 27-Aug-2013 joerg

Remove outdated comment.


# 1.45 19-Aug-2013 joerg

Add strerror_l.


Revision tags: riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base
# 1.44 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.43 21-Apr-2013 joerg

__BEGIN_DECLS/__END_DECLS


# 1.42 19-Apr-2013 joerg

Add dummy strcoll_l and strxfrm_l.


Revision tags: agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6
# 1.41 30-Aug-2012 drochner

branches: 1.41.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.


Revision tags: yamt-pagecache-base5
# 1.40 20-Apr-2012 joerg

Do not wrap other header files with extern "C".


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 yamt-pagecache-base4 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base uebayasi-xip-base7 bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231 uebayasi-xip-base6 uebayasi-xip-base5 uebayasi-xip-base4 uebayasi-xip-base3 uebayasi-xip-base2 uebayasi-xip-base1 uebayasi-xip-base matt-premerge-20091211
# 1.39 22-Jul-2009 kleink

branches: 1.39.8;
Declare strsignal(3) in <string.h>, per POSIX-2008, and adjust
documentation accordingly.

Fixes PR standards/41325 from Perry E. Metzger.


Revision tags: jym-xensuspend-nbase jym-xensuspend-base
# 1.38 01-May-2009 perry

note that we have strsignal but it is in the wrong include file.


# 1.37 01-May-2009 perry

Add prototypes for stpcpy, stpncpy, strnlen, added in the latest POSIX.

Implementations in libc to follow.

For POSIX compliance, we are still missing:

strcoll_l
strerror_l
strsignal
strxfrm_l


# 1.36 10-Apr-2009 christos

add memrchr


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 christos-time_t-nbase christos-time_t-base netbsd-5-base matt-mips64-base2 mjf-devfs2-base wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-revivesa-base-1 simonb-wapbl-nbase yamt-pf42-base4 simonb-wapbl-base yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase cube-autoconf-base matt-armv6-base hpcarm-cleanup-base
# 1.35 19-Oct-2007 christos

branches: 1.35.18;
kill _NETBSD_TOOLS.


# 1.34 18-Oct-2007 christos

Introduce _NETBSD_TOOLS for symbols the are needed in tools build


Revision tags: matt-mips64-base
# 1.33 02-Aug-2007 kristerw

branches: 1.33.2; 1.33.4;
Do not include SSP files unless _FORTIFY_SOURCE > 0.


# 1.32 30-May-2007 tls

Match usage of FORTIFY_SOURCE on other platforms by not requiring special
include path: the normal header files now include the "SSP" ones (which one
should note are not really named right: SSP and FORTIFY_SOURCE are independent
features).

Disable USE_SSP on targets where the compiler doesn't support it at all
(mips, alpha) or it's known broken (sh3). But enable FORTIFY_SOURCE,
without SSP, on those platforms -- tested on mipsel.


Revision tags: netbsd-4-base
# 1.31 12-Aug-2006 christos

branches: 1.31.2; 1.31.4;
Add stresep and strndup.


Revision tags: abandoned-netbsd-4-base
# 1.30 28-Jul-2005 christos

branches: 1.30.2;
Add strerror_r.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-3-base
# 1.29 13-Mar-2005 perry

Add prototype for memmem(3). It is API compatible with the version in Linux.


# 1.28 03-Feb-2005 perry

de-__P -- the hack is long since useless. Discussed with christos,
matt, kleink, others. Approved by christos.


# 1.27 12-Jul-2004 kleink

Move the strcasestr() prototype to the local extensions section.
Also __P() it; this should be consistent within a single header.


# 1.26 03-Jul-2004 junyoung

Add strcasestr(3), case insensitive version of strstr(3).
Bump libc minor.

From FreeBSD.


Revision tags: netbsd-2-0-base
# 1.25 07-Aug-2003 agc

branches: 1.25.2;
Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22270, verified by myself.


# 1.24 28-Apr-2003 bjh21

Add a new feature-test macro, _NETBSD_SOURCE. If this is defined
by the application, all NetBSD interfaces are made visible, even
if some other feature-test macro (like _POSIX_C_SOURCE) is defined.
<sys/featuretest.h> defined _NETBSD_SOURCE if none of _ANSI_SOURCE,
_POSIX_C_SOURCE and _XOPEN_SOURCE is defined, so as to preserve
existing behaviour.

This has two major advantages:
+ Programs that require non-POSIX facilities but define _POSIX_C_SOURCE
can trivially be overruled by putting -D_NETBSD_SOURCE in their CFLAGS.
+ It makes most of the #ifs simpler, in that they're all now ORs of the
various macros, rather than having checks for (!defined(_ANSI_SOURCE) ||
!defined(_POSIX_C_SOURCE) || !defined(_XOPEN_SOURCE)) all over the place.

I've tried not to change the semantics of the headers in any case where
_NETBSD_SOURCE wasn't defined, but there were some places where the
current semantics were clearly mad, and retaining them was harder than
correcting them. In particular, I've mostly normalised things so that
_ANSI_SOURCE gets you the smallest set of stuff, then _POSIX_C_SOURCE,
_XOPEN_SOURCE and _NETBSD_SOURCE in that order.

Tested by building for vax, encouraged by thorpej, and uncontested in
tech-userlevel for a week.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 nathanw_sa_before_merge fvdl_fs64_base nathanw_sa_base netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.23 22-Mar-2001 kleink

Sprinkle some restrict qualifiers.


Revision tags: netbsd-1-5-PATCH003 netbsd-1-5-PATCH002 netbsd-1-5-PATCH001 netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.22 10-Jan-2000 kleink

branches: 1.22.6;
Move <null.h> to <sys/null.h> for the purpose of avoiding conflicts due to
std C headers including it, and a kernel module written in C++ would benfit
as well.


# 1.21 22-Dec-1999 kleink

For the benefit of G++'s null pointer constant implementation, #define NULL
as __null with egcs 1.0 (GCC 2.90) and above. As several headers are affected
by this change, move the definition into a new header file, <null.h>, to ease
maintenance.


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base
# 1.20 09-Sep-1999 kleink

strlcat() and strlcpy() aren't ISO/IEC 9899:1990.


# 1.19 08-Sep-1999 lukem

prototypes for strlcat() and strlcpy()


Revision tags: netbsd-1-4-PATCH002 netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.18 27-Jul-1998 mycroft

branches: 1.18.2;
Make many of the new consts dependent on a new `__AUDIT__' flag, to avoid
breaking third party software. *sigh*


# 1.17 26-Jul-1998 mycroft

KNF nit.


# 1.16 26-Jul-1998 mycroft

const poisoning.


# 1.15 06-May-1998 kleink

Make strtok_r() available to _XOPEN_SOURCE >= 500, and fix the protection of
memccpy() and strdup().


# 1.14 27-Apr-1998 tv

Move the #include <strings.h> line inside a !defined(_XOPEN_SOURCE) block
(not just !POSIX and !ANSI)


# 1.13 03-Feb-1998 perry

restore include of sys/featuretest.h


# 1.12 02-Feb-1998 perry

remove sys/featuretest.h -- why did kleink add it?


# 1.11 02-Feb-1998 perry

merge lite-2


# 1.10 02-Feb-1998 kleink

Per XPG4.2, move the prototypes of bcmp(), bcopy(), bzero(), ffs(), index(),
rindex(), strcasecmp() and strncasecmp() to <strings.h>. For now, include
<strings.h> to get these prototypes; this should go away eventually.
Also, protect the prototypes of strtok_r() and strsep().


# 1.9 12-Jan-1998 kleink

Per XPG4, move the prototype of swab() from <string.h> to <unistd.h>.


Revision tags: netbsd-1-3-PATCH003 netbsd-1-3-PATCH003-CANDIDATE2 netbsd-1-3-PATCH003-CANDIDATE1 netbsd-1-3-PATCH003-CANDIDATE0 netbsd-1-3-PATCH002 netbsd-1-3-PATCH001 netbsd-1-3-RELEASE netbsd-1-3-BETA netbsd-1-3-base
# 1.8 16-Oct-1997 christos

move setmode and strsignal to unistd.h


# 1.7 13-Jul-1997 christos

Add missing strtok_r prototype


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.6 26-Oct-1994 cgd

new RCS ID format.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE
# 1.5 02-Aug-1994 jtc

branches: 1.5.2;
Added prototype for new function strsignal()


Revision tags: netbsd-1-0-base
# 1.4 21-May-1994 cgd

add _BSD's to ansi types


# 1.3 11-Oct-1993 jtc

Changed preprocessor conditional so non-standard functions would not be
declared in a _POSIX_SOURCE environment.


# 1.2 01-Aug-1993 mycroft

Add RCS identifiers.


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision