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 2016-03-15 "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)):
34 _POSIX_C_SOURCE\ >=\ 200809L
44 function returns the number of bytes in the string
47 excluding the terminating null byte (\(aq\\0\(aq),
52 looks only at the first
54 characters in the string pointed to by
67 if there is no null terminating (\(aq\\0\(aq) among the first
69 characters pointed to by
72 For an explanation of the terms used in this section, see
78 Interface Attribute Value
81 T} Thread safety MT-Safe