]> git.ipfire.org Git - thirdparty/man-pages.git/blame - man3/wcsdup.3
dist.mk, All pages: .TH: Generate date at 'make dist'
[thirdparty/man-pages.git] / man3 / wcsdup.3
CommitLineData
fea681da
MK
1.\" Copyright (c) Bruno Haible <haible@clisp.cons.org>
2.\"
e4a74ca8 3.\" SPDX-License-Identifier: GPL-2.0-or-later
fea681da
MK
4.\"
5.\" References consulted:
6.\" GNU glibc-2 source code and manual
7.\" Dinkumware C library reference http://www.dinkumware.com/
008f1ecc 8.\" OpenGroup's Single UNIX specification http://www.UNIX-systems.org/online.html
fea681da 9.\"
ab47278f 10.TH WCSDUP 3 (date) "Linux man-pages (unreleased)"
fea681da
MK
11.SH NAME
12wcsdup \- duplicate a wide-character string
2d42354f
AC
13.SH LIBRARY
14Standard C library
8fc3b2cf 15.RI ( libc ", " \-lc )
fea681da
MK
16.SH SYNOPSIS
17.nf
fea681da 18.B #include <wchar.h>
68e4db0a 19.PP
fea681da
MK
20.BI "wchar_t *wcsdup(const wchar_t *" s );
21.fi
68e4db0a 22.PP
d39ad78f 23.RS -4
d6a4140d
MK
24Feature Test Macro Requirements for glibc (see
25.BR feature_test_macros (7)):
d39ad78f 26.RE
68e4db0a 27.PP
d6a4140d 28.BR wcsdup ():
9d2adbae
MK
29.nf
30 Since glibc 2.10:
5c10d2c5 31 _POSIX_C_SOURCE >= 200809L
9d2adbae
MK
32 Before glibc 2.10:
33 _GNU_SOURCE
34.fi
fea681da 35.SH DESCRIPTION
60a90ecd
MK
36The
37.BR wcsdup ()
38function is the wide-character equivalent
39of the
40.BR strdup (3)
41function.
c13182ef 42It allocates and returns a new wide-character string whose initial
40aa0db0
MK
43contents is a duplicate of the wide-character string pointed to by
44.IR s .
fea681da 45.PP
c13182ef 46Memory for the new wide-character string is
60a90ecd
MK
47obtained with
48.BR malloc (3),
60d38add 49and should be freed with
60a90ecd 50.BR free (3).
47297adb 51.SH RETURN VALUE
572acb41 52On success,
60a90ecd 53.BR wcsdup ()
572acb41 54returns a pointer to the new wide-character string.
a150608c 55On error, it returns NULL, with
572acb41 56.I errno
855d489a 57set to indicate the error.
fea681da
MK
58.SH ERRORS
59.TP
60.B ENOMEM
61Insufficient memory available to allocate duplicate string.
76548b21
MS
62.SH ATTRIBUTES
63For an explanation of the terms used in this section, see
64.BR attributes (7).
c466875e
MK
65.ad l
66.nh
76548b21
MS
67.TS
68allbox;
c466875e 69lbx lb lb
76548b21
MS
70l l l.
71Interface Attribute Value
72T{
73.BR wcsdup ()
74T} Thread safety MT-Safe
75.TE
c466875e
MK
76.hy
77.ad
847e0d88 78.sp 1
3113c7f3 79.SH STANDARDS
59414d48
MK
80POSIX.1-2008.
81This function is not specified in POSIX.1-2001,
82and is not widely available on other systems.
fea681da 83.\" present in libc5 and glibc 2.0 and later
47297adb 84.SH SEE ALSO
fea681da 85.BR strdup (3),
0a4f8b7b 86.BR wcscpy (3)