Cygwin: mmap: allow remapping part of an existing anonymous mapping
[newlib-cygwin.git] / newlib / libc / time / asctime_r.c
blob3e0864fc8f2c472cf320d26d862218b061f20fcf
1 /*
2 * asctime_r.c
3 */
5 #include <stdio.h>
6 #include <time.h>
8 char *
9 asctime_r (const struct tm *__restrict tim_p,
10 char *__restrict result)
12 static const char day_name[7][3] = {
13 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"
15 static const char mon_name[12][3] = {
16 "Jan", "Feb", "Mar", "Apr", "May", "Jun",
17 "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
20 siprintf (result, "%.3s %.3s%3d %.2d:%.2d:%.2d %d\n",
21 day_name[tim_p->tm_wday],
22 mon_name[tim_p->tm_mon],
23 tim_p->tm_mday, tim_p->tm_hour, tim_p->tm_min,
24 tim_p->tm_sec, 1900 + tim_p->tm_year);
25 return result;