Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160906210939.32637-1-dsabogalcc@gmail.com>
Date: Tue,  6 Sep 2016 17:09:38 -0400
From: Daniel Sabogal <dsabogalcc@...il.com>
To: musl@...ts.openwall.com
Subject: [PATCH] add missing *_unlocked and wcsftime_l prototypes to wchar.h

I noticed that musl does not provide prototypes for the unlocked variants of
wchar.h file I/O and wcsftime_l in <wchar.h>.

But musl does define and export these functions:

nm -g /usr/lib/libc.so | grep 'lock\|time_l' | grep wc
0000000000057210 T __fgetwc_unlocked
0000000000057c10 T __fputwc_unlocked
000000000006bbf0 T __wcsftime_l
0000000000057210 W fgetwc_unlocked
0000000000057c10 W fputwc_unlocked
0000000000057210 W getwc_unlocked
0000000000058f50 W getwchar_unlocked
0000000000057c10 W putwc_unlocked
0000000000059ca0 W putwchar_unlocked
000000000006bbf0 W wcsftime_l

These functions are available in glibc.

#define _GNU_SOURCE
#include <wchar.h>
int main(void)
{
        wint_t (*a0)(FILE *) = getwc_unlocked;
        wint_t (*a1)(void) = getwchar_unlocked;
        wint_t (*a2)(FILE *) = fgetwc_unlocked;
        wint_t (*a3)(wchar_t, FILE *) = fputwc_unlocked;
        wint_t (*a4)(wchar_t, FILE *) = putwc_unlocked;
        wint_t (*a5)(wchar_t) = putwchar_unlocked;
        wchar_t *(*a6)(wchar_t *restrict, int, FILE *restrict) = fgetws_unlocked;
        int (*a7)(const wchar_t *restrict, FILE *restrict) = fputws_unlocked;
        size_t (*b0)(wchar_t *restrict, size_t, const wchar_t *restrict, const struct tm *restrict, locale_t) = wcsftime_l;
}
-- 
2.10.0

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.