2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
6 .\" References consulted:
7 .\" GNU glibc-2 source code and manual
9 .TH strnlen 3 (date) "Linux man-pages (unreleased)"
11 strnlen \- determine the length of a fixed-size string
14 .RI ( libc ", " \-lc )
17 .B #include <string.h>
19 .BI "size_t strnlen(const char " s [. maxlen "], size_t " maxlen );
23 Feature Test Macro Requirements for glibc (see
24 .BR feature_test_macros (7)):
30 _POSIX_C_SOURCE >= 200809L
37 function returns the number of bytes in the string
40 excluding the terminating null byte (\[aq]\e0\[aq]),
45 looks only at the first
47 characters in the string pointed to by
60 if there is no null terminating (\[aq]\e0\[aq]) among the first
62 characters pointed to by
65 For an explanation of the terms used in this section, see
73 Interface Attribute Value
76 T} Thread safety MT-Safe