]> Projects (at) Tadryanom (dot) Me - AdrOS.git/commit
utmp: add kernel utmp database infrastructure
authorTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:45:47 +0000 (23:45 -0300)
committerTulio A M Mendes <[email protected]>
Thu, 11 Jun 2026 02:45:47 +0000 (23:45 -0300)
commit89a739758e945df69d28f40e518a84d0655b16a6
tree3cbe7cc2152e78be53dbbcc2b56599b3c9834efd
parent00d2e7db1f1fbef41e34c67d22373a3963f7005c
utmp: add kernel utmp database infrastructure

Implement L2 (partial): kernel utmp database infrastructure.

Added utmp.h with Linux-compatible utmp structure and record types.
Implemented utmp.c with:
- utmp_init(): Initialize utmp database
- utmp_login(): Register user login session
- utmp_logout(): Mark session as DEAD_PROCESS
- utmp_dead(): Record process exit status
- utmp_get_by_pid(): Find utmp entry by PID

Reduced UTMP_MAX_ENTRIES to 32 to avoid BSS overflow.
Not initialized in boot (deferred to when needed) to prevent SMP panic.

Test: make test-battery PASS (157/157), make analyzer PASS

Note: Userspace integration (getlogin/who) and login session
registration still needed for complete L2 implementation.
include/utmp.h [new file with mode: 0644]
src/kernel/utmp.c [new file with mode: 0644]