1WCSNLEN(3)                 Linux Programmer's Manual                WCSNLEN(3)
2
3
4

NAME

6       wcsnlen - determine the length of a fixed-size wide-character string
7

SYNOPSIS

9       #include <wchar.h>
10
11       size_t wcsnlen(const wchar_t *s, size_t maxlen);
12
13   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15       wcsnlen():
16           Since glibc 2.10:
17               _POSIX_C_SOURCE >= 200809L
18           Before glibc 2.10:
19               _GNU_SOURCE
20

DESCRIPTION

22       The   wcsnlen()  function  is  the  wide-character  equivalent  of  the
23       strnlen(3) function.  It returns the number of wide-characters  in  the
24       string pointed to by s, not including the terminating null wide charac‐
25       ter (L'\0'), but at most maxlen wide characters (note:  this  parameter
26       is not a byte count).  In doing this, wcsnlen() looks at only the first
27       maxlen wide characters at s and never beyond s+maxlen.
28

RETURN VALUE

30       The wcsnlen() function returns wcslen(s), if that is less than  maxlen,
31       or  maxlen  if  there  is no null wide character among the first maxlen
32       wide characters pointed to by s.
33

VERSIONS

35       The wcsnlen() function is provided in glibc since version 2.1.
36

ATTRIBUTES

38       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
39       tributes(7).
40
41       ┌──────────┬───────────────┬─────────┐
42Interface Attribute     Value   
43       ├──────────┼───────────────┼─────────┤
44wcsnlen() │ Thread safety │ MT-Safe │
45       └──────────┴───────────────┴─────────┘

CONFORMING TO

47       POSIX.1-2008.
48

SEE ALSO

50       strnlen(3), wcslen(3)
51

COLOPHON

53       This  page  is  part of release 5.10 of the Linux man-pages project.  A
54       description of the project, information about reporting bugs,  and  the
55       latest     version     of     this    page,    can    be    found    at
56       https://www.kernel.org/doc/man-pages/.
57
58
59
60GNU                               2019-03-06                        WCSNLEN(3)
Impressum