fix: update template, prevent double-spaced persisted kernel logs

This commit is contained in:
2026-08-22 12:47:13 +02:00
parent 903218168d
commit 8a74b771e1
21 changed files with 584 additions and 384 deletions
+5
View File
@@ -29,6 +29,11 @@ struct dirent *readdir(DIR *dirp);
int closedir(DIR *dirp);
void rewinddir(DIR *dirp);
int scandir(const char *dirp, struct dirent ***namelist,
int (*filter)(const struct dirent *),
int (*compar)(const struct dirent **, const struct dirent **));
int alphasort(const struct dirent **a, const struct dirent **b);
#ifdef __cplusplus
}
#endif
+18
View File
@@ -11,6 +11,24 @@ extern "C" {
#define INFINITY __builtin_inff()
#define NAN __builtin_nanf("")
/*
* X/Open math constants. Not in ISO C, but ported code assumes them freely
* (NetSurf's about:chart uses M_PI and M_PI_2).
*/
#define M_E 2.7182818284590452354
#define M_LOG2E 1.4426950408889634074
#define M_LOG10E 0.43429448190325182765
#define M_LN2 0.69314718055994530942
#define M_LN10 2.30258509299404568402
#define M_PI 3.14159265358979323846
#define M_PI_2 1.57079632679489661923
#define M_PI_4 0.78539816339744830962
#define M_1_PI 0.31830988618379067154
#define M_2_PI 0.63661977236758134308
#define M_2_SQRTPI 1.12837916709551257390
#define M_SQRT2 1.41421356237309504880
#define M_SQRT1_2 0.70710678118654752440
/* C99 floating-point classification. */
#define FP_NAN 0
#define FP_INFINITE 1
+10 -5
View File
@@ -73,11 +73,6 @@ extern "C" {
#define MTK_SYS_MOUSESTATE 47
#define MTK_SYS_SETMOUSEBOUNDS 48
#define MTK_SYS_SPAWN_REDIR 49
#define MTK_SYS_GETENVIRON 171
#define MTK_SYS_SETENVIRON 172
#define MTK_SYS_SPAWN_ENV 173
#define MTK_SYS_SETSESSION 174
#define MTK_SYS_KILLSESSION 175
#define MTK_SYS_CHILDIO_READ 50
#define MTK_SYS_CHILDIO_WRITE 51
#define MTK_SYS_CHILDIO_WRITEKEY 52
@@ -194,6 +189,16 @@ extern "C" {
#define MTK_SYS_WIFI_RESULTS 163
#define MTK_SYS_WIFI_CONNECT_ASYNC 164
#define MTK_SYS_NETIFS 165
#define MTK_SYS_GETCHAR_NB 166
#define MTK_SYS_UTIME 167
#define MTK_SYS_MMAP_ANON 168
#define MTK_SYS_MUNMAP 169
#define MTK_SYS_MPROTECT 170
#define MTK_SYS_GETENVIRON 171
#define MTK_SYS_SETENVIRON 172
#define MTK_SYS_SPAWN_ENV 173
#define MTK_SYS_SETSESSION 174
#define MTK_SYS_KILLSESSION 175
#define MTK_SYS_LOG_WRITE 176
/* @SYSCALLS-END */
+11
View File
@@ -95,6 +95,17 @@ int ungetc(int c, FILE *stream);
char *fgets(char *s, int size, FILE *stream);
int fputs(const char *s, FILE *stream);
/* MontaukOS extension: non-blocking readiness probe for stdin.
Returns 1 when a complete line is buffered, so a following fgets/fgetc on
stdin returns without blocking; 0 otherwise. Partially typed input is kept.
This is what a select()-style poll over stdin has to be built on -- stdio
descriptors are not waitable kernel objects. */
int montauk_stdin_ready(void);
/* Blocks until a complete line is buffered on stdin, then returns 1. Same
buffer as montauk_stdin_ready(); nothing is consumed either way. */
int montauk_stdin_wait(void);
void perror(const char *s);
FILE *tmpfile(void);
char *tmpnam(char *s);
+1
View File
@@ -25,6 +25,7 @@ char *strncpy(char *dest, const char *src, size_t n);
char *strcat(char *dest, const char *src);
char *strncat(char *dest, const char *src, size_t n);
char *strdup(const char *s);
char *strndup(const char *s, size_t n);
char *strchr(const char *s, int c);
char *strrchr(const char *s, int c);
char *strpbrk(const char *s, const char *accept);
+2 -4
View File
@@ -10,10 +10,8 @@ extern "C" {
#endif
/*
* Anonymous-memory mmap over SYS_ALLOC. SYS_ALLOC returns
* page-aligned process memory, which is exactly what callers like
* GCC's page allocator need. File-backed mappings are not
* supported and fail with ENODEV.
* Demand-paged anonymous memory backed by the kernel's VMA subsystem.
* File-backed and shared mappings are not supported and fail cleanly.
*/
#define PROT_NONE 0
+4
View File
@@ -23,6 +23,8 @@ int read(int fd, void *buf, size_t count);
int write(int fd, const void *buf, size_t count);
int close(int fd);
long lseek(int fd, long offset, int whence);
ssize_t pread(int fd, void *buf, size_t count, off_t offset);
ssize_t pwrite(int fd, const void *buf, size_t count, off_t offset);
int chdir(const char *path);
char *getcwd(char *buf, size_t size);
int access(const char *path, int mode);
@@ -59,6 +61,8 @@ long sysconf(int name);
extern char **environ;
unsigned int sleep(unsigned int seconds);
int usleep(unsigned long usec);
int ftruncate(int fd, long length);
#ifdef __cplusplus
}