1WCSDUP(3) Linux Programmer's Manual WCSDUP(3)
2
3
4
6 wcsdup - duplicate a wide-character string
7
9 #include <wchar.h>
10
11 wchar_t *wcsdup(const wchar_t *s);
12
13 Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
14
15 wcsdup():
16 Since glibc 2.10:
17 _POSIX_C_SOURCE >= 200809L
18 Before glibc 2.10:
19 _GNU_SOURCE
20
22 The wcsdup() function is the wide-character equivalent of the strdup(3)
23 function. It allocates and returns a new wide-character string whose
24 initial contents is a duplicate of the wide-character string pointed to
25 by s.
26
27 Memory for the new wide-character string is obtained with malloc(3),
28 and should be freed with free(3).
29
31 On success, wcsdup() returns a pointer to the new wide-character
32 string. On error, it returns NULL, with errno set to indicate the
33 cause of the error.
34
36 ENOMEM Insufficient memory available to allocate duplicate string.
37
39 For an explanation of the terms used in this section, see
40 attributes(7).
41
42 ┌──────────┬───────────────┬─────────┐
43 │Interface │ Attribute │ Value │
44 ├──────────┼───────────────┼─────────┤
45 │wcsdup() │ Thread safety │ MT-Safe │
46 └──────────┴───────────────┴─────────┘
47
49 POSIX.1-2008. This function is not specified in POSIX.1-2001, and is
50 not widely available on other systems.
51
53 strdup(3), wcscpy(3)
54
56 This page is part of release 5.07 of the Linux man-pages project. A
57 description of the project, information about reporting bugs, and the
58 latest version of this page, can be found at
59 https://www.kernel.org/doc/man-pages/.
60
61
62
63GNU 2017-09-15 WCSDUP(3)