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 2014-02-25 "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 _XOPEN_SOURCE\ >=\ 700 || _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
67 if there is no null byte (\(aq\\0\(aq) among the first
72 .SS Multithreading (see pthreads(7))
75 function is thread-safe.