WCSDUP(3C) Standard C Library Functions WCSDUP(3C)
wcsdup - duplicate wide-character string
#include <wchar.h>
wchar_t *
wcsdup(const wchar_t *string);
The wcsdup() function duplicates a wide-character string, allocating
sufficient memory to store the copy, and then copying from string. The
resulting copy is returned. It may be deallocated with free(3C) when
it is no longer needed. The wcsdup() function is the wide-character
equivalent of strdup(3C).
On success, the function wcsdup() returns the newly allocated copy of
the string; on failure it returns NULL and sets errno.
The wcsdup() function will fail if:
ENOMEM Insufficient memory was available to create the
copy.
Standard.
MT-LEVEL
MT-Safe.
free(3C), strdup(3C), wcslen(3C), wchar.h(3HEAD), locale(7),
standards(7)
The wcsdup() function was introduced in IEEE Std 1003.1-2008
("POSIX.1").
illumos November 4, 2014 illumos
NAME
wcsdup - duplicate wide-character string
SYNOPSIS
#include <wchar.h>
wchar_t *
wcsdup(const wchar_t *string);
DESCRIPTION
The wcsdup() function duplicates a wide-character string, allocating
sufficient memory to store the copy, and then copying from string. The
resulting copy is returned. It may be deallocated with free(3C) when
it is no longer needed. The wcsdup() function is the wide-character
equivalent of strdup(3C).
RETURN VALUES
On success, the function wcsdup() returns the newly allocated copy of
the string; on failure it returns NULL and sets errno.
ERRORS
The wcsdup() function will fail if:
ENOMEM Insufficient memory was available to create the
copy.
INTERFACE STABILITY
Standard.
MT-LEVEL
MT-Safe.
SEE ALSO
free(3C), strdup(3C), wcslen(3C), wchar.h(3HEAD), locale(7),
standards(7)
STANDARDS
The wcsdup() function was introduced in IEEE Std 1003.1-2008
("POSIX.1").
illumos November 4, 2014 illumos