mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Daniel Sabogal <dsabogalcc@gmail.com>
To: musl@lists.openwall.com
Subject: [PATCH] add missing *_unlocked and wcsftime_l prototypes to wchar.h
Date: Tue,  6 Sep 2016 17:09:38 -0400	[thread overview]
Message-ID: <20160906210939.32637-1-dsabogalcc@gmail.com> (raw)

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



             reply	other threads:[~2016-09-06 21:09 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-06 21:09 Daniel Sabogal [this message]
2016-09-06 21:09 ` Daniel Sabogal
2016-09-09 23:02   ` Rich Felker
2016-09-10  0:42     ` Daniel Sabogal
2016-09-10  1:01       ` Rich Felker
2016-09-10  1:23         ` Daniel Sabogal
2016-09-16 22:19           ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160906210939.32637-1-dsabogalcc@gmail.com \
    --to=dsabogalcc@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).