]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
Complete syscall coverage in ulibc and newlib wrappers
authorTulio A M Mendes <[email protected]>
Sun, 19 Apr 2026 18:12:28 +0000 (15:12 -0300)
committerTulio A M Mendes <[email protected]>
Sun, 19 Apr 2026 18:12:28 +0000 (15:12 -0300)
commite53b1b798ac5c0ea2f8196197de9622b592bf2ed
tree9eb70ff44ab2079cd00164563f62b969b381b16a
parent13b43e0ea66930cee10969fd9c70bdf0de500e30
Complete syscall coverage in ulibc and newlib wrappers

Audit of all 141 kernel syscalls vs ulibc/newlib wrappers revealed
many missing implementations. Both libraries had syscall numbers
defined but no corresponding POSIX wrapper functions.

ulibc additions (unistd.c):
  - select, fcntl, rename (was stub returning -1), umask
  - dup3, openat, fstatat, unlinkat
  - mount, umount2, umount
  - wait4, waitid, sigreturn, sigqueue, set_thread_area

ulibc header updates:
  - unistd.h: declarations for all new functions
  - signal.h: union sigval, sigqueue, sigreturn declarations
  - sys/mount.h: new header with mount/umount2/umount + flags
  - Removed old rename() stub from stdio.c

newlib additions (posix_stubs.c):
  - Complete syscall number table (was 32 entries, now all 141)
  - All missing POSIX wrappers: fcntl, rename, rmdir, mkdir, unlink,
    dup3, openat, fstatat, unlinkat, mount, umount2, umount, wait4,
    waitid, sigreturn, sigqueue, set_thread_area, pread, pwrite,
    truncate, ftruncate, fsync, fdatasync, sigpending, sigsuspend,
    readv, writev, times, flock, setitimer, getitimer, link, symlink,
    readlink, pipe2, clock_gettime, gettimeofday, mmap, munmap,
    mprotect, madvise, getrlimit, setrlimit, getrusage, uname,
    brk, sbrk
  - Added includes: sys/mman.h, sys/resource.h, sys/utsname.h,
    sys/uio.h, sys/times.h, sys/wait.h

Fix: setitimer/getitimer signatures corrected from void* to
struct itimerval* to match sys/time.h declarations.

Tests: 103/103 PASS, 16/16 battery PASS, 69/69 host PASS.
newlib/libgloss/adros/posix_stubs.c
user/ulibc/include/signal.h
user/ulibc/include/sys/mount.h [new file with mode: 0644]
user/ulibc/include/unistd.h
user/ulibc/src/stdio.c
user/ulibc/src/unistd.c