summaryrefslogtreecommitdiff
path: root/src/lib/libc/string/memchr.3
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libc/string/memchr.3')
-rw-r--r--src/lib/libc/string/memchr.325
1 files changed, 22 insertions, 3 deletions
diff --git a/src/lib/libc/string/memchr.3 b/src/lib/libc/string/memchr.3
index bab262964e..7ce07f8ea2 100644
--- a/src/lib/libc/string/memchr.3
+++ b/src/lib/libc/string/memchr.3
@@ -29,9 +29,9 @@
29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 29.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30.\" SUCH DAMAGE. 30.\" SUCH DAMAGE.
31.\" 31.\"
32.\" $OpenBSD: memchr.3,v 1.7 2007/05/31 19:19:32 jmc Exp $ 32.\" $OpenBSD: memchr.3,v 1.8 2007/09/03 14:36:40 millert Exp $
33.\" 33.\"
34.Dd $Mdocdate: May 31 2007 $ 34.Dd $Mdocdate: September 3 2007 $
35.Dt MEMCHR 3 35.Dt MEMCHR 3
36.Os 36.Os
37.Sh NAME 37.Sh NAME
@@ -41,6 +41,8 @@
41.Fd #include <string.h> 41.Fd #include <string.h>
42.Ft void * 42.Ft void *
43.Fn memchr "const void *b" "int c" "size_t len" 43.Fn memchr "const void *b" "int c" "size_t len"
44.Ft void *
45.Fn memrchr "const void *b" "int c" "size_t len"
44.Sh DESCRIPTION 46.Sh DESCRIPTION
45The 47The
46.Fn memchr 48.Fn memchr
@@ -50,10 +52,21 @@ function locates the first occurrence of
50.Li unsigned char ) 52.Li unsigned char )
51in string 53in string
52.Fa b . 54.Fa b .
55.Pp
56The
57.Fn memrchr
58function behaves like
59.Fn memchr ,
60except that it locates the last occurrence of
61.Fa c
62in string
63.Fa b .
53.Sh RETURN VALUES 64.Sh RETURN VALUES
54The 65The
55.Fn memchr 66.Fn memchr
56function returns a pointer to the byte located, or 67and
68.Fn memrchr
69functions return a pointer to the byte located, or
57.Dv NULL 70.Dv NULL
58if no such byte exists within 71if no such byte exists within
59.Fa len 72.Fa len
@@ -72,3 +85,9 @@ The
72.Fn memchr 85.Fn memchr
73function conforms to 86function conforms to
74.St -ansiC . 87.St -ansiC .
88.Pp
89The
90.Fn memrchr
91function is an
92.Ox
93extension.