]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
feat: Phase 2 — getrusage syscall, FIONREAD ioctl, libgen.h, misc ulibc
authorTulio A M Mendes <[email protected]>
Sat, 14 Mar 2026 07:54:46 +0000 (04:54 -0300)
committerTulio A M Mendes <[email protected]>
Sat, 14 Mar 2026 07:54:46 +0000 (04:54 -0300)
commit9973ac67819a59249977ab4a6cb4b08357614b52
tree058d9d1578ea326efd187d9866ac4ef34db107f6
parent1cc82e1979bfc0ea795e8620d71185026c3de0ad
feat: Phase 2 — getrusage syscall, FIONREAD ioctl, libgen.h, misc ulibc

Kernel:
- Add SYSCALL_GETRUSAGE (137) returning process utime/stime as struct rusage
- Add FIONREAD (0x541B) ioctl to TTY (returns canon_buf available bytes)
- Add FIONREAD (0x541B) ioctl to pipe (returns pipe buffer count)

ulibc:
- sys/resource.h: Add RUSAGE_SELF/CHILDREN, struct rusage, getrusage()
- resource.c: Add getrusage() syscall wrapper
- libgen.h + libgen.c: basename() and dirname() implementations
- misc.c: gethostname() (returns 'adros'), ttyname(), pipe2() wrapper
- syscall.h: Add SYS_GETRUSAGE (137)

Tests: 101/101 smoke, 64/64 host utils, cppcheck clean
include/syscall.h
src/kernel/syscall.c
src/kernel/tty.c
user/ulibc/include/libgen.h [new file with mode: 0644]
user/ulibc/include/sys/resource.h
user/ulibc/include/syscall.h
user/ulibc/src/libgen.c [new file with mode: 0644]
user/ulibc/src/misc.c [new file with mode: 0644]
user/ulibc/src/resource.c