#include <wchar.h> size_t mbsnrtowcs(wchar_t *dest, const char **src, size_t nms, size_t len, mbstate_t *ps);
Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
If dest is not NULL, the mbsnrtowcs() function converts at most nms bytes from the multibyte string *src to a wide-character string starting at dest. At most len wide characters are written to dest. The shift state *ps is updated. The conversion is effectively performed by repeatedly calling mbrtowc(dest, *src, n, ps) where n is some positive number, as long as this call succeeds, and then incrementing dest by one and *src by the number of bytes consumed. The conversion can stop for three reasons:
If dest is NULL, len is ignored, and the conversion proceeds as above, except that the converted wide characters are not written out to memory, and that no destination length limit exists.
In both of the above cases, if ps is NULL, a static anonymous state known only to the mbsnrtowcs() function is used instead.
|mbsnrtowcs()||Thread safety||MT-Unsafe race:mbsnrtowcs/!ps|