- if (s == NULL) {
- s = buf;
- wc = L'\0';
- }
- sputrune(wc, s, MB_CUR_MAX, &e);
- if (e == NULL) {
- errno = EILSEQ;
- return ((size_t)-1);
- }
- return ((size_t)(e - s));
+size_t
+wcrtomb(char * __restrict s, wchar_t wc, mbstate_t * __restrict ps)
+{
+ return wcrtomb_l(s, wc, ps, __current_locale());