1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" %%%LICENSE_START(GPLv2+_DOC_ONEPARA)
4 .\" This is free documentation; you can redistribute it and/or
5 .\" modify it under the terms of the GNU General Public License as
6 .\" published by the Free Software Foundation; either version 2 of
7 .\" the License, or (at your option) any later version.
10 .\" References consulted:
11 .\" GNU glibc-2 source code and manual
13 .TH STRNLEN 3 2020-12-21 "GNU" "Linux Programmer's Manual"
15 strnlen \- determine the length of a fixed-size string
18 .B #include <string.h>
20 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
24 Feature Test Macro Requirements for glibc (see
25 .BR feature_test_macros (7)):
31 _POSIX_C_SOURCE >= 200809L
38 function returns the number of bytes in the string
41 excluding the terminating null byte (\(aq\e0\(aq),
46 looks only at the first
48 characters in the string pointed to by
61 if there is no null terminating (\(aq\e0\(aq) among the first
63 characters pointed to by
66 For an explanation of the terms used in this section, see
74 Interface Attribute Value
77 T} Thread safety MT-Safe