Compare commits

..

33 Commits

Author SHA1 Message Date
Jonas 'Sortie' Termansen aacec27864 fixup! Add strptime(3). 2023-03-21 23:57:19 +01:00
Jonas 'Sortie' Termansen d2c98889bd Aurora procedural wallpaper. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 632b3ba422 Work around pty deadlock. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen d222003590 Add cdrom mounting live environment. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 99c71085f8 Parallelize driver initialization. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen f42e81e99d Speed up ata(4) 400 ns waits.
Waiting for any non-zero duration currently waits for at least one timer
cycle (10 ms), which is especially expensive during early boot.

The current workaround of simply reading the status 14 times seems really
suspicious although the osdev wiki documents it, but let's see how well it
works on real hardware, it's probably good enough.

Try to determine the initial selected drive to save one drive selection.
2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen bf5a85c1c4 Decrease PS/2 timeouts. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 77a373281e Add uptime(1) -pr options. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 803d46e913 Add iso9660 filesystem implementation. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 5f1e478ab6 Add kernel virtual address space usage debug information. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 77873003be Revert "Update to bison-3.8.2."
This reverts commit b82fae810b42c5426d21c4dc153b32f086dd7fde.
2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 8de7d4c1a2 Update to bison-3.8.2. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen e4171ecc72 Debug TCP socket state listing. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen e3df9c65cc Add kernel heap allocation tracing debug facility. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen db69fcc491 Add m4, perl, and texinfo to the basic ports set. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen ca80135bb1 Trianglix 4. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 3ba6e00e6c Add tix-check(8). 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 7e9d36d3a1 Add automatic installer and upgrader. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen 5a28384a9e Volatile release. 2023-03-19 21:56:55 +01:00
Jonas 'Sortie' Termansen a1715426af Add tix-upgrade(8). 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen a4d43b1342 Add display server. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 551043a5d5 Add pty(1). 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 26bc45490a Revert "Debug system calls exiting without interrupts enabled."
This reverts commit c0bc774c9aa8aa3834f40afc7ad5aa909afc61a1.
2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 0137e4f0c3 Debug system calls exiting without interrupts enabled. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 640f3f7ff8 Add signify port. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 7ebce1c6a9 Add irc(1).
Co-authored-by: Juhani Krekelä <juhani@krekelä.fi>
2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 5abac315c8 Add getaddrinfo(1). 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen c457b1cb86 Add host(1). 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen d8a1c7565c Add nginx port. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 86f9f9f080 Enable stack smash protection by default. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 2c0f03b7f9 Enable undefined behavior sanitization by default. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 07efe17313 Add ntpd port. 2023-03-19 21:56:54 +01:00
Jonas 'Sortie' Termansen 8c824d3caa Add strptime(3). 2023-03-19 21:56:54 +01:00
1 changed files with 80 additions and 0 deletions

View File

@ -24,6 +24,11 @@
#include <string.h>
#include <time.h>
#ifdef TEST
#include <stdio.h>
#define strptime mystrptime
#endif
static const char* wdays[] = {"Sunday", "Monday", "Tuesday", "Wednesday",
"Thursday", "Friday", "Saturday", NULL};
static const char* months[] = {"January", "February", "March", "April", "May",
@ -232,3 +237,78 @@ char* strptime(const char* restrict str,
}
return (char*) str;
}
#ifdef TEST
#undef strptime
#include <err.h>
#include <stdio.h>
int main(int argc, char* argv[])
{
if ( argc < 3 )
err(1, "usage");
const char* str = argv[1];
const char* format = argv[2];
struct tm my_tm = {0};
char* my_end = mystrptime(str, format, &my_tm);
struct tm c_tm = {0};
char* c_end = strptime(str, format, &c_tm);
if ( !my_end && c_end )
errx(1, "rejected but c allowed it");
else if ( !my_end )
errx(1, "rejected correctly");
else if ( !c_end )
printf("allowed but c rejected\n");
else if ( my_end != c_end )
errx(1, "mismatch my end \"%s\" vs c end \"%s\"", my_end, c_end);
if ( my_tm.tm_sec == c_tm.tm_sec )
printf("tm_sec=%i\n", my_tm.tm_sec);
else
printf("tm_sec=%i but C is %i\n", my_tm.tm_sec, c_tm.tm_sec);
if ( my_tm.tm_min == c_tm.tm_min )
printf("tm_min=%i\n", my_tm.tm_min);
else
printf("tm_min=%i but C is %i\n", my_tm.tm_min, c_tm.tm_min);
if ( my_tm.tm_hour == c_tm.tm_hour )
printf("tm_hour=%i\n", my_tm.tm_hour);
else
printf("tm_hour=%i but C is %i\n", my_tm.tm_hour, c_tm.tm_hour);
if ( my_tm.tm_mday == c_tm.tm_mday )
printf("tm_mday=%i\n", my_tm.tm_mday);
else
printf("tm_mday=%i but C is %i\n", my_tm.tm_mday, c_tm.tm_mday);
if ( my_tm.tm_mon == c_tm.tm_mon )
printf("tm_mon=%i\n", my_tm.tm_mon);
else
printf("tm_mon=%i but C is %i\n", my_tm.tm_mon, c_tm.tm_mon);
if ( my_tm.tm_year == c_tm.tm_year )
printf("tm_year=%i\n", my_tm.tm_year);
else
printf("tm_year=%i but C is %i\n", my_tm.tm_year, c_tm.tm_year);
if ( my_tm.tm_wday == c_tm.tm_wday )
printf("tm_wday=%i\n", my_tm.tm_wday);
else
printf("tm_wday=%i but C is %i\n", my_tm.tm_wday, c_tm.tm_wday);
if ( my_tm.tm_yday == c_tm.tm_yday )
printf("tm_yday=%i\n", my_tm.tm_yday);
else
printf("tm_yday=%i but C is %i\n", my_tm.tm_yday, c_tm.tm_yday);
if ( my_tm.tm_isdst == c_tm.tm_isdst )
printf("tm_isdst=%i\n", my_tm.tm_isdst);
else
printf("tm_isdst=%i but C is %i\n", my_tm.tm_isdst, c_tm.tm_isdst);
return 0;
}
#endif