]>
git.proxmox.com Git - wasi-libc.git/blob - libc-top-half/musl/src/time/getdate.c
2 #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
11 struct tm
*getdate(const char *s
)
13 static struct tm tmbuf
;
15 char *datemsk
= getenv("DATEMSK");
20 #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
21 pthread_setcancelstate(PTHREAD_CANCEL_DEFERRED
, &cs
);
29 f
= fopen(datemsk
, "rbe");
31 if (errno
== ENOMEM
) getdate_err
= 6;
36 while (fgets(fmt
, sizeof fmt
, f
)) {
37 p
= strptime(s
, fmt
, &tmbuf
);
44 if (ferror(f
)) getdate_err
= 5;
48 #if defined(__wasilibc_unmodified_upstream) || defined(_REENTRANT)
49 pthread_setcancelstate(cs
, 0);