xref: /openbsd/share/man/man9/strcmp.9 (revision 4bdff4be)
1.\"	$OpenBSD: strcmp.9,v 1.2 2018/04/23 11:11:38 jmc Exp $
2.\"
3.\" Copyright (c) 2002, 2003 CubeSoft Communications, Inc.
4.\" <http://www.csoft.org>
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24.\" IN ANY WAY OUT OF THE USE OF THIS SOFTWARE EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: April 23 2018 $
28.Dt STRCMP 9
29.Os
30.Sh NAME
31.Nm strlen ,
32.Nm strnlen ,
33.Nm strncpy ,
34.Nm strlcpy ,
35.Nm strlcat ,
36.Nm strcmp ,
37.Nm strncmp ,
38.Nm strncasecmp
39.Nd kernel library string routines
40.Sh SYNOPSIS
41.In lib/libkern/libkern.h
42.Ft size_t
43.Fn strlen "const char *s"
44.Ft size_t
45.Fn strnlen "const char *s" "size_t maxlen"
46.Ft char *
47.Fn strncpy "char *dst" "const char *src" "size_t len"
48.Ft size_t
49.Fn strlcpy "char *dst" "const char *src" "size_t size"
50.Ft size_t
51.Fn strlcat "char *dst" "const char *src" "size_t size"
52.Ft int
53.Fn strcmp "const char *s1" "const char *s2"
54.Ft int
55.Fn strncmp "const char *s1" "const char *s2" "size_t len"
56.Ft int
57.Fn strncasecmp "const char *s1" "const char *s2" "size_tlen"
58.Sh DESCRIPTION
59These functions have the same semantics as their libc counterparts,
60.Xr strlen 3 ,
61.Xr strncpy 3 ,
62.Xr strnlen 3 ,
63.Xr strlcpy 3 ,
64.Xr strlcat 3 ,
65.Xr strcmp 3 ,
66.Xr strncmp 3
67and
68.Xr strncasecmp 3 .
69.Sh SEE ALSO
70.Xr strcmp 3 ,
71.Xr strlcat 3 ,
72.Xr strlcpy 3 ,
73.Xr strlen 3 ,
74.Xr strncmp 3 ,
75.Xr strncpy 3 ,
76.Xr strnlen 3
77.Sh STANDARDS
78The
79.Fn strlen ,
80.Fn strncpy ,
81.Fn strcmp ,
82.Fn strncmp
83and
84.Fn strcasecmp
85functions conform to
86.St -ansiC .
87