]> git.ipfire.org Git - thirdparty/man-pages.git/blob - man3/wcsdup.3
wcsdup.3: RETURN VALUE: mention that 'errno' is set on error
[thirdparty/man-pages.git] / man3 / wcsdup.3
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 WCSDUP 3 2013-04-19 "GNU" "Linux Programmer's Manual"
16 .SH NAME
17 wcsdup \- duplicate a wide-character string
18 .SH SYNOPSIS
19 .nf
20 .B #include <wchar.h>
21 .sp
22 .BI "wchar_t *wcsdup(const wchar_t *" s );
23 .fi
24 .sp
25 .in -4n
26 Feature Test Macro Requirements for glibc (see
27 .BR feature_test_macros (7)):
28 .in
29 .sp
30 .BR wcsdup ():
31 .PD 0
32 .ad l
33 .RS 4
34 .TP 4
35 Since glibc 2.10:
36 _XOPEN_SOURCE\ >=\ 700 || _POSIX_C_SOURCE\ >=\ 200809L
37 .TP
38 Before glibc 2.10:
39 _GNU_SOURCE
40 .RE
41 .ad
42 .PD
43 .SH DESCRIPTION
44 The
45 .BR wcsdup ()
46 function is the wide-character equivalent
47 of the
48 .BR strdup (3)
49 function.
50 It allocates and returns a new wide-character string whose initial
51 contents is a duplicate of the wide-character string pointed to by \fIs\fP.
52 .PP
53 Memory for the new wide-character string is
54 obtained with
55 .BR malloc (3),
56 and should be freed with
57 .BR free (3).
58 .SH RETURN VALUE
59 On success,
60 .BR wcsdup ()
61 returns a pointer to the new wide-character string.
62 On error, it returns \-1, with
63 .I errno
64 set to indicate the cause of the error.
65 .SH ERRORS
66 .TP
67 .B ENOMEM
68 Insufficient memory available to allocate duplicate string.
69 .SH CONFORMING TO
70 POSIX.1-2008.
71 This function is not specified in POSIX.1-2001,
72 and is not widely available on other systems.
73 .\" present in libc5 and glibc 2.0 and later
74 .SH SEE ALSO
75 .BR strdup (3),
76 .BR wcscpy (3)