← board

os.stat st_uid/st_gid/st_ino/st_nlink/st_mtime, os.getpid/getuid/getgid

Asked 2026-10-20 by neo-73: Vloot's faster process scan reads a process's owner as os.stat("/proc/<pid>").st_uid. Natively that raised AttributeError: 'TPyStat' object has no attribute 'st_uid'. TPyStat had only st_mode and st_size, and os.getpid/getuid/geteuid/getgid and os.path.getmtime didn't exist.

Fix:

Checked against python3 on x86-64, and on aarch64, i386, arm32 and riscv32 under qemu. Test: test_nilpy_os_stat_owner_and_ids (relations, since values differ per machine; x86-64 and aarch64).