Loading...
--- Libc/Libc-498/string/FreeBSD/memchr.3
+++ Libc/Libc-763.12/string/FreeBSD/memchr.3
@@ -13,10 +13,6 @@
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
-.\" 3. All advertising materials mentioning features or use of this software
-.\" must display the following acknowledgement:
-.\" This product includes software developed by the University of
-.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
@@ -34,9 +30,9 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)memchr.3 8.1 (Berkeley) 6/4/93
-.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.7 2001/10/01 16:09:00 ru Exp $
+.\" $FreeBSD: src/lib/libc/string/memchr.3,v 1.12 2009/04/23 08:37:56 brueffer Exp $
.\"
-.Dd June 4, 1993
+.Dd April 9, 2008
.Dt MEMCHR 3
.Os
.Sh NAME
@@ -48,6 +44,8 @@
.In string.h
.Ft void *
.Fn memchr "const void *b" "int c" "size_t len"
+.Ft void *
+.Fn memrchr "const void *b" "int c" "size_t len"
.Sh DESCRIPTION
The
.Fn memchr
@@ -57,15 +55,27 @@
(converted to an unsigned char)
in string
.Fa b .
+.Pp
+The
+.Fn memrchr
+function behaves like
+.Fn memchr ,
+except that it locates the last occurrence of
+.Fa c
+in string
+.Fa b .
.Sh RETURN VALUES
The
.Fn memchr
-function
-returns a pointer to the byte located,
+and
+.Fn memrchr
+functions
+return a pointer to the byte located,
or NULL if no such byte exists within
.Fa len
bytes.
.Sh SEE ALSO
+.Xr memmem 3 ,
.Xr strchr 3 ,
.Xr strcspn 3 ,
.Xr strpbrk 3 ,
@@ -73,10 +83,23 @@
.Xr strsep 3 ,
.Xr strspn 3 ,
.Xr strstr 3 ,
-.Xr strtok 3
+.Xr strtok 3 ,
+.Xr wmemchr 3
.Sh STANDARDS
The
.Fn memchr
function
conforms to
.St -isoC .
+.Pp
+The
+.Fn memrchr
+function is a GNU extension and conforms to no standard.
+.Sh HISTORY
+The
+.Fn memrchr
+function first appeared in GNU libc 2.1.91, this implementation
+first appeared in
+.Fx 6.4 ,
+coming from
+.Ox 4.3 .