mount_setattr.2: Minor tweaks to Christian's patch
[man-pages.git] / man3 / wcsnlen.3
blob87f0e999fdfc91601c4fff373dfb0fd3959f944f
1 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2 .\"
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.
8 .\" %%%LICENSE_END
9 .\"
10 .\" References consulted:
11 .\"   GNU glibc-2 source code and manual
12 .\"   Dinkumware C library reference http://www.dinkumware.com/
13 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
14 .\"
15 .TH WCSNLEN 3  2021-03-22 "GNU" "Linux Programmer's Manual"
16 .SH NAME
17 wcsnlen \- determine the length of a fixed-size wide-character string
18 .SH SYNOPSIS
19 .nf
20 .B #include <wchar.h>
21 .PP
22 .BI "size_t wcsnlen(const wchar_t *" s ", size_t " maxlen );
23 .fi
24 .PP
25 .RS -4
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .RE
29 .PP
30 .BR wcsnlen ():
31 .nf
32     Since glibc 2.10:
33         _POSIX_C_SOURCE >= 200809L
34     Before glibc 2.10:
35         _GNU_SOURCE
36 .fi
37 .SH DESCRIPTION
38 The
39 .BR wcsnlen ()
40 function is the wide-character equivalent
41 of the
42 .BR strnlen (3)
43 function.
44 It returns the number of wide-characters in the string pointed to by
45 .IR s ,
46 not including the terminating null wide character (L\(aq\e0\(aq),
47 but at most
48 .I maxlen
49 wide characters (note: this parameter is not a byte count).
50 In doing this,
51 .BR wcsnlen ()
52 looks at only the first
53 .I maxlen
54 wide characters at
55 .I s
56 and never beyond
57 .IR s+maxlen .
58 .SH RETURN VALUE
59 The
60 .BR wcsnlen ()
61 function returns
62 .IR wcslen(s) ,
63 if that is less than
64 .IR maxlen ,
66 .I maxlen
67 if there is no null wide character among the
68 first
69 .I maxlen
70 wide characters pointed to by
71 .IR s .
72 .SH VERSIONS
73 The
74 .BR wcsnlen ()
75 function is provided in glibc since version 2.1.
76 .SH ATTRIBUTES
77 For an explanation of the terms used in this section, see
78 .BR attributes (7).
79 .ad l
80 .nh
81 .TS
82 allbox;
83 lbx lb lb
84 l l l.
85 Interface       Attribute       Value
87 .BR wcsnlen ()
88 T}      Thread safety   MT-Safe
89 .TE
90 .hy
91 .ad
92 .sp 1
93 .SH CONFORMING TO
94 POSIX.1-2008.
95 .SH SEE ALSO
96 .BR strnlen (3),
97 .BR wcslen (3)