Debian Codegraph @

upstream/debian-trixie/man3/wcsdup.3

raw
1 '\" t
2 .\" Copyright (c) Bruno Haible <[email protected]>
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 .\"
11 .TH wcsdup 3 2024-05-02 "Linux man-pages 6.9.1"
12 .SH NAME
13 wcsdup \- duplicate a wide-character string
14 .SH LIBRARY
15 Standard C library
16 .RI ( libc ", " \-lc )
17 .SH SYNOPSIS
18 .nf
19 .B #include <wchar.h>
20 .P
21 .BI "wchar_t *wcsdup(const wchar_t *" s );
22 .fi
23 .P
24 .RS -4
25 Feature Test Macro Requirements for glibc (see
26 .BR feature_test_macros (7)):
27 .RE
28 .P
29 .BR wcsdup ():
30 .nf
31 Since glibc 2.10:
32 _POSIX_C_SOURCE >= 200809L
33 Before glibc 2.10:
34 _GNU_SOURCE
35 .fi
36 .SH DESCRIPTION
37 The
38 .BR wcsdup ()
39 function is the wide-character equivalent
40 of the
41 .BR strdup (3)
42 function.
43 It allocates and returns a new wide-character string whose initial
44 contents is a duplicate of the wide-character string pointed to by
45 .IR s .
46 .P
47 Memory for the new wide-character string is
48 obtained with
49 .BR malloc (3),
50 and should be freed with
51 .BR free (3).
52 .SH RETURN VALUE
53 On success,
54 .BR wcsdup ()
55 returns a pointer to the new wide-character string.
56 On error, it returns NULL, with
57 .I errno
58 set to indicate the error.
59 .SH ERRORS
60 .TP
61 .B ENOMEM
62 Insufficient memory available to allocate duplicate string.
63 .SH ATTRIBUTES
64 For an explanation of the terms used in this section, see
65 .BR attributes (7).
66 .TS
67 allbox;
68 lbx lb lb
69 l l l.
70 Interface Attribute Value
71 T{
72 .na
73 .nh
74 .BR wcsdup ()
75 T} Thread safety MT-Safe
76 .TE
77 .SH STANDARDS
78 POSIX.1-2008.
79 .SH HISTORY
80 libc5, glibc 2.0.
81 .SH SEE ALSO
82 .BR strdup (3),
83 .BR wcscpy (3)