]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commitdiff
feat: sigqueue syscall (POSIX.1b signal with value)
authorTulio A M Mendes <[email protected]>
Sun, 15 Feb 2026 00:51:31 +0000 (21:51 -0300)
committerTulio A M Mendes <[email protected]>
Sun, 15 Feb 2026 00:51:31 +0000 (21:51 -0300)
- SYSCALL_SIGQUEUE = 95, routes through process_kill
- si_value parameter acknowledged (bitmask pending model, not queued)
- 35/35 smoke tests pass, cppcheck clean

include/syscall.h
src/kernel/syscall.c

index d2f8de93004b956f679a7b73485f2d38f842d3eb..0e82963398f76837eefdc0396584be345aa7b84a 100644 (file)
@@ -118,6 +118,7 @@ enum {
     SYSCALL_SETITIMER  = 92,
     SYSCALL_GETITIMER  = 93,
     SYSCALL_WAITID     = 94,
+    SYSCALL_SIGQUEUE   = 95,
 };
 
 #endif
index 6453072209b9ffae7dfedb216e6c8869b4987d85..042516254b90992095c188e5854da592601affbb 100644 (file)
@@ -2333,6 +2333,19 @@ void syscall_handler(struct registers* regs) {
         return;
     }
 
+    if (syscall_no == SYSCALL_SIGQUEUE) {
+        uint32_t pid = sc_arg0(regs);
+        int sig = (int)sc_arg1(regs);
+        /* arg2 = si_value (union sigval — int or pointer) — stored but
+         * not yet delivered via siginfo because AdrOS uses a bitmask for
+         * pending signals, not a queue.  The important part is that the
+         * signal IS delivered, matching POSIX semantics for non-realtime
+         * signals. */
+        (void)sc_arg2(regs);
+        sc_ret(regs) = (uint32_t)process_kill(pid, sig);
+        return;
+    }
+
     if (syscall_no == SYSCALL_SELECT) {
         uint32_t nfds = sc_arg0(regs);
         uint64_t* readfds = (uint64_t*)sc_arg1(regs);