udev works: /sys device tree, uevent netlink, datagram sockets with per-message credentials

Kernel devices (input, mem, tty, graphics, block) get /sys/devices/virtual
entries with dev/uevent/subsystem, /sys/class and /sys/dev links, input
capabilities, and writable uevent files that announce on the netlink socket.
eudev now runs, processes a full trigger and settles.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EVRhxi9zpdW2uDUN4FVcao
This commit is contained in:
Nexoniarz 2026-10-26 11:39:13 +01:00
commit 5d4d318ebf
10 changed files with 813 additions and 37 deletions

View file

@ -133,6 +133,16 @@ stati_linux(struct inode *ip, struct linux_stat *st)
st->st_atime = ip->atime; st->st_mtime = ip->mtime; st->st_ctime = ip->ctime;
}
// The number stat() reports for a device node, split back into major and
// minor. /sys must agree with stat() -- udev matches one against the other.
void
dev_stat_numbers(int major, int minor, int *maj, int *min)
{
uint64 r = linux_tty_rdev((uint32)major, (uint32)minor);
*maj = (int)(((r >> 8) & 0xfff) | ((r >> 32) & ~0xfffULL));
*min = (int)((r & 0xff) | ((r >> 12) & ~0xffULL));
}
// -----------------------------------------------------------------------
// Internal helpers
// -----------------------------------------------------------------------