share/mk/: Fix includes
[man-pages.git] / man3 / wcsncpy.3
bloba42f17270c2fbbf72e1f9330ec6fd3ad1dd9db80
1 '\" t
2 .\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
3 .\"
4 .\" SPDX-License-Identifier: GPL-2.0-or-later
5 .\"
6 .\" References consulted:
7 .\"   GNU glibc-2 source code and manual
8 .\"   Dinkumware C library reference http://www.dinkumware.com/
9 .\"   OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
10 .\"   ISO/IEC 9899:1999
11 .\"
12 .TH wcsncpy 3 (date) "Linux man-pages (unreleased)"
13 .SH NAME
14 wcsncpy \- copy a fixed-size string of wide characters
15 .SH LIBRARY
16 Standard C library
17 .RI ( libc ", " \-lc )
18 .SH SYNOPSIS
19 .nf
20 .B #include <wchar.h>
22 .BI "wchar_t *wcsncpy(wchar_t " dest "[restrict ." n ],
23 .BI "                 const wchar_t " src "[restrict ." n ],
24 .BI "                 size_t " n );
25 .fi
26 .SH DESCRIPTION
27 The
28 .BR wcsncpy ()
29 function is the wide-character equivalent of the
30 .BR strncpy (3)
31 function.
32 It copies at most
33 .I n
34 wide characters from the wide-character
35 string pointed to by
36 .IR src ,
37 including the terminating null wide character (L\[aq]\e0\[aq]),
38 to the array pointed to by
39 .IR dest .
40 Exactly
41 .I n
42 wide characters are
43 written at
44 .IR dest .
45 If the length \fIwcslen(src)\fP is smaller than
46 .IR n ,
47 the remaining wide characters in the array
48 pointed to by
49 .I dest
50 are filled
51 with null wide characters.
52 If the length \fIwcslen(src)\fP is greater than or equal
54 .IR n ,
55 the string pointed to by
56 .I dest
57 will not be terminated by a null wide character.
59 The strings may not overlap.
61 The programmer must ensure that there is room for at least
62 .I n
63 wide
64 characters at
65 .IR dest .
66 .SH RETURN VALUE
67 .BR wcsncpy ()
68 returns
69 .IR dest .
70 .SH ATTRIBUTES
71 For an explanation of the terms used in this section, see
72 .BR attributes (7).
73 .TS
74 allbox;
75 lbx lb lb
76 l l l.
77 Interface       Attribute       Value
79 .na
80 .nh
81 .BR wcsncpy ()
82 T}      Thread safety   MT-Safe
83 .TE
84 .SH STANDARDS
85 C11, POSIX.1-2008.
86 .SH HISTORY
87 POSIX.1-2001, C99.
88 .SH SEE ALSO
89 .BR strncpy (3)