1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\" References consulted:
6 .\" GNU glibc-2 source code and manual
8 .TH STRNLEN 3 2021-03-22 "Linux man-pages (unreleased)" "Linux Programmer's Manual"
10 strnlen \- determine the length of a fixed-size string
13 .RI ( libc ", " \-lc )
16 .B #include <string.h>
18 .BI "size_t strnlen(const char *" s ", size_t " maxlen );
22 Feature Test Macro Requirements for glibc (see
23 .BR feature_test_macros (7)):
29 _POSIX_C_SOURCE >= 200809L
36 function returns the number of bytes in the string
39 excluding the terminating null byte (\(aq\e0\(aq),
44 looks only at the first
46 characters in the string pointed to by
59 if there is no null terminating (\(aq\e0\(aq) among the first
61 characters pointed to by
64 For an explanation of the terms used in this section, see
72 Interface Attribute Value
75 T} Thread safety MT-Safe