user: implement mlibc as the libc, finally.

It's finally done..

Signed-off-by: kaguya <vpshinomiya@protonmail.com>
This commit is contained in:
kaguya
2026-05-02 03:31:49 -04:00
parent 2fa39ad85a
commit 9a9b91c940
2387 changed files with 152741 additions and 315 deletions
+27
View File
@@ -0,0 +1,27 @@
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
extern int daylight;
extern long timezone;
extern char *tzname[2];
int main() {
tzset();
printf("%s %s %ld %d\n", tzname[0], tzname[1], timezone, daylight);
time_t sometime_in_summer_in_the_north = 1752019200;
struct tm *local = localtime(&sometime_in_summer_in_the_north);
// Print the current timezone offset from UTC in seconds, considering DST
if (local) {
long offset = local->tm_gmtoff;
int hours = offset / 3600;
int minutes = (offset % 3600) / 60;
printf("UTC offset: %0d:%02d\n", hours, abs(minutes));
} else {
printf("localtime returned NULL\n");
}
return 0;
}