1wcsdup(3)                  Library Functions Manual                  wcsdup(3)
2
3
4

NAME

6       wcsdup - duplicate a wide-character string
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <wchar.h>
13
14       wchar_t *wcsdup(const wchar_t *s);
15
16   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
17
18       wcsdup():
19           Since glibc 2.10:
20               _POSIX_C_SOURCE >= 200809L
21           Before glibc 2.10:
22               _GNU_SOURCE
23

DESCRIPTION

25       The wcsdup() function is the wide-character equivalent of the strdup(3)
26       function.  It allocates and returns a new wide-character  string  whose
27       initial contents is a duplicate of the wide-character string pointed to
28       by s.
29
30       Memory for the new wide-character string is  obtained  with  malloc(3),
31       and should be freed with free(3).
32

RETURN VALUE

34       On  success,  wcsdup()  returns  a  pointer  to  the new wide-character
35       string.  On error, it returns NULL, with errno set to indicate the  er‐
36       ror.
37

ERRORS

39       ENOMEM Insufficient memory available to allocate duplicate string.
40

ATTRIBUTES

42       For  an  explanation  of  the  terms  used  in  this  section,  see at‐
43       tributes(7).
44
45       ┌────────────────────────────────────────────┬───────────────┬─────────┐
46Interface                                   Attribute     Value   
47       ├────────────────────────────────────────────┼───────────────┼─────────┤
48wcsdup()                                    │ Thread safety │ MT-Safe │
49       └────────────────────────────────────────────┴───────────────┴─────────┘
50

STANDARDS

52       POSIX.1-2008.
53

HISTORY

55       libc5, glibc 2.0.
56

SEE ALSO

58       strdup(3), wcscpy(3)
59
60
61
62Linux man-pages 6.04              2023-03-30                         wcsdup(3)
Impressum