WCSDUP(3C) Standard C Library Functions WCSDUP(3C)

wcsdupduplicate wide-character string

#include <wchar.h>

wchar_t
wcsdup(const wchar_t *string);

The () 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:

Insufficient memory was available to create the copy.

.

.

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”).

November 4, 2014 OmniOS