summaryrefslogtreecommitdiff
path: root/lib/libc/string
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2011-07-25 00:38:54 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2011-07-25 00:38:54 +0000
commitea9f4201a2a329e7f11830bc5cc7ef0e15a96899 (patch)
treead032412231d4a884a0fa5eb5968c8dcf8b9edb5 /lib/libc/string
parentf3340367353970776bc054537ea43f3ee8378f24 (diff)
update HISTORY and SEE ALSO for all of string(3), together with various
smaller improvements; jmc@ and nicm@ both ask me to get this in because further tweaking will be easier in-tree
Diffstat (limited to 'lib/libc/string')
-rw-r--r--lib/libc/string/bcmp.36
-rw-r--r--lib/libc/string/bcopy.38
-rw-r--r--lib/libc/string/bm.312
-rw-r--r--lib/libc/string/bstring.330
-rw-r--r--lib/libc/string/bzero.310
-rw-r--r--lib/libc/string/ffs.38
-rw-r--r--lib/libc/string/memccpy.38
-rw-r--r--lib/libc/string/memchr.316
-rw-r--r--lib/libc/string/memcmp.316
-rw-r--r--lib/libc/string/memcpy.322
-rw-r--r--lib/libc/string/memmove.314
-rw-r--r--lib/libc/string/memset.316
-rw-r--r--lib/libc/string/strcasecmp.316
-rw-r--r--lib/libc/string/strcat.318
-rw-r--r--lib/libc/string/strchr.320
-rw-r--r--lib/libc/string/strcmp.326
-rw-r--r--lib/libc/string/strcoll.39
-rw-r--r--lib/libc/string/strcpy.321
-rw-r--r--lib/libc/string/strcspn.316
-rw-r--r--lib/libc/string/strdup.319
-rw-r--r--lib/libc/string/strerror.313
-rw-r--r--lib/libc/string/strlcpy.314
-rw-r--r--lib/libc/string/strlen.312
-rw-r--r--lib/libc/string/strmode.36
-rw-r--r--lib/libc/string/strpbrk.316
-rw-r--r--lib/libc/string/strrchr.320
-rw-r--r--lib/libc/string/strsep.316
-rw-r--r--lib/libc/string/strsignal.311
-rw-r--r--lib/libc/string/strspn.316
-rw-r--r--lib/libc/string/strstr.318
-rw-r--r--lib/libc/string/strtok.338
-rw-r--r--lib/libc/string/strxfrm.39
-rw-r--r--lib/libc/string/swab.38
-rw-r--r--lib/libc/string/wcscasecmp.321
-rw-r--r--lib/libc/string/wcscat.332
-rw-r--r--lib/libc/string/wcschr.316
-rw-r--r--lib/libc/string/wcscmp.318
-rw-r--r--lib/libc/string/wcscpy.334
-rw-r--r--lib/libc/string/wcscspn.314
-rw-r--r--lib/libc/string/wcsdup.329
-rw-r--r--lib/libc/string/wcslcpy.312
-rw-r--r--lib/libc/string/wcslen.314
-rw-r--r--lib/libc/string/wcspbrk.318
-rw-r--r--lib/libc/string/wcsrchr.314
-rw-r--r--lib/libc/string/wcsspn.314
-rw-r--r--lib/libc/string/wcsstr.316
-rw-r--r--lib/libc/string/wcstok.325
-rw-r--r--lib/libc/string/wcswidth.315
-rw-r--r--lib/libc/string/wmemchr.314
-rw-r--r--lib/libc/string/wmemcmp.316
-rw-r--r--lib/libc/string/wmemcpy.320
-rw-r--r--lib/libc/string/wmemmove.314
-rw-r--r--lib/libc/string/wmemset.315
53 files changed, 642 insertions, 237 deletions
diff --git a/lib/libc/string/bcmp.3 b/lib/libc/string/bcmp.3
index 1a777506276..1660b4356bf 100644
--- a/lib/libc/string/bcmp.3
+++ b/lib/libc/string/bcmp.3
@@ -27,9 +27,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bcmp.3,v 1.8 2010/09/24 13:33:00 matthew Exp $
+.\" $OpenBSD: bcmp.3,v 1.9 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: September 24 2010 $
+.Dd $Mdocdate: July 25 2011 $
.Dt BCMP 3
.Os
.Sh NAME
@@ -77,7 +77,7 @@ making it vulnerable to timing attacks.
.Xr strcoll 3 ,
.Xr strxfrm 3
.Sh HISTORY
-A
+The
.Fn bcmp
function first appeared in
.Bx 4.2 .
diff --git a/lib/libc/string/bcopy.3 b/lib/libc/string/bcopy.3
index 3d3c8ee958b..3beaf09aca1 100644
--- a/lib/libc/string/bcopy.3
+++ b/lib/libc/string/bcopy.3
@@ -28,9 +28,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bcopy.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: bcopy.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt BCOPY 3
.Os
.Sh NAME
@@ -61,7 +61,7 @@ is zero, no bytes are copied.
.Xr strlcpy 3 ,
.Xr strncpy 3
.Sh HISTORY
-A
+The
.Fn bcopy
-function appeared in
+function first appeared in
.Bx 4.2 .
diff --git a/lib/libc/string/bm.3 b/lib/libc/string/bm.3
index 749ffc9b749..6c74848ecc5 100644
--- a/lib/libc/string/bm.3
+++ b/lib/libc/string/bm.3
@@ -28,9 +28,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bm.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: bm.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt BM 3
.Os
.Sh NAME
@@ -110,3 +110,11 @@ is
.%V Volume 21, 11 (November 1991)
.%P 1221-48
.Re
+.Sh HISTORY
+The
+.Fn bm_comp ,
+.Fn bm_exec ,
+and
+.Fn bm_free
+functions first appeared in
+.Nx 1.0 .
diff --git a/lib/libc/string/bstring.3 b/lib/libc/string/bstring.3
index cd16ab022d8..c44c5386c6b 100644
--- a/lib/libc/string/bstring.3
+++ b/lib/libc/string/bstring.3
@@ -27,9 +27,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bstring.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: bstring.3,v 1.9 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt BSTRING 3
.Os
.Sh NAME
@@ -85,14 +85,24 @@ conform to
.St -ansiC .
.Sh HISTORY
The
-.Fn bzero
+.Fn bcmp ,
+.Fn bcopy ,
and
-.Fn memccpy
-functions appeared in
-.Bx 4.3 .
+.Fn bzero
+functions first appeared in
+.Bx 4.2 .
The
-.Fn bcmp
+.Fn memchr ,
+.Fn memcmp ,
+.Fn memccpy ,
+.Fn memcpy ,
and
-.Fn bcopy
-functions appeared in
-.Bx 4.2 .
+.Fn memset
+functions first appeared in
+.At V
+and were reimplemented for
+.Bx 4.3 Tahoe .
+The
+.Fn memmove
+function first appeared in
+.Bx 4.3 Reno .
diff --git a/lib/libc/string/bzero.3 b/lib/libc/string/bzero.3
index c5ca32f4d2b..c79470377f1 100644
--- a/lib/libc/string/bzero.3
+++ b/lib/libc/string/bzero.3
@@ -27,9 +27,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: bzero.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: bzero.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt BZERO 3
.Os
.Sh NAME
@@ -55,7 +55,7 @@ does nothing.
.Xr memset 3 ,
.Xr swab 3
.Sh HISTORY
-A
+The
.Fn bzero
-function appeared in
-.Bx 4.3 .
+function first appeared in
+.Bx 4.2 .
diff --git a/lib/libc/string/ffs.3 b/lib/libc/string/ffs.3
index 27b26969e51..6f150c46c40 100644
--- a/lib/libc/string/ffs.3
+++ b/lib/libc/string/ffs.3
@@ -27,9 +27,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: ffs.3,v 1.5 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: ffs.3,v 1.6 2011/07/25 00:38:52 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt FFS 3
.Os
.Sh NAME
@@ -52,5 +52,5 @@ A return value of 0 means that the argument was zero.
.Sh HISTORY
The
.Fn ffs
-function appeared in
-.Bx 4.3 .
+function first appeared in
+.Bx 4.2 .
diff --git a/lib/libc/string/memccpy.3 b/lib/libc/string/memccpy.3
index ef53d956458..f8f880e3b13 100644
--- a/lib/libc/string/memccpy.3
+++ b/lib/libc/string/memccpy.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: memccpy.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: memccpy.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)memccpy.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMCCPY 3
.Os
.Sh NAME
@@ -70,4 +70,6 @@ bytes are copied, and a null pointer is returned.
The
.Fn memccpy
function first appeared in
-.Bx 4.4 .
+.At V
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/memchr.3 b/lib/libc/string/memchr.3
index 558848ac231..56a4e4780e8 100644
--- a/lib/libc/string/memchr.3
+++ b/lib/libc/string/memchr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: memchr.3,v 1.10 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memchr.3,v 1.9 2007/09/03 16:50:14 jmc Exp $
-.\"
-.Dd $Mdocdate: September 3 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMCHR 3
.Os
.Sh NAME
@@ -79,7 +79,8 @@ bytes.
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wmemchr 3
.Sh STANDARDS
The
.Fn memchr
@@ -91,3 +92,10 @@ The
function is an
.Ox
extension.
+.Sh HISTORY
+The
+.Fn memchr
+function first appeared in
+.At V
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/memcmp.3 b/lib/libc/string/memcmp.3
index 8c35f388f2c..951a04ed8a4 100644
--- a/lib/libc/string/memcmp.3
+++ b/lib/libc/string/memcmp.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: memcmp.3,v 1.7 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memcmp.3,v 1.6 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMCMP 3
.Os
.Sh NAME
@@ -69,9 +69,17 @@ Zero-length strings are always identical.
.Xr strcasecmp 3 ,
.Xr strcmp 3 ,
.Xr strcoll 3 ,
-.Xr strxfrm 3
+.Xr strxfrm 3 ,
+.Xr wmemcmp 3
.Sh STANDARDS
The
.Fn memcmp
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn memcmp
+function first appeared in
+.At V
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/memcpy.3 b/lib/libc/string/memcpy.3
index 1deb03631b1..e95d670ad9d 100644
--- a/lib/libc/string/memcpy.3
+++ b/lib/libc/string/memcpy.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: memcpy.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memcpy.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMCPY 3
.Os
.Sh NAME
@@ -60,18 +60,26 @@ function returns the original value of
.Xr memccpy 3 ,
.Xr memmove 3 ,
.Xr strcpy 3 ,
-.Xr strlcpy 3
+.Xr strlcpy 3 ,
+.Xr wmemcpy 3
.Sh STANDARDS
The
.Fn memcpy
function conforms to
.St -ansiC .
-.Sh BUGS
+.Sh HISTORY
+The
+.Fn memcpy
+function first appeared in
+.At V
+and was reimplemented for
+.Bx 4.3 Tahoe .
+.Sh CAVEATS
In this implementation
.Fn memcpy
is implemented using
.Xr bcopy 3 ,
and therefore the buffers may overlap.
On other systems, copying overlapping buffers may produce surprises.
-A simpler solution is to not use
-.Fn memcpy .
+A portable, safe solution is to use
+.Xr memmove 3 .
diff --git a/lib/libc/string/memmove.3 b/lib/libc/string/memmove.3
index c6e39126698..ae8569a1c7b 100644
--- a/lib/libc/string/memmove.3
+++ b/lib/libc/string/memmove.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: memmove.3,v 1.8 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memmove.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMMOVE 3
.Os
.Sh NAME
@@ -62,9 +62,15 @@ function returns the original value of
.Xr memccpy 3 ,
.Xr memcpy 3 ,
.Xr strcpy 3 ,
-.Xr strlcpy 3
+.Xr strlcpy 3 ,
+.Xr wmemmove 3
.Sh STANDARDS
The
.Fn memmove
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn memmove
+function first appeared in
+.Bx 4.3 Reno .
diff --git a/lib/libc/string/memset.3 b/lib/libc/string/memset.3
index 7799b5e2d28..db94cb9ba61 100644
--- a/lib/libc/string/memset.3
+++ b/lib/libc/string/memset.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: memset.3,v 1.7 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: memset.3,v 1.6 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt MEMSET 3
.Os
.Sh NAME
@@ -59,9 +59,17 @@ function returns the original value of
.Fa b .
.Sh SEE ALSO
.Xr bzero 3 ,
-.Xr swab 3
+.Xr swab 3 ,
+.Xr wmemset 3
.Sh STANDARDS
The
.Fn memset
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn memset
+function first appeared in
+.At V
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strcasecmp.3 b/lib/libc/string/strcasecmp.3
index c17aa694d10..0900c8a97a4 100644
--- a/lib/libc/string/strcasecmp.3
+++ b/lib/libc/string/strcasecmp.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strcasecmp.3,v 1.10 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strcasecmp.3,v 1.11 2011/07/25 00:38:52 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
.\"
.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCASECMP 3
.Os
.Sh NAME
@@ -74,11 +74,19 @@ characters.
.Xr memcmp 3 ,
.Xr strcmp 3 ,
.Xr strcoll 3 ,
-.Xr strxfrm 3
+.Xr strxfrm 3 ,
+.Xr wcscasecmp 3
+.Sh STANDARDS
+The
+.Fn strcasecmp
+and
+.Fn strncasecmp
+functions conform to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn strcasecmp
and
.Fn strncasecmp
functions first appeared in
-.Bx 4.4 .
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strcat.3 b/lib/libc/string/strcat.3
index 4068db752c7..81aae19a63b 100644
--- a/lib/libc/string/strcat.3
+++ b/lib/libc/string/strcat.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strcat.3,v 1.13 2011/07/25 00:38:52 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcat.3,v 1.12 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCAT 3
.Os
.Sh NAME
@@ -122,8 +122,9 @@ functions are a better choice, as shown below.
.Xr memcpy 3 ,
.Xr memmove 3 ,
.Xr strcpy 3 ,
-.Xr strlcat 3 ,
-.Xr strlcpy 3
+.Xr strlcpy 3 ,
+.Xr wcscat 3 ,
+.Xr wcslcpy 3
.Sh STANDARDS
The
.Fn strcat
@@ -131,3 +132,10 @@ and
.Fn strncat
functions conform to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strcat
+and
+.Fn strncat
+functions first appeared in
+.At v7 .
diff --git a/lib/libc/string/strchr.3 b/lib/libc/string/strchr.3
index 6a9de9604e5..d3194dffab6 100644
--- a/lib/libc/string/strchr.3
+++ b/lib/libc/string/strchr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strchr.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strchr.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCHR 3
.Os
.Sh NAME
@@ -90,7 +90,8 @@ p = strchr(s, 'o');
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcschr 3
.Sh STANDARDS
The
.Fn strchr
@@ -100,3 +101,14 @@ function conforms to
The
.Fn index
function is deprecated and shouldn't be used in new code.
+.Sh HISTORY
+The
+.Fn index
+function first appeared in
+.At v7 .
+The
+.Fn strchr
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strcmp.3 b/lib/libc/string/strcmp.3
index 8b63772bdc7..aea2023b7bf 100644
--- a/lib/libc/string/strcmp.3
+++ b/lib/libc/string/strcmp.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strcmp.3,v 1.11 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcmp.3,v 1.10 2009/12/05 07:45:48 jmc Exp $
-.\"
-.Dd $Mdocdate: December 5 2009 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCMP 3
.Os
.Sh NAME
@@ -53,6 +53,11 @@ functions lexicographically compare the NUL-terminated strings
.Fa s1
and
.Fa s2 .
+The
+.Fn strncmp
+function compares at most
+.Fa len
+characters.
.Sh RETURN VALUES
The
.Fn strcmp
@@ -67,17 +72,13 @@ The comparison is done using unsigned characters, so that
.Ql \e200
is greater than
.Ql \e0 .
-.Pp
-.Fn strncmp
-compares at most
-.Fa len
-characters.
.Sh SEE ALSO
.Xr bcmp 3 ,
.Xr memcmp 3 ,
.Xr strcasecmp 3 ,
.Xr strcoll 3 ,
-.Xr strxfrm 3
+.Xr strxfrm 3 ,
+.Xr wcscmp
.Sh STANDARDS
The
.Fn strcmp
@@ -85,3 +86,10 @@ and
.Fn strncmp
functions conform to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strcmp
+and
+.Fn strncmp
+functions first appeared in
+.At v7 .
diff --git a/lib/libc/string/strcoll.3 b/lib/libc/string/strcoll.3
index ea7452a749a..72e398c44cd 100644
--- a/lib/libc/string/strcoll.3
+++ b/lib/libc/string/strcoll.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcoll.3,v 1.7 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strcoll.3,v 1.8 2011/07/25 00:38:53 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCOLL 3
.Os
.Sh NAME
@@ -66,3 +66,8 @@ The
.Fn strcoll
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strcoll
+function first appeared in
+.Bx 4.3 Reno .
diff --git a/lib/libc/string/strcpy.3 b/lib/libc/string/strcpy.3
index 428e474d430..400eeee622a 100644
--- a/lib/libc/string/strcpy.3
+++ b/lib/libc/string/strcpy.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strcpy.3,v 1.16 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcpy.3,v 1.15 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCPY 3
.Os
.Sh NAME
@@ -57,8 +57,9 @@ to
.Ql \e0
character).
.Pp
+The
.Fn strncpy
-copies not more than
+function copies not more than
.Fa len
characters into
.Fa dst ,
@@ -141,7 +142,10 @@ is simply:
.Xr memccpy 3 ,
.Xr memcpy 3 ,
.Xr memmove 3 ,
-.Xr strlcpy 3
+.Xr strcat 3 ,
+.Xr strlcpy 3 ,
+.Xr wcscpy 3 ,
+.Xr wcslcpy 3
.Sh STANDARDS
The
.Fn strcpy
@@ -149,3 +153,10 @@ and
.Fn strncpy
functions conform to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strcpy
+and
+.Fn strncpy
+functions first appeared in
+.At v7 .
diff --git a/lib/libc/string/strcspn.3 b/lib/libc/string/strcspn.3
index 21c727344dd..70c8ef76120 100644
--- a/lib/libc/string/strcspn.3
+++ b/lib/libc/string/strcspn.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strcspn.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strcspn.3,v 1.9 2007/08/08 07:20:45 ray Exp $
-.\"
-.Dd $Mdocdate: August 8 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRCSPN 3
.Os
.Sh NAME
@@ -92,9 +92,17 @@ if (fgets(line, sizeof(line), fp) != NULL)
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcscspn 3
.Sh STANDARDS
The
.Fn strcspn
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strcspn
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strdup.3 b/lib/libc/string/strdup.3
index 42a578b913c..02d5666a9c2 100644
--- a/lib/libc/string/strdup.3
+++ b/lib/libc/string/strdup.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strdup.3,v 1.17 2010/05/19 06:32:43 jmc Exp $
+.\" $OpenBSD: strdup.3,v 1.18 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: May 19 2010 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRDUP 3
.Os
.Sh NAME
@@ -73,10 +73,8 @@ to an allocated area of memory containing the NUL-terminated string
char *p;
p = strdup("foobar");
-if (p == NULL) {
- fprintf(stderr, "Out of memory.\en");
- exit(1);
-}
+if (p == NULL)
+ err(1, NULL);
.Ed
.Sh ERRORS
The
@@ -90,7 +88,8 @@ for any of the errors specified for the library function
.Xr malloc 3 ,
.Xr strcpy 3 ,
.Xr strlcpy 3 ,
-.Xr strlen 3
+.Xr strlen 3 ,
+.Xr wcsdup 3
.Sh STANDARDS
The
.Fn strdup
@@ -102,8 +101,10 @@ functions conform to
The
.Fn strdup
function first appeared in
-.Bx 4.4 .
+.Bx 4.3 Reno .
The
.Fn strndup
-function first appeared in
+function appeared in glibc 2.0, was reimplemented for
+.Nx 4.0 ,
+and ported to
.Ox 4.8 .
diff --git a/lib/libc/string/strerror.3 b/lib/libc/string/strerror.3
index 84c64c10bb9..f3f80432c3d 100644
--- a/lib/libc/string/strerror.3
+++ b/lib/libc/string/strerror.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strerror.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strerror.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRERROR 3
.Os
.Sh NAME
@@ -111,3 +111,12 @@ The
.Fn strerror_r
function conforms to
.St -p1003.1 .
+.Sh HISTORY
+The
+.Fn strerror
+function first appeared in
+.Bx 4.3 Reno .
+The
+.Fn strerror_r
+function first appeared in
+.Ox 3.3 .
diff --git a/lib/libc/string/strlcpy.3 b/lib/libc/string/strlcpy.3
index feda63fae7b..ead54ec4388 100644
--- a/lib/libc/string/strlcpy.3
+++ b/lib/libc/string/strlcpy.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strlcpy.3,v 1.19 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strlcpy.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRLCPY 3
.Os
.Sh NAME
@@ -176,7 +176,8 @@ As a matter of fact, the first version of this manual page got it wrong.
.Sh SEE ALSO
.Xr snprintf 3 ,
.Xr strncat 3 ,
-.Xr strncpy 3
+.Xr strncpy 3 ,
+.Xr wcslcpy 3
.Sh HISTORY
The
.Fn strlcpy
@@ -184,3 +185,10 @@ and
.Fn strlcat
functions first appeared in
.Ox 2.4 .
+.Sh AUTHORS
+The
+.Fn strlcpy
+and
+.Fn strlcat
+functions were created by
+.An Todd C. Miller Aq Todd.Miller@courtesan.com .
diff --git a/lib/libc/string/strlen.3 b/lib/libc/string/strlen.3
index 3607fde5155..9187496a00c 100644
--- a/lib/libc/string/strlen.3
+++ b/lib/libc/string/strlen.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strlen.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strlen.3,v 1.9 2010/05/24 21:27:25 millert Exp $
-.\"
-.Dd $Mdocdate: May 24 2010 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRLEN 3
.Os
.Sh NAME
@@ -78,7 +78,8 @@ or
.Fa maxlen ,
whichever is smaller.
.Sh SEE ALSO
-.Xr string 3
+.Xr string 3 ,
+.Xr wcslen 3
.Sh STANDARDS
The
.Fn strlen
@@ -98,5 +99,6 @@ function first appeared in
.At v7 .
The
.Fn strnlen
-function first appeared in
+function appeared in glibc 2.0
+and was reimplemented for
.Ox 4.8 .
diff --git a/lib/libc/string/strmode.3 b/lib/libc/string/strmode.3
index ebeafcaf6e6..5d371b38c8a 100644
--- a/lib/libc/string/strmode.3
+++ b/lib/libc/string/strmode.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strmode.3,v 1.14 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strmode.3,v 1.15 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -29,7 +29,7 @@
.\"
.\" @(#)strmode.3 8.3 (Berkeley) 7/28/94
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRMODE 3
.Os
.Sh NAME
@@ -154,4 +154,4 @@ function always returns 0.
The
.Fn strmode
function first appeared in
-.Bx 4.4 .
+.Bx 4.3 Reno .
diff --git a/lib/libc/string/strpbrk.3 b/lib/libc/string/strpbrk.3
index 9d6c676c8d9..9e13c42ad08 100644
--- a/lib/libc/string/strpbrk.3
+++ b/lib/libc/string/strpbrk.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strpbrk.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strpbrk.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRPBRK 3
.Os
.Sh NAME
@@ -64,9 +64,17 @@ returns
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcspbrk 3
.Sh STANDARDS
The
.Fn strpbrk
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strpbrk
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strrchr.3 b/lib/libc/string/strrchr.3
index 0d1f4be9719..9eea08b0a92 100644
--- a/lib/libc/string/strrchr.3
+++ b/lib/libc/string/strrchr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strrchr.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strrchr.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRRCHR 3
.Os
.Sh NAME
@@ -92,7 +92,8 @@ p = strrchr(s, 'o');
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcsrchr 3
.Sh STANDARDS
The
.Fn strrchr
@@ -102,3 +103,14 @@ function conforms to
The
.Fn rindex
function is deprecated and shouldn't be used in new code.
+.Sh HISTORY
+The
+.Fn rindex
+function first appeared in
+.At v7 .
+The
+.Fn strrchr
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strsep.3 b/lib/libc/string/strsep.3
index cceeda75772..63cdf2333ad 100644
--- a/lib/libc/string/strsep.3
+++ b/lib/libc/string/strsep.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: strsep.3,v 1.12 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strsep.3,v 1.13 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -32,7 +32,7 @@
.\"
.\" @(#)strsep.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRSEP 3
.Os
.Sh NAME
@@ -96,17 +96,15 @@ for (ap = argv; ap < &argv[9] &&
.Sh HISTORY
The
.Fn strsep
-function is intended as a replacement for the
-.Fn strtok
+function first appeared in
+.Bx 4.3 Reno .
+It is intended as a replacement for the
+.Xr strtok 3
function.
While the
-.Fn strtok
+.Xr strtok 3
function should be preferred for portability reasons (it conforms to
.St -ansiC )
it is unable to handle empty fields, i.e., detect fields delimited by
two adjacent delimiter characters, or to be used for more than a single
string at a time.
-The
-.Fn strsep
-function first appeared in
-.Bx 4.4 .
diff --git a/lib/libc/string/strsignal.3 b/lib/libc/string/strsignal.3
index 839402dcb1c..1f9cfc7ef51 100644
--- a/lib/libc/string/strsignal.3
+++ b/lib/libc/string/strsignal.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strsignal.3,v 1.5 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strsignal.3,v 1.6 2011/07/25 00:38:53 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRSIGNAL 3
.Os
.Sh NAME
@@ -54,3 +54,10 @@ overwritten by subsequent calls to
.Xr intro 2 ,
.Xr psignal 3 ,
.Xr setlocale 3
+.Sh HISTORY
+The
+.Fn strsignal
+function first appeared in
+.At V.4
+and was reimplemented for
+.Nx 1.0 .
diff --git a/lib/libc/string/strspn.3 b/lib/libc/string/strspn.3
index f902ca35d2b..b1a2ae30146 100644
--- a/lib/libc/string/strspn.3
+++ b/lib/libc/string/strspn.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strspn.3,v 1.10 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strspn.3,v 1.9 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRSPN 3
.Os
.Sh NAME
@@ -76,9 +76,17 @@ span = strspn(s, charset);
.Xr strrchr 3 ,
.Xr strsep 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcsspn 3
.Sh STANDARDS
The
.Fn strspn
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strspn
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
diff --git a/lib/libc/string/strstr.3 b/lib/libc/string/strstr.3
index 38bd207727c..4069d55ed2b 100644
--- a/lib/libc/string/strstr.3
+++ b/lib/libc/string/strstr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strstr.3,v 1.11 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strstr.3,v 1.10 2007/09/19 16:06:45 jmc Exp $
-.\"
-.Dd $Mdocdate: September 19 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRSTR 3
.Os
.Sh NAME
@@ -79,7 +79,8 @@ is returned.
.Xr strrchr 3 ,
.Xr strsep 3 ,
.Xr strspn 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wcsstr 3
.Sh STANDARDS
The
.Fn strstr
@@ -87,6 +88,13 @@ function conforms to
.St -ansiC .
.Sh HISTORY
The
-.Fn strcasestr
+.Fn strstr
function first appeared in
+.Bx 4.3 Reno .
+The
+.Fn strcasestr
+function appeared in glibc 2.1,
+was reimplemented for
+.Fx 4.5
+and ported to
.Ox 3.8 .
diff --git a/lib/libc/string/strtok.3 b/lib/libc/string/strtok.3
index ed7d5158eda..fbf0abfc269 100644
--- a/lib/libc/string/strtok.3
+++ b/lib/libc/string/strtok.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: strtok.3,v 1.20 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1988, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strtok.3,v 1.19 2007/05/31 19:19:32 jmc Exp $
-.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRTOK 3
.Os
.Sh NAME
@@ -73,6 +73,14 @@ function is a version of
.Fn strtok
that takes an explicit context argument and is reentrant.
.Pp
+Since
+.Fn strtok
+and
+.Fn strtok_r
+modify the string,
+.Fa str
+should not point to an area in the initialized data segment.
+.Sh RETURN VALUES
The
.Fn strtok
and
@@ -82,14 +90,6 @@ in the string, after replacing the separator character itself with an
.Tn ASCII NUL
character.
When no more tokens remain, a null pointer is returned.
-.Pp
-Since
-.Fn strtok
-and
-.Fn strtok_r
-modify the string,
-.Fa str
-should not point to an area in the initialized data segment.
.Sh EXAMPLES
The following will construct an array of pointers to each individual word in
the string
@@ -133,12 +133,26 @@ will point to
.Xr strrchr 3 ,
.Xr strsep 3 ,
.Xr strspn 3 ,
-.Xr strstr 3
+.Xr strstr 3 ,
+.Xr wcstok 3
.Sh STANDARDS
The
.Fn strtok
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strtok
+function first appeared in
+.At III
+and was reimplemented for
+.Bx 4.3 Tahoe .
+The
+.Fn strtok_r
+function first appeared in
+.Nx 1.3
+and was reimplemented for
+.Ox 2.7 .
.Sh BUGS
The System V
.Fn strtok ,
diff --git a/lib/libc/string/strxfrm.3 b/lib/libc/string/strxfrm.3
index 73ce1351912..e4472946bef 100644
--- a/lib/libc/string/strxfrm.3
+++ b/lib/libc/string/strxfrm.3
@@ -29,9 +29,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: strxfrm.3,v 1.8 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: strxfrm.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt STRXFRM 3
.Os
.Sh NAME
@@ -67,6 +67,11 @@ The
.Fn strxfrm
function conforms to
.St -ansiC .
+.Sh HISTORY
+The
+.Fn strxfrm
+function first appeared in
+.Bx 4.3 Reno .
.Sh BUGS
Since locales are not fully implemented on
.Ox ,
diff --git a/lib/libc/string/swab.3 b/lib/libc/string/swab.3
index 56def1ec887..5ebaa485e9e 100644
--- a/lib/libc/string/swab.3
+++ b/lib/libc/string/swab.3
@@ -25,9 +25,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: swab.3,v 1.6 2007/05/31 19:19:32 jmc Exp $
+.\" $OpenBSD: swab.3,v 1.7 2011/07/25 00:38:53 schwarze Exp $
.\"
-.Dd $Mdocdate: May 31 2007 $
+.Dd $Mdocdate: July 25 2011 $
.Dt SWAB 3
.Os
.Sh NAME
@@ -55,7 +55,7 @@ must be an even number.
.Xr bzero 3 ,
.Xr memset 3
.Sh HISTORY
-A
+The
.Fn swab
-function appeared in
+function first appeared in
.At v7 .
diff --git a/lib/libc/string/wcscasecmp.3 b/lib/libc/string/wcscasecmp.3
index d76d33bd5c4..94cd6e0c380 100644
--- a/lib/libc/string/wcscasecmp.3
+++ b/lib/libc/string/wcscasecmp.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: wcscasecmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
+.\" $OpenBSD: wcscasecmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@@ -31,7 +31,7 @@
.\"
.\" @(#)strcasecmp.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCASECMP 3
.Os
.Sh NAME
@@ -66,6 +66,7 @@ compares at most
.Fa len
wide characters.
.Sh SEE ALSO
+.Xr strcasecmp 3 ,
.Xr wcscmp 3 ,
.Xr wmemcmp 3
.Sh STANDARDS
@@ -75,3 +76,19 @@ and
.Fn wcsncasecmp
functions conform to
.St -p1003.1-2008 .
+.Sh HISTORY
+The
+.Fn wcscasecmp
+and
+.Fn wcsncasecmp
+functions first appeared in
+.Ox 5.0 .
+.Sh AUTHORS
+The
+.Ox
+versions of
+.Fn wcscasecmp
+and
+.Fn wcsncasecmp
+were implemented by
+.An Marc Espie Aq espie@openbsd.org .
diff --git a/lib/libc/string/wcscat.3 b/lib/libc/string/wcscat.3
index c5321d5a2a3..d0281b8bd1a 100644
--- a/lib/libc/string/wcscat.3
+++ b/lib/libc/string/wcscat.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcscat.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcscat.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCAT 3
.Os
.Sh NAME
@@ -43,7 +43,7 @@
.Ft wchar_t *
.Fn wcscat "wchar_t * restrict s" "const wchar_t * restrict append"
.Ft wchar_t *
-.Fo strncat
+.Fo wcsncat
.Fa "wchar_t * restrict s"
.Fa "const wchar_t * restrict append"
.Fa "size_t count"
@@ -77,8 +77,9 @@ and
functions return the pointer
.Fa s .
.Sh SEE ALSO
+.Xr strcat 3 ,
+.Xr strlcpy 3 ,
.Xr wcscpy 3 ,
-.Xr wcslcat 3 ,
.Xr wcslcpy 3 ,
.Xr wmemcpy 3 ,
.Xr wmemmove 3
@@ -91,3 +92,24 @@ functions conform to
.St -isoC-99
and were first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcscat
+and
+.Fn wcsncat
+functions were ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
+.Sh CAVEATS
+Using the functions
+.Fn wcscat
+and
+.Fn wcsncat
+is very error-prone with respect to buffer overflows;
+see the EXAMPLES section in
+.Xr strcat 3
+for correct usage.
+Using
+.Xr wcslcat 3
+is a better choice in most cases.
diff --git a/lib/libc/string/wcschr.3 b/lib/libc/string/wcschr.3
index 10c78f34e18..ffe42f7ae6a 100644
--- a/lib/libc/string/wcschr.3
+++ b/lib/libc/string/wcschr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcschr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,10 +31,8 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcschr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
-.Dt STRCHR 3
+.Dd $Mdocdate: July 25 2011 $
+.Dt WCSCHR 3
.Os
.Sh NAME
.Nm wcschr
@@ -61,6 +61,7 @@ function returns a pointer to the located wide character or
.Dv NULL
if the wide character does not appear in the wide string.
.Sh SEE ALSO
+.Xr strchr 3 ,
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
.Xr wcsrchr 3 ,
@@ -75,3 +76,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcschr
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcscmp.3 b/lib/libc/string/wcscmp.3
index 15952b9022e..b34e5c2168b 100644
--- a/lib/libc/string/wcscmp.3
+++ b/lib/libc/string/wcscmp.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcscmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcscmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCMP 3
.Os
.Sh NAME
@@ -55,7 +55,7 @@ and
.Fa s2 .
The
.Fn wcsncmp
-compares at most
+function compares at most
.Fa len
wide characters.
.Sh RETURN VALUES
@@ -69,6 +69,7 @@ to whether the wide string
is greater than, equal to, or less than the wide string
.Fa s2 .
.Sh SEE ALSO
+.Xr strcmp 3 ,
.Xr wcscasecmp 3 ,
.Xr wmemcmp 3
.Sh STANDARDS
@@ -80,3 +81,12 @@ functions conform to
.St -isoC-99
and were first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcscmp
+and
+.Fn wcsncmp
+functions were ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcscpy.3 b/lib/libc/string/wcscpy.3
index a71d54f886a..dcc375acbf1 100644
--- a/lib/libc/string/wcscpy.3
+++ b/lib/libc/string/wcscpy.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcscpy.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcscpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCPY 3
.Os
.Sh NAME
@@ -51,7 +51,9 @@
.Sh DESCRIPTION
The
.Fn wcscpy
-function copies the wide string
+and
+.Fn wcsncpy
+functions copy the wide string
.Fa src
to
.Fa dst
@@ -83,6 +85,9 @@ and
functions return
.Fa dst .
.Sh SEE ALSO
+.Xr strcpy 3 ,
+.Xr strlcpy 3 ,
+.Xr wcscat 3 ,
.Xr wcslcpy 3 ,
.Xr wmemcpy 3 ,
.Xr wmemmove 3
@@ -95,3 +100,24 @@ functions conform to
.St -isoC-99
and were first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcscpy
+and
+.Fn wcsncpy
+functions were ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
+.Sh CAVEATS
+Using the functions
+.Fn wcscpy
+and
+.Fn wcsncpy
+is very error-prone with respect to buffer overflows;
+see the EXAMPLES section in
+.Xr strcpy 3
+for correct usage.
+Using
+.Xr wcslcpy 3
+is a better choice in most cases.
diff --git a/lib/libc/string/wcscspn.3 b/lib/libc/string/wcscspn.3
index 7623e9985f7..c17992501f0 100644
--- a/lib/libc/string/wcscspn.3
+++ b/lib/libc/string/wcscspn.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcscspn.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcscspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSCSPN 3
.Os
.Sh NAME
@@ -59,6 +59,7 @@ The
.Fn wcscspn
function returns the number of wide characters spanned.
.Sh SEE ALSO
+.Xr strcspn 3 ,
.Xr wcschr 3 ,
.Xr wcspbrk 3 ,
.Xr wcsrchr 3 ,
@@ -73,3 +74,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcscspn
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcsdup.3 b/lib/libc/string/wcsdup.3
index 6588f14988d..588a2571db8 100644
--- a/lib/libc/string/wcsdup.3
+++ b/lib/libc/string/wcsdup.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: wcsdup.3,v 1.3 2011/07/08 17:46:45 nicm Exp $
+.\" $OpenBSD: wcsdup.3,v 1.4 2011/07/25 00:38:53 schwarze Exp $
.\" $NetBSD: wcsdup.3,v 1.3 2010/12/16 17:42:28 wiz Exp $
.\"
.\" Copyright (c) 1990, 1991, 1993
@@ -28,14 +28,14 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" from: @(#)strdup.3 8.1 (Berkeley) 6/9/93
+.\" @(#)strdup.3 8.1 (Berkeley) 6/9/93
.\"
-.Dd $Mdocdate: July 8 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSDUP 3
.Os
.Sh NAME
.Nm wcsdup
-.Nd save a copy of a string
+.Nd save a copy of a wide string
.Sh SYNOPSIS
.In wchar.h
.Ft wchar_t *
@@ -66,15 +66,11 @@ wchar_t *p, b[32];
size_t blen;
blen = sizeof(b) / sizeof(b[0]);
-if (mbstowcs(b, o, blen) == (size_t)-1) {
- fprintf(stderr, "Failed to convert string.\en");
- exit(1);
-}
+if (mbstowcs(b, o, blen) == (size_t)-1)
+ err(1, NULL);
b[blen - 1] = 0;
-if ((p = wcsdup(b)) == NULL) {
- fprintf(stderr, "Out of memory.\en");
- exit(1);
-}
+if ((p = wcsdup(b)) == NULL)
+ err(1, NULL);
.Ed
.Sh ERRORS
The
@@ -87,8 +83,15 @@ for any of the errors specified for the library function
.Xr free 3 ,
.Xr malloc 3 ,
.Xr strdup 3
+.Sh STANDARDS
+The
+.Fn wcsdup
+function conforms to
+.St -p1003.1-2008 .
.Sh HISTORY
The
.Fn wcsdup
-function first appeared in
+function was ported from
+.Nx
+and first appeared in
.Ox 5.0 .
diff --git a/lib/libc/string/wcslcpy.3 b/lib/libc/string/wcslcpy.3
index 6f068dc9dff..ed6de07cbea 100644
--- a/lib/libc/string/wcslcpy.3
+++ b/lib/libc/string/wcslcpy.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: wcslcpy.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
+.\" $OpenBSD: wcslcpy.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" Copyright (c) 1998, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
.\"
@@ -14,7 +14,7 @@
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSLCPY 3
.Os
.Sh NAME
@@ -127,6 +127,7 @@ is incorrect or that
is not terminated with a null wide character).
The check exists to prevent potential security problems in incorrect code.
.Sh SEE ALSO
+.Xr strlcpy 3 ,
.Xr swprintf 3 ,
.Xr wcsncat 3 ,
.Xr wcsncpy 3
@@ -137,3 +138,10 @@ and
.Fn wcslcat
functions first appeared in
.Ox 3.8 .
+.Sh AUTHORS
+The
+.Fn wcslcpy
+and
+.Fn wcslcat
+functions are based on code by
+.An Todd C. Miller Aq Todd.Miller@courtesan.com .
diff --git a/lib/libc/string/wcslen.3 b/lib/libc/string/wcslen.3
index cf4813c4a4e..1b2eceab933 100644
--- a/lib/libc/string/wcslen.3
+++ b/lib/libc/string/wcslen.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcslen.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcslen.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSLEN 3
.Os
.Sh NAME
@@ -52,6 +52,7 @@ The
function returns the number of wide characters that precede the terminating
null wide character.
.Sh SEE ALSO
+.Xr strlen 3 ,
.Xr wcswidth 3
.Sh STANDARDS
The
@@ -60,3 +61,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcslen
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcspbrk.3 b/lib/libc/string/wcspbrk.3
index 81f08a8f1e7..6589e83c83e 100644
--- a/lib/libc/string/wcspbrk.3
+++ b/lib/libc/string/wcspbrk.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcspbrk.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcspbrk.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSPBRK 3
.Os
.Sh NAME
@@ -57,13 +57,14 @@ occur anywhere in
returns
.Dv NULL .
.Sh SEE ALSO
-.Xr wmemchr 3 ,
+.Xr strpbrk 3 ,
.Xr wcschr 3 ,
.Xr wcscspn 3 ,
.Xr wcsrchr 3 ,
.Xr wcsspn 3 ,
.Xr wcsstr 3 ,
-.Xr wcstok 3
+.Xr wcstok 3 ,
+.Xr wmemchr 3
.Sh STANDARDS
The
.Fn wcspbrk
@@ -71,3 +72,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcspbrk
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcsrchr.3 b/lib/libc/string/wcsrchr.3
index 5e0c1f88355..d65caa42929 100644
--- a/lib/libc/string/wcsrchr.3
+++ b/lib/libc/string/wcsrchr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcsrchr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcsrchr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSRCHR 3
.Os
.Sh NAME
@@ -61,6 +61,7 @@ function returns a pointer to the located wide character or
.Dv NULL
if the wide character does not appear in the wide string.
.Sh SEE ALSO
+.Xr strrchr 3 ,
.Xr wcschr 3 ,
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
@@ -75,3 +76,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcsrchr
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcsspn.3 b/lib/libc/string/wcsspn.3
index c73e13076e1..66505c59d19 100644
--- a/lib/libc/string/wcsspn.3
+++ b/lib/libc/string/wcsspn.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcsspn.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcsspn.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSSPN 3
.Os
.Sh NAME
@@ -55,6 +55,7 @@ The
.Fn wcsspn
function returns the number of wide characters spanned.
.Sh SEE ALSO
+.Xr strspn 3 ,
.Xr wcschr 3 ,
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
@@ -69,3 +70,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcsspn
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcsstr.3 b/lib/libc/string/wcsstr.3
index dc99b70667d..73f85c35044 100644
--- a/lib/libc/string/wcsstr.3
+++ b/lib/libc/string/wcsstr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wcsstr.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wcsstr.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSSTR 3
.Os
.Sh NAME
@@ -64,13 +64,14 @@ otherwise a pointer to the first wide character of the first occurrence of
.Fa little
is returned.
.Sh SEE ALSO
+.Xr strstr 3 ,
.Xr wcschr 3 ,
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
.Xr wcsrchr 3 ,
.Xr wcsspn 3 ,
.Xr wcstok 3 ,
-.Xr wmemchr 3 ,
+.Xr wmemchr 3
.Sh STANDARDS
The
.Fn wcsstr
@@ -78,3 +79,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wcsstr
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wcstok.3 b/lib/libc/string/wcstok.3
index 945ec9b990e..33ba1318a12 100644
--- a/lib/libc/string/wcstok.3
+++ b/lib/libc/string/wcstok.3
@@ -1,4 +1,4 @@
-.\" $OpenBSD: wcstok.3,v 1.6 2010/09/10 18:38:20 jmc Exp $
+.\" $OpenBSD: wcstok.3,v 1.7 2011/07/25 00:38:53 schwarze Exp $
.\"
.\" $NetBSD: wcstok.3,v 1.3 2003/09/08 17:54:33 wiz Exp $
.\"
@@ -54,7 +54,7 @@
.\" Original version ID:
.\" FreeBSD: src/lib/libc/string/wcstok.3,v 1.4 2002/10/15 09:49:54 tjr Exp
.\"
-.Dd $Mdocdate: September 10 2010 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSTOK 3
.Os
.Sh NAME
@@ -90,8 +90,14 @@ must be provided on each call.
The
.Fn wcstok
function is the wide-character counterpart of the
-.Fn strtok_r
+.Xr strtok_r 3
function.
+.Pp
+Since
+.Fn wcstok
+modifies the string,
+.Fa str
+should not point to an area in the initialized data segment.
.Sh RETURN VALUES
The
.Fn wcstok
@@ -118,7 +124,9 @@ for (tok = wcstok(text, seps, &last); tok != NULL;
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
.Xr wcsrchr 3 ,
-.Xr wcsspn 3
+.Xr wcsspn 3 ,
+.Xr wcsstr 3 ,
+.Xr wmemchr 3
.Sh STANDARDS
The
.Fn wcstok
@@ -126,11 +134,18 @@ function
conforms to
.St -isoC-99 .
.Sh HISTORY
+The
+.Fn wcstok
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
+.Pp
Some early implementations of
.Fn wcstok
omit the
context pointer argument,
.Fa last ,
and maintain state across calls in a static variable like
-.Fn strtok
+.Xr strtok 3
does.
diff --git a/lib/libc/string/wcswidth.3 b/lib/libc/string/wcswidth.3
index a68ec33cade..a2a5b2df862 100644
--- a/lib/libc/string/wcswidth.3
+++ b/lib/libc/string/wcswidth.3
@@ -1,4 +1,5 @@
-.\" $OpenBSD: wcswidth.3,v 1.1 2011/04/04 18:16:24 stsp Exp $
+.\" $OpenBSD: wcswidth.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 2002 Tim J. Robbins
.\" All rights reserved.
.\"
@@ -23,8 +24,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\"
-.Dd $Mdocdate: April 4 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WCSWIDTH 3
.Os
.Sh NAME
@@ -52,9 +52,18 @@ is an empty string (L""),
otherwise it returns the number of column positions occupied.
.Sh SEE ALSO
.Xr iswprint 3 ,
+.Xr strlen 3 ,
+.Xr wcslen 3 ,
.Xr wcwidth 3
.Sh STANDARDS
The
.Fn wcswidth
function conforms to
.St -p1003.1-2001 .
+.Sh HISTORY
+The
+.Fn wcswidth
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wmemchr.3 b/lib/libc/string/wmemchr.3
index 9d950154685..21df1aaa88f 100644
--- a/lib/libc/string/wmemchr.3
+++ b/lib/libc/string/wmemchr.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wmemchr.3,v 1.9 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wmemchr.3,v 1.8 2011/07/09 16:46:58 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WMEMCHR 3
.Os
.Sh NAME
@@ -57,6 +57,7 @@ if no such wide character exists within
.Fa len
wide characters.
.Sh SEE ALSO
+.Xr memchr 3 ,
.Xr wcschr 3 ,
.Xr wcscspn 3 ,
.Xr wcspbrk 3 ,
@@ -71,3 +72,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wmemchr
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wmemcmp.3 b/lib/libc/string/wmemcmp.3
index e1d56ec30ea..6006b4e5c10 100644
--- a/lib/libc/string/wmemcmp.3
+++ b/lib/libc/string/wmemcmp.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wmemcmp.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wmemcmp.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WMEMCMP 3
.Os
.Sh NAME
@@ -59,8 +59,9 @@ otherwise the difference between the first two differing wide characters is
returned.
Zero-length wide strings are always identical.
.Sh SEE ALSO
+.Xr memcmp 3 ,
.Xr wcscasecmp 3 ,
-.Xr wcscmp 3 ,
+.Xr wcscmp 3
.Sh STANDARDS
The
.Fn wmemcmp
@@ -68,3 +69,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wmemcmp
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wmemcpy.3 b/lib/libc/string/wmemcpy.3
index 9147bb79648..1102640ad4f 100644
--- a/lib/libc/string/wmemcpy.3
+++ b/lib/libc/string/wmemcpy.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wmemcpy.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wmemcpy.3,v 1.2 2011/07/09 16:46:58 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WMEMCPY 3
.Os
.Sh NAME
@@ -56,6 +56,7 @@ The
function returns the original value of
.Fa dst .
.Sh SEE ALSO
+.Xr memcpy 3 ,
.Xr wcscpy 3 ,
.Xr wcslcpy 3 ,
.Xr wmemmove 3
@@ -66,12 +67,19 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
-.Sh BUGS
+.Sh HISTORY
+The
+.Fn wmemcpy
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
+.Sh CAVEATS
In this implementation
.Fn wmemcpy
is implemented using
.Xr bcopy 3 ,
and therefore the buffers may overlap.
On other systems, copying overlapping buffers may produce surprises.
-A simpler solution is to not use
-.Fn wmemcpy .
+A portable, safe solution is to use
+.Xr wmemmove 3 .
diff --git a/lib/libc/string/wmemmove.3 b/lib/libc/string/wmemmove.3
index b018bd5cbc9..45daa854baf 100644
--- a/lib/libc/string/wmemmove.3
+++ b/lib/libc/string/wmemmove.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wmemmove.3,v 1.2 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wmemmove.3,v 1.1 2011/07/09 16:32:11 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WMEMMOVE 3
.Os
.Sh NAME
@@ -58,6 +58,7 @@ The
function returns the original value of
.Fa dst .
.Sh SEE ALSO
+.Xr memmove 3 ,
.Xr wcscpy 3 ,
.Xr wcslcpy 3 ,
.Xr wmemcpy 3
@@ -68,3 +69,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wmemmove
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .
diff --git a/lib/libc/string/wmemset.3 b/lib/libc/string/wmemset.3
index f1e52e6a8d1..1b840762ec5 100644
--- a/lib/libc/string/wmemset.3
+++ b/lib/libc/string/wmemset.3
@@ -1,3 +1,5 @@
+.\" $OpenBSD: wmemset.3,v 1.3 2011/07/25 00:38:53 schwarze Exp $
+.\"
.\" Copyright (c) 1990, 1991 The Regents of the University of California.
.\" All rights reserved.
.\"
@@ -29,9 +31,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $OpenBSD: wmemset.3,v 1.2 2011/07/09 16:46:58 nicm Exp $
-.\"
-.Dd $Mdocdate: July 9 2011 $
+.Dd $Mdocdate: July 25 2011 $
.Dt WMEMSET 3
.Os
.Sh NAME
@@ -55,6 +55,8 @@ The
.Fn wmemset
function returns the original value of
.Fa s .
+.Sh SEE ALSO
+.Xr memset 3
.Sh STANDARDS
The
.Fn wmemset
@@ -62,3 +64,10 @@ function conforms to
.St -isoC-99
and was first introduced in
.St -isoC-amd1 .
+.Sh HISTORY
+The
+.Fn wmemset
+function was ported from
+.Nx
+and first appeared in
+.Ox 3.8 .