share/mk/: Fix includes
[man-pages.git] / man3 / strlen.3
blob6d759bd789a41f9f119d617a036507d525f15ff5
1 '\" t
2 .\" Copyright 1993 David Metcalfe (david@prism.demon.co.uk)
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .\" References consulted:
7 .\"     Linux libc source code
8 .\"     Lewine's _POSIX Programmer's Guide_ (O'Reilly & Associates, 1991)
9 .\"     386BSD man pages
10 .\" Modified Sat Jul 24 18:02:26 1993 by Rik Faith (faith@cs.unc.edu)
11 .TH strlen 3 (date) "Linux man-pages (unreleased)"
12 .SH NAME
13 strlen \- calculate the length of a string
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <string.h>
21 .BI "size_t strlen(const char *" s );
22 .fi
23 .SH DESCRIPTION
24 The
25 .BR strlen ()
26 function calculates the length of the string pointed to by
27 .IR s ,
28 excluding the terminating null byte (\[aq]\e0\[aq]).
29 .SH RETURN VALUE
30 The
31 .BR strlen ()
32 function returns the number of bytes in the string pointed to by
33 .IR s .
34 .SH ATTRIBUTES
35 For an explanation of the terms used in this section, see
36 .BR attributes (7).
37 .TS
38 allbox;
39 lbx lb lb
40 l l l.
41 Interface       Attribute       Value
43 .na
44 .nh
45 .BR strlen ()
46 T}      Thread safety   MT-Safe
47 .TE
48 .SH STANDARDS
49 C11, POSIX.1-2008.
50 .SH HISTORY
51 POSIX.1-2001, C89, SVr4, 4.3BSD.
52 .SH NOTES
53 In cases where the input buffer may not contain
54 a terminating null byte,
55 .BR strnlen (3)
56 should be used instead.
57 .SH SEE ALSO
58 .BR string (3),
59 .BR strnlen (3),
60 .BR wcslen (3),
61 .BR wcsnlen (3)