summaryrefslogtreecommitdiff
path: root/src/init/stdlib.c
diff options
context:
space:
mode:
authordzwdz2022-07-01 20:36:59 +0200
committerdzwdz2022-07-01 20:36:59 +0200
commit58c44c9a8feb8c258dcd85209149c16342995ec7 (patch)
treef3a3d61291beada2c3f9e7c773d42c202054263c /src/init/stdlib.c
parent5b9f1ea3911a6e972263d00ea2ec04a56f56166d (diff)
kernel: add the debug_klog syscall for tracking down process ids
Diffstat (limited to 'src/init/stdlib.c')
-rw-r--r--src/init/stdlib.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/init/stdlib.c b/src/init/stdlib.c
index cbaed61..d9d882d 100644
--- a/src/init/stdlib.c
+++ b/src/init/stdlib.c
@@ -37,6 +37,20 @@ int snprintf(char *str, size_t len, const char *fmt, ...) {
return ret;
}
+int _klogf(const char *fmt, ...) {
+ // idiotic. however, this hack won't matter anyways
+ char buf[256];
+ int ret = 0;
+ char *ptrs[2] = {buf, buf + sizeof buf};
+ va_list argp;
+ va_start(argp, fmt);
+ ret = __printf_internal(fmt, argp, backend_buf, &ptrs);
+ va_end(argp);
+ if (ptrs[0] < ptrs[1]) *ptrs[0] = '\0';
+ _syscall_debug_klog(buf, ret);
+ return ret;
+}
+
int file_open(libc_file *f, const char *path, int flags) {
f->pos = 0;