From 659b29ef4e6b8e6b12499abaecb6643be36fe754 Mon Sep 17 00:00:00 2001 From: Matheus Date: Tue, 9 Jun 2026 17:47:27 -0300 Subject: [PATCH] syscalls: implement sysctl and add process listing --- kernel-src/arch/x86-64/syscall.asm | 4 +- kernel-src/arch/x86-64/syscalllog.c | 4 +- kernel-src/include/kernel/proc.h | 8 ++ kernel-src/include/kernel/sysctl.h | 42 ++++++++++ kernel-src/include/kernel/tty.h | 1 + kernel-src/include/string.h | 2 + kernel-src/io/tty.c | 4 + kernel-src/lib/string.c | 31 +++++++ kernel-src/sys/ctl/kern.c | 112 +++++++++++++++++++++++++ kernel-src/sys/ctl/sysctl.c | 15 ++++ kernel-src/sys/proc.c | 37 +++++++- kernel-src/sys/scheduler/metrics.c | 9 +- kernel-src/sys/syscalls/execve.c | 16 ++++ kernel-src/sys/syscalls/fork.c | 9 ++ kernel-src/sys/syscalls/sysctl.c | 28 +++++++ patches/mlibc/jinx-working-patch.patch | 110 +++++++++++++++++++++++- recipes/mlibc | 2 +- recipes/mlibc-headers | 2 +- 18 files changed, 428 insertions(+), 8 deletions(-) create mode 100644 kernel-src/include/kernel/sysctl.h create mode 100644 kernel-src/sys/ctl/kern.c create mode 100644 kernel-src/sys/ctl/sysctl.c create mode 100644 kernel-src/sys/syscalls/sysctl.c diff --git a/kernel-src/arch/x86-64/syscall.asm b/kernel-src/arch/x86-64/syscall.asm index 5fa0f716..1813bcfc 100644 --- a/kernel-src/arch/x86-64/syscall.asm +++ b/kernel-src/arch/x86-64/syscall.asm @@ -104,6 +104,7 @@ extern syscall_fstatvfsat extern syscall_getsockopt extern syscall_clock_getres extern syscall_setpriority +extern syscall_sysctl syscalltab: dq syscall_print dq syscall_mmap @@ -210,7 +211,8 @@ dq syscall_fstatvfsat dq syscall_getsockopt dq syscall_clock_getres dq syscall_setpriority -syscallcount equ 105 +dq syscall_sysctl +syscallcount equ 106 section .text global arch_syscall_entry ; on entry: diff --git a/kernel-src/arch/x86-64/syscalllog.c b/kernel-src/arch/x86-64/syscalllog.c index 70123ddc..fd7bdc76 100644 --- a/kernel-src/arch/x86-64/syscalllog.c +++ b/kernel-src/arch/x86-64/syscalllog.c @@ -9,7 +9,7 @@ void arch_interrupt_disable(); void arch_interrupt_enable(); -#define SYSCALL_COUNT 105 +#define SYSCALL_COUNT 106 #define LOGSTR(x) arch_e9_puts(x) static char *name[] = { @@ -118,6 +118,7 @@ static char *name[] = { "getsockopt", "clock_getres", "setpriority", + "sysctl", }; static char *args[] = { @@ -226,6 +227,7 @@ static char *args[] = { "fd %d level %d optname %d optval %p optlen %p", // getsockopt "clockid %d timespec %p", // clock_getres "which %d who %d prio %d", // setpriority + "name %p name_len %lu oldp %p old_size %p newp %p new_size %lu", // sysctl }; #endif diff --git a/kernel-src/include/kernel/proc.h b/kernel-src/include/kernel/proc.h index 26bf232f..eb8fca98 100644 --- a/kernel-src/include/kernel/proc.h +++ b/kernel-src/include/kernel/proc.h @@ -13,6 +13,8 @@ #include +#include + #ifdef __x86_64__ #include #endif @@ -90,6 +92,11 @@ typedef struct proc_t { itimer_t virtualtime; itimer_t profiling; } timer; + + char name[SYS_CTL_KERN_PROC_INFO_NAME_SIZE]; + timespec_t start_time; + spinlock_t runtime_lock; + timespec_t total_runtime; } proc_t; @@ -125,5 +132,6 @@ void proc_init(void); void proc_exit(void); void proc_run_init(); size_t proc_get_count(void); +size_t proc_get_table(proc_t **procs, size_t count); #endif diff --git a/kernel-src/include/kernel/sysctl.h b/kernel-src/include/kernel/sysctl.h new file mode 100644 index 00000000..f44509e5 --- /dev/null +++ b/kernel-src/include/kernel/sysctl.h @@ -0,0 +1,42 @@ +#ifndef _SYSCTL_H +#define _SYSCTL_H + +#include +#include + +#define SYS_CTL_NAME_MAX 6 + +#define SYS_CTL_KERN 1 +#define SYS_CTL_KERN_PROC 1 +#define SYS_CTL_KERN_PROC_ALL 1 + +#define SYS_CTL_KERN_PROC_INFO_NAME_SIZE 64 +#define SYS_CTL_KERN_PROC_INFO_TTY_NAME_SIZE 64 + +typedef struct { + pid_t pid; + uid_t uid; + uid_t euid; + uid_t suid; + gid_t gid; + gid_t egid; + gid_t sgid; + size_t thread_count; + char name[SYS_CTL_KERN_PROC_INFO_NAME_SIZE]; + pid_t ppid; + pid_t pgid; + pid_t sid; + timespec_t start_timestamp; + timespec_t total_runtime; + int state; + int cpu_time; + int nice; + size_t virtual_pages; + size_t physical_pages; + char tty_name[SYS_CTL_KERN_PROC_INFO_TTY_NAME_SIZE]; +} sysctl_proc_info_t; + +int sysctl(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len); +int sysctl_kern(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len); + +#endif diff --git a/kernel-src/include/kernel/tty.h b/kernel-src/include/kernel/tty.h index 49b5e10d..8206e268 100644 --- a/kernel-src/include/kernel/tty.h +++ b/kernel-src/include/kernel/tty.h @@ -44,5 +44,6 @@ void tty_process(tty_t *tty, char c); void tty_unregister(tty_t *tty); int tty_ioctl(tty_t *tty, unsigned long req, void *arg, int *result, cred_t *cred); size_t tty_opened(tty_t *tty); +void tty_release(tty_t *tty); #endif diff --git a/kernel-src/include/string.h b/kernel-src/include/string.h index 0635253a..712795be 100644 --- a/kernel-src/include/string.h +++ b/kernel-src/include/string.h @@ -6,6 +6,7 @@ size_t strlen(const char *str); size_t strnlen(const char *str, size_t max); char *strcpy(char *dest, const char *src); +char *strncpy(char *dest, const char *src, size_t n); char *strcat(char *dest, const char *str); void *memcpy(void *dest, const void *src, size_t size); void *memset(void *dest, int what, size_t size); @@ -15,5 +16,6 @@ int memcmp(const void *a, const void *b, size_t s); void *memmove(void *_d, const void *_s, size_t c); char *strerror(int errno); long long atoll(const char *c); +char *strrchr(const char *s, char c); #endif diff --git a/kernel-src/io/tty.c b/kernel-src/io/tty.c index 092e9949..b316bd7d 100644 --- a/kernel-src/io/tty.c +++ b/kernel-src/io/tty.c @@ -590,6 +590,10 @@ void tty_unregister(tty_t *tty) { } } +void tty_release(tty_t *tty) { + VOP_RELEASE(tty->mastervnode); +} + size_t tty_opened(tty_t *tty) { return __atomic_load_n(&tty->opened, __ATOMIC_SEQ_CST); } diff --git a/kernel-src/lib/string.c b/kernel-src/lib/string.c index 42ee6d19..3396c690 100644 --- a/kernel-src/lib/string.c +++ b/kernel-src/lib/string.c @@ -122,6 +122,37 @@ long long atoll(const char *c) { return first == '-' ? -v : v; } +char *strrchr(const char *s, char c) { + char *f = NULL; + while (*s) { + if (*s == c) + f = (char *)s; + + ++s; + } + + if (c == '\0') + return (char *)s; + + return f; +} + +char *strncpy(char *dest, const char *src, size_t n) { + char *copy = dest; + + while (n && *src) { + *dest = *src; + ++src; + ++dest; + --n; + } + + for (size_t i = 0; i < n; ++i) + dest[i] = '\0'; + + return copy; +} + #define DO_NAME(e) \ case e: \ return #e; diff --git a/kernel-src/sys/ctl/kern.c b/kernel-src/sys/ctl/kern.c new file mode 100644 index 00000000..feafb4b6 --- /dev/null +++ b/kernel-src/sys/ctl/kern.c @@ -0,0 +1,112 @@ +#include +#include +#include +#include +#include +#include + +#define SYS_CTL_NAME_MAX 6 + +#define SYS_CTL_KERN 1 +#define SYS_CTL_KERN_PROC 1 +#define SYS_CTL_KERN_PROC_ALL 1 + +static void release_procs(proc_t **procs, size_t size) { + for (size_t i = 0; i < size; ++i) { + PROC_RELEASE(procs[i]); + } +} + +// TODO: fix size differences returning ENOMEM +static int ctl_proc(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t) { + if (name_len != 4) + return EINVAL; + + if (newp) + return EPERM; + + size_t struct_size = min(name[2], sizeof(sysctl_proc_info_t)); + size_t proc_count = proc_get_count(); + size_t struct_count = proc_count; + if (name[3]) + struct_count = min(struct_count, name[3]); + + if (!oldp) { + // the caller just wants to know the size of the process table + size_t new_len = struct_count * struct_size; + return USERCOPY_POSSIBLY_TO_USER(old_lenp, &new_len, sizeof(new_len)); + } + + size_t old_len; + int error = USERCOPY_POSSIBLY_FROM_USER(&old_len, old_lenp, sizeof(old_len)); + if (error) + return error; + + if (old_len < struct_size * struct_count) + return ENOMEM; + + proc_t **procs = alloc(sizeof(proc_t *) * struct_count); + if (procs == NULL) + return ENOMEM; + + struct_count = proc_get_table(procs, struct_count); + size_t new_len = struct_count * struct_size; + error = USERCOPY_POSSIBLY_TO_USER(old_lenp, &new_len, sizeof(new_len)); + if (error) + goto cleanup; + + for (size_t i = 0; i < struct_count; ++i) { + sysctl_proc_info_t proc_info; + + // TODO: this is currently very unsafe. + proc_t *parent = procs[i]->parent; + + cred_getuids(&procs[i]->cred, &proc_info.uid, &proc_info.euid, &proc_info.suid); + cred_getgids(&procs[i]->cred, &proc_info.gid, &proc_info.egid, &proc_info.sgid); + + strncpy(proc_info.name, procs[i]->name, sizeof(proc_info.name)); + + proc_info.pid = procs[i]->pid; + proc_info.thread_count = procs[i]->runningthreadcount; + proc_info.ppid = parent ? parent->pid : 0; + proc_info.pgid = jobctl_getpgid(procs[i]); + proc_info.sid = jobctl_getsid(procs[i]); + + proc_info.start_timestamp = procs[i]->start_time; + long ipl = spinlock_acquire_raise_ipl(&procs[i]->runtime_lock, IPL_DPC); + proc_info.total_runtime = procs[i]->total_runtime; + spinlock_release_lower_ipl(&procs[i]->runtime_lock, ipl); + + proc_info.state = 0; + proc_info.cpu_time = 0; + proc_info.nice = procs[i]->nice; + proc_info.virtual_pages = 0; + proc_info.physical_pages = 0; + + tty_t *ctty = jobctl_getctty(procs[i]); + if (ctty) { + strncpy(proc_info.tty_name, ctty->name, sizeof(proc_info.tty_name)); + tty_release(ctty); + } else { + memset(proc_info.tty_name, 0, sizeof(proc_info.tty_name)); + } + + error = USERCOPY_POSSIBLY_TO_USER(oldp + i * struct_size, &proc_info, struct_size); + if (error) + goto cleanup; + } + + cleanup: + release_procs(procs, struct_count); + free(procs); + return error; +} + +int sysctl_kern(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len) { + switch (*name) { + case SYS_CTL_KERN_PROC: + return ctl_proc(name + 1, name_len - 1, oldp, old_lenp, newp, new_len); + } + + return EINVAL; +} diff --git a/kernel-src/sys/ctl/sysctl.c b/kernel-src/sys/ctl/sysctl.c new file mode 100644 index 00000000..a946264f --- /dev/null +++ b/kernel-src/sys/ctl/sysctl.c @@ -0,0 +1,15 @@ +#include +#include + +// oldp, old_lenp and newp might be user pointers +int sysctl(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len) { + if (name_len < 2 || name_len > SYS_CTL_NAME_MAX) + return EINVAL; + + switch (*name) { + case SYS_CTL_KERN: + return sysctl_kern(name + 1, name_len - 1, oldp, old_lenp, newp, new_len); + default: + return EINVAL; + } +} diff --git a/kernel-src/sys/proc.c b/kernel-src/sys/proc.c index f1fbdaf0..f9c453aa 100644 --- a/kernel-src/sys/proc.c +++ b/kernel-src/sys/proc.c @@ -33,6 +33,24 @@ size_t proc_get_count(void) { return count; } +size_t proc_get_table(proc_t **procs, size_t count) { + MUTEX_ACQUIRE(&proc_pid_table_mutex); + + size_t done_count = 0; + HASHTABLE_FOREACH(&pid_table) { + if (done_count == count) + goto leave; + + proc_t *current = entry->value; + PROC_HOLD(current); + procs[done_count++] = current; + } + +leave: + MUTEX_RELEASE(&proc_pid_table_mutex); + return done_count; +} + proc_t *proc_get_from_pid(int pid) { MUTEX_ACQUIRE(&proc_pid_table_mutex); void *_proc = NULL; @@ -108,6 +126,8 @@ proc_t *proc_create() { SPINLOCK_INIT(proc->threadlistlock); EVENT_INITHEADER(&proc->child_exit_event); EVENT_INITHEADER(&proc->thread_exit_event); + SPINLOCK_INIT(proc->runtime_lock); + memset(&proc->total_runtime, 0, sizeof(proc->total_runtime)); proc->fd = alloc(sizeof(fd_t) * 3); if (proc->fd == NULL) { @@ -311,7 +331,8 @@ void proc_exit(void) { EVENT_SIGNAL(&proc->parent->child_exit_event); // TODO sigaction flag for this if (belowzombiecount) { - EVENT_SIGNAL(&init_proc->child_exit_event); + signal_signalproc(proc->parent, SIGCHLD); + EVENT_SIGNAL(&init_proc->child_exit_event); } } @@ -324,6 +345,17 @@ void proc_run_init() { if (init_path == NULL) init_path = "/init"; + char *last_component = strrchr(init_path, '/'); + if (last_component) { + ++last_component; + if (*last_component == '\0') { + _panic("Bad init path. Do not append a '/' to init=", NULL); + } + } else { + last_component = init_path; + } + + char *init_console = GET_KERNEL_ARGUMENT(initconsole, char *); if (init_console == NULL) init_console = "console"; @@ -341,6 +373,9 @@ void proc_run_init() { init_proc = proc; + strncpy(proc->name, last_component, sizeof(proc->name)); + proc->start_time = timekeeper_timefromboot(); + vnode_t *initnode; __assert(vfs_open(vfsroot, init_path, 0, &initnode) == 0); diff --git a/kernel-src/sys/scheduler/metrics.c b/kernel-src/sys/scheduler/metrics.c index 7502fc7c..fab0b76d 100644 --- a/kernel-src/sys/scheduler/metrics.c +++ b/kernel-src/sys/scheduler/metrics.c @@ -44,7 +44,14 @@ void sched_thread_running_callback(thread_t *thread) { void sched_thread_stopping_callback(thread_t *thread, bool sleeping) { timespec_t now = timekeeper_time(); - offset_times(thread, timespec_diffus(thread->metrics.run_start, now), 0); + size_t us_diff = timespec_diffus(thread->metrics.run_start, now); + offset_times(thread, us_diff, 0); + + if (thread->proc) { + spinlock_acquire(&thread->proc->runtime_lock); + thread->proc->total_runtime = timespec_add(thread->proc->total_runtime, timespec_from_us(us_diff)); + spinlock_release(&thread->proc->runtime_lock); + } if (sleeping) thread->metrics.sleep_start = now; diff --git a/kernel-src/sys/syscalls/execve.c b/kernel-src/sys/syscalls/execve.c index 419f8a98..89e9aacc 100644 --- a/kernel-src/sys/syscalls/execve.c +++ b/kernel-src/sys/syscalls/execve.c @@ -51,6 +51,18 @@ static syscallret_t execve(context_t *context, char *upath, char *uargv[], char return ret; } + char *last_component = strrchr(path, '/'); + if (last_component) { + ++last_component; + if (*last_component == '\0') { + ret.errno = EISDIR; + free(path); + return ret; + } + } else { + last_component = path; + } + size_t argsize = 0; size_t envsize = 0; char **argv = NULL; @@ -315,6 +327,10 @@ static syscallret_t execve(context_t *context, char *upath, char *uargv[], char cred_doexec(¤t_thread()->proc->cred, suid, sgid); + strncpy(current_thread()->proc->name, last_component, sizeof(current_thread()->proc->name)); + proc->start_time = timekeeper_timefromboot(); + memset(&proc->total_runtime, 0, sizeof(proc->total_runtime)); + error: free(path); if (argv) diff --git a/kernel-src/sys/syscalls/fork.c b/kernel-src/sys/syscalls/fork.c index fd312d12..51a51866 100644 --- a/kernel-src/sys/syscalls/fork.c +++ b/kernel-src/sys/syscalls/fork.c @@ -76,10 +76,19 @@ syscallret_t syscall_fork(context_t *ctx) { memcpy(&nproc->signals.pending, &proc->signals.pending, sizeof(sigset_t)); memcpy(&nproc->signals.actions, &proc->signals.actions[0], sizeof(sigaction_t) * NSIG); + strncpy(nproc->name, proc->name, sizeof(proc->name)); + nproc->start_time = proc->start_time; + // copy thread scheduling metrics over // raised to IPL_DPC to prevent scheduling long ipl = interrupt_raiseipl(IPL_DPC); + + spinlock_acquire(&proc->runtime_lock); + nproc->total_runtime = proc->total_runtime; + spinlock_release(&proc->runtime_lock); + memcpy(&nthread->metrics, ¤t_thread()->metrics, sizeof(nthread->metrics)); + interrupt_loweripl(ipl); ret.ret = nproc->pid; diff --git a/kernel-src/sys/syscalls/sysctl.c b/kernel-src/sys/syscalls/sysctl.c new file mode 100644 index 00000000..8406bb3a --- /dev/null +++ b/kernel-src/sys/syscalls/sysctl.c @@ -0,0 +1,28 @@ +#include +#include +#include + +syscallret_t syscall_sysctl(context_t *, int *namep, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len) { + syscallret_t ret = { + .ret = -1 + }; + + if (name_len > SYS_CTL_NAME_MAX) { + ret.errno = EINVAL; + return ret; + } + + if (!IS_USER_ADDRESS(namep) || !IS_USER_ADDRESS(oldp) || !IS_USER_ADDRESS(old_lenp) || !IS_USER_ADDRESS(newp)) { + ret.errno = EFAULT; + return ret; + } + + int name[name_len]; + ret.errno = usercopy_fromuser(name, namep, sizeof(name)); + if (ret.errno) + return ret; + + ret.errno = sysctl(name, name_len, oldp, old_lenp, newp, new_len); + ret.ret = ret.errno ? -1 : 0; + return ret; +} diff --git a/patches/mlibc/jinx-working-patch.patch b/patches/mlibc/jinx-working-patch.patch index 620f54a9..4b69111c 100644 --- a/patches/mlibc/jinx-working-patch.patch +++ b/patches/mlibc/jinx-working-patch.patch @@ -411,6 +411,37 @@ index ba9a520..b958ef3 100644 .section .note.GNU-stack,"",%progbits - +diff --git mlibc-clean/sysdeps/astral/generic/astral.cpp mlibc-workdir/sysdeps/astral/generic/astral.cpp +index a86353f..3e1a18c 100644 +--- mlibc-clean/sysdeps/astral/generic/astral.cpp ++++ mlibc-workdir/sysdeps/astral/generic/astral.cpp +@@ -1,13 +1,25 @@ + #include + #include ++#include + #include + + #ifndef MLIBC_BUILDING_RTLD + ++int sysctl(const int *name, size_t name_len, void *oldp, size_t *old_lenp, void *newp, size_t new_len) { ++ long ret; ++ long error = syscall(SYSCALL_SYSCTL, &ret, (uint64_t)name, name_len, (uint64_t)oldp, (uint64_t)old_lenp, (uint64_t)newp, new_len); ++ if (error) { ++ errno = error; ++ return -1; ++ } ++ ++ return 0; ++} ++ + int arch_ctl(int func, void *arg) { + long ret; + long error = syscall(SYSCALL_ARCHCTL, &ret, func, (uint64_t)arg); +- if(error) ++ if (error) + errno = error; + return error ? -1 : ret; + } diff --git mlibc-clean/sysdeps/astral/generic/generic.cpp mlibc-workdir/sysdeps/astral/generic/generic.cpp index 3b04372..b7a8ab7 100644 --- mlibc-clean/sysdeps/astral/generic/generic.cpp @@ -942,10 +973,10 @@ index 7e4f2a1..ecc2677 100644 #ifdef __cplusplus extern "C" { diff --git mlibc-clean/sysdeps/astral/include/astral/syscall.h mlibc-workdir/sysdeps/astral/include/astral/syscall.h -index a6c4067..fd38197 100644 +index a6c4067..160a140 100644 --- mlibc-clean/sysdeps/astral/include/astral/syscall.h +++ mlibc-workdir/sysdeps/astral/include/astral/syscall.h -@@ -103,6 +103,12 @@ +@@ -103,6 +103,13 @@ #define SYSCALL_SYSINFO 96 #define SYSCALL_WRITEV 97 #define SYSCALL_READV 98 @@ -955,9 +986,72 @@ index a6c4067..fd38197 100644 +#define SYSCALL_GETSOCKOPT 102 +#define SYSCALL_CLOCK_GETRES 103 +#define SYSCALL_SETPRIORITY 104 ++#define SYSCALL_SYSCTL 105 #ifndef __MLIBC_ABI_ONLY +diff --git mlibc-workdir/sysdeps/astral/include/astral/sysctl.h mlibc-workdir/sysdeps/astral/include/astral/sysctl.h +new file mode 100644 +index 0000000..161f634 +--- /dev/null ++++ mlibc-workdir/sysdeps/astral/include/astral/sysctl.h +@@ -0,0 +1,56 @@ ++#ifndef _ASTRAL_SYSCTL_H ++#define _ASTRAL_SYSCTL_H ++ ++#include ++#include ++#include ++#include ++#include ++ ++#define SYS_CTL_NAME_MAX 6 ++ ++#define SYS_CTL_KERN 1 ++#define SYS_CTL_KERN_PROC 1 ++#define SYS_CTL_KERN_PROC_ALL 1 ++ ++#define SYS_CTL_KERN_PROC_INFO_NAME_SIZE 64 ++#define SYS_CTL_KERN_PROC_INFO_TTY_NAME_SIZE 64 ++ ++typedef struct { ++ pid_t pid; ++ uid_t uid; ++ uid_t euid; ++ uid_t suid; ++ gid_t gid; ++ gid_t egid; ++ gid_t sgid; ++ size_t thread_count; ++ char name[SYS_CTL_KERN_PROC_INFO_NAME_SIZE]; ++ pid_t ppid; ++ pid_t pgid; ++ pid_t sid; ++ struct timespec start_timestamp; ++ struct timespec total_runtime; ++ int state; ++ int cpu_time; ++ int nice; ++ size_t virtual_pages; ++ size_t physical_pages; ++ char tty_name[SYS_CTL_KERN_PROC_INFO_TTY_NAME_SIZE]; ++} sysctl_proc_info_t; ++ ++#ifdef __cplusplus ++extern "C" { ++#endif ++ ++#ifndef __MLIBC_ABI_ONLY ++ ++int sysctl(const int *__name, size_t __name_len, void *__oldp, size_t *__old_lenp, void *__newp, size_t __new_len); ++ ++#endif /* !__MLIBC_ABI_ONLY */ ++ ++#ifdef __cplusplus ++} ++#endif ++ ++#endif /* _ASTRAL_SYSCTL_H */ diff --git mlibc-clean/sysdeps/astral/include/mlibc/sysdeps.hpp mlibc-workdir/sysdeps/astral/include/mlibc/sysdeps.hpp index ce91084..54ee08e 100644 --- mlibc-clean/sysdeps/astral/include/mlibc/sysdeps.hpp @@ -1030,6 +1124,18 @@ index ce91084..54ee08e 100644 {}; template +diff --git mlibc-clean/sysdeps/astral/meson.build mlibc-workdir/sysdeps/astral/meson.build +index 43dd6b0..3e01e87 100644 +--- mlibc-clean/sysdeps/astral/meson.build ++++ mlibc-workdir/sysdeps/astral/meson.build +@@ -86,6 +86,7 @@ if not no_headers + install_headers( + 'include/astral/syscall.h', + 'include/astral/archctl.h', ++ 'include/astral/sysctl.h', + subdir: 'astral', + follow_symlinks: true, + ) diff --git mlibc-clean/sysdeps/linux/generic/sysdeps.cpp mlibc-workdir/sysdeps/linux/generic/sysdeps.cpp index a07ed53..1474470 100644 --- mlibc-clean/sysdeps/linux/generic/sysdeps.cpp diff --git a/recipes/mlibc b/recipes/mlibc index 537a3ac8..fe106c38 100644 --- a/recipes/mlibc +++ b/recipes/mlibc @@ -1,6 +1,6 @@ name=mlibc from_source=mlibc -revision=6 +revision=7 hostdeps="xgcc xbinutils pkgconfig" builddeps="freestnd-c-hdrs freestnd-cxx-hdrs frigg libsmarter" imagedeps="meson ninja-build git build-essential binutils" diff --git a/recipes/mlibc-headers b/recipes/mlibc-headers index a5b5e129..f02d9661 100644 --- a/recipes/mlibc-headers +++ b/recipes/mlibc-headers @@ -1,6 +1,6 @@ name=mlibc-headers from_source=mlibc -revision=1 +revision=2 imagedeps="ninja-build meson build-essential rsync" builddeps="linux-headers"