Personality Components
The Zig personality layer: identifiers, binary-format detection, dispatch, and per-OS syscall translation.
personality/src/personality.zig
personality.zig — Personality identifiers and binary-format detection.
A "personality" defines which OS ABI a userspace process expects. Every Context in the kernel carries a personality, set during exec() based on the binary format and its metadata (ELF OS/ABI, PE subsystem, Mach-O filetype, etc.).
The personality determines:
- Which syscall number table to use for dispatch.
- How to translate arguments and data structures between the foreign ABI and the kernel's internal representation.
- How to encode return values and errors for the foreign ABI.
- Signal delivery semantics and signal number mapping.
- Process startup convention (register state, stack layout, aux vectors).
Adding a new personality
- Add a variant to
Personalityenum below. - Add a detection clause in
from_elf_osabi()and/orfrom_pe(). - Create
src/<name>/tables.zigwith the syscall number table. - Create
src/<name>/shim.zigwith argument/structure translators. - Wire the dispatch in
main.zig'ssyscall()function. - Add binary format loading support in the Rust side's ELF/PE/Mach-O loader (see
src/elf.rsand the newsrc/pe.rs,src/macho.rs).
Personality decl
pub const Personality = enum(u32)Identifies the OS personality of a process.
The numeric values match the C enum in include/personality.h and are the on-wire representation stored in the Context struct.
native decl
pub fn native() PersonalityConvenience: return the personality for a native/unknown binary.
name decl
pub fn name(self: Personality) []const u8Return a human-readable name for logging / debugging.
fromElfOsAbi decl
pub fn fromElfOsAbi(osabi: u8, machine: u16) PersonalityMap an ELF e_ident[EI_OSABI] byte to a Personality.
Reference: https://www.sco.com/developers/gabi/latest/ch4.eheader.html
Many ELF binaries have ELFOSABI_NONE (0) or ELFOSABI_LINUX (3). For ELFOSABI_NONE we also inspect the ELF flags and machine type to disambiguate — this is especially important because modern Linux toolchains emit ELFOSABI_NONE with a ELFOSABI_LINUX-compatible ABI.
fromPe decl
pub fn fromPe(machine: u16, _: u16) PersonalityMap a PE Machine + Subsystem to a Personality.
Reference: https://learn.microsoft.com/en-us/windows/win32/debug/pe-format
PE (Portable Executable) is the format for Windows executables, DLLs, and object files. It can also be used by UEFI applications.
fromMachO decl
pub fn fromMachO(cputype: u32, _: u32) PersonalityMap a Mach-O cputype + filetype to a Personality.
personality/src/kernel/tables.zig
kernel/tables.zig — Native kernel syscall number definitions and dispatch.
This table mirrors the native kernel syscall ABI defined in syscall/src/number.rs. The dispatch function is a direct passthrough: no argument or structure translation is needed because the kernel's internals use the same ABI.
ABI summary (native kernel)
- Syscall number in
a(register depends on arch: RAX, X8, A7, EAX). - Arguments:
bthroughfin arch-specific registers. - Return value:
usizein arch return register. - Error:
Error::mux(result)→-errno as usize(same as Linux convention). - Signals: currently a subset of POSIX; signal numbers are compatible with Linux for the common set.
Stability
The kernel personality MUST remain stable for all existing native userspace programs that ship with this kernel tree (initfs, drivers, etc.).
SYS_OPENAT decl
pub const SYS_OPENAT: usize = SYS_CLASS_PATH | SYS_RET_FILE | 7;SYS_OPENAT_WITH_FILTER decl
pub const SYS_OPENAT_WITH_FILTER: usize = SYS_CLASS_PATH | SYS_RET_FILE | 985;SYS_UNLINKAT decl
pub const SYS_UNLINKAT: usize = SYS_CLASS_PATH | 263;SYS_UNLINKAT_WITH_FILTER decl
pub const SYS_UNLINKAT_WITH_FILTER: usize = SYS_CLASS_PATH | 986;SYS_CLOSE decl
pub const SYS_CLOSE: usize = SYS_CLASS_FILE | 6;SYS_DUP decl
pub const SYS_DUP: usize = SYS_CLASS_FILE | SYS_RET_FILE | 41;SYS_DUP2 decl
pub const SYS_DUP2: usize = SYS_CLASS_FILE | SYS_RET_FILE | 63;SYS_READ decl
pub const SYS_READ: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 3;SYS_READ2 decl
pub const SYS_READ2: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 35;SYS_WRITE decl
pub const SYS_WRITE: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 4;SYS_WRITE2 decl
pub const SYS_WRITE2: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 45;SYS_LSEEK decl
pub const SYS_LSEEK: usize = SYS_CLASS_FILE | 19;SYS_FCHMOD decl
pub const SYS_FCHMOD: usize = SYS_CLASS_FILE | 94;SYS_FCHOWN decl
pub const SYS_FCHOWN: usize = SYS_CLASS_FILE | 207;SYS_FCNTL decl
pub const SYS_FCNTL: usize = SYS_CLASS_FILE | 55;SYS_FEVENT decl
pub const SYS_FEVENT: usize = SYS_CLASS_FILE | 927;SYS_CALL decl
pub const SYS_CALL: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | SYS_ARG_MSLICE | 0xCA11;SYS_SENDFD decl
pub const SYS_SENDFD: usize = SYS_CLASS_FILE | 34;SYS_GETDENTS decl
pub const SYS_GETDENTS: usize = SYS_CLASS_FILE | 43;SYS_FMAP decl
pub const SYS_FMAP: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 900;SYS_FUNMAP decl
pub const SYS_FUNMAP: usize = SYS_CLASS_FILE | 92;SYS_MREMAP decl
pub const SYS_MREMAP: usize = 155;SYS_FLINK decl
pub const SYS_FLINK: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 9;SYS_FPATH decl
pub const SYS_FPATH: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 928;SYS_FRENAME decl
pub const SYS_FRENAME: usize = SYS_CLASS_FILE | SYS_ARG_PATH | 38;SYS_FSTAT decl
pub const SYS_FSTAT: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 28;SYS_FSTATVFS decl
pub const SYS_FSTATVFS: usize = SYS_CLASS_FILE | SYS_ARG_MSLICE | 100;SYS_FSYNC decl
pub const SYS_FSYNC: usize = SYS_CLASS_FILE | 118;SYS_FTRUNCATE decl
pub const SYS_FTRUNCATE: usize = SYS_CLASS_FILE | 93;SYS_FUTIMENS decl
pub const SYS_FUTIMENS: usize = SYS_CLASS_FILE | SYS_ARG_SLICE | 320;SYS_CLOCK_GETTIME decl
pub const SYS_CLOCK_GETTIME: usize = 265;SYS_FUTEX decl
pub const SYS_FUTEX: usize = 240;SYS_MPROTECT decl
pub const SYS_MPROTECT: usize = 125;SYS_MKNS decl
pub const SYS_MKNS: usize = 984;SYS_NANOSLEEP decl
pub const SYS_NANOSLEEP: usize = 162;SYS_YIELD decl
pub const SYS_YIELD: usize = 158;KERNEL_O_RDONLY decl
pub const KERNEL_O_RDONLY: usize = 0x0001_0000;Native kernel open flags (bit positions differ from canonical POSIX).
KERNEL_O_WRONLY decl
pub const KERNEL_O_WRONLY: usize = 0x0002_0000;KERNEL_O_RDWR decl
pub const KERNEL_O_RDWR: usize = 0x0003_0000;KERNEL_O_NONBLOCK decl
pub const KERNEL_O_NONBLOCK: usize = 0x0004_0000;KERNEL_O_APPEND decl
pub const KERNEL_O_APPEND: usize = 0x0008_0000;KERNEL_O_SHLOCK decl
pub const KERNEL_O_SHLOCK: usize = 0x0010_0000;KERNEL_O_EXLOCK decl
pub const KERNEL_O_EXLOCK: usize = 0x0020_0000;KERNEL_O_ASYNC decl
pub const KERNEL_O_ASYNC: usize = 0x0040_0000;KERNEL_O_FSYNC decl
pub const KERNEL_O_FSYNC: usize = 0x0080_0000;KERNEL_O_CLOEXEC decl
pub const KERNEL_O_CLOEXEC: usize = 0x0100_0000;KERNEL_O_CREAT decl
pub const KERNEL_O_CREAT: usize = 0x0200_0000;KERNEL_O_TRUNC decl
pub const KERNEL_O_TRUNC: usize = 0x0400_0000;KERNEL_O_EXCL decl
pub const KERNEL_O_EXCL: usize = 0x0800_0000;KERNEL_O_DIRECTORY decl
pub const KERNEL_O_DIRECTORY: usize = 0x1000_0000;KERNEL_O_STAT decl
pub const KERNEL_O_STAT: usize = 0x2000_0000;KERNEL_O_SYMLINK decl
pub const KERNEL_O_SYMLINK: usize = 0x4000_0000;KERNEL_O_NOFOLLOW decl
pub const KERNEL_O_NOFOLLOW: usize = 0x8000_0000;KERNEL_O_ACCMODE decl
pub const KERNEL_O_ACCMODE: usize = 0x0003_0000;KERNEL_PROT_NONE decl
pub const KERNEL_PROT_NONE: usize = 0x0000_0000;Native kernel mmap flags.
KERNEL_PROT_EXEC decl
pub const KERNEL_PROT_EXEC: usize = 0x0001_0000;KERNEL_PROT_WRITE decl
pub const KERNEL_PROT_WRITE: usize = 0x0002_0000;KERNEL_PROT_READ decl
pub const KERNEL_PROT_READ: usize = 0x0004_0000;KERNEL_MAP_SHARED decl
pub const KERNEL_MAP_SHARED: usize = 0x0001;KERNEL_MAP_PRIVATE decl
pub const KERNEL_MAP_PRIVATE: usize = 0x0002;KERNEL_MAP_FIXED decl
pub const KERNEL_MAP_FIXED: usize = 0x0004;KERNEL_MAP_FIXED_NOREPLACE decl
pub const KERNEL_MAP_FIXED_NOREPLACE: usize = 0x000C;KERNEL_MAP_LAZY decl
pub const KERNEL_MAP_LAZY: usize = 0x0010;posixToKernelOpenFlags decl
pub fn posixToKernelOpenFlags(canonical: u32) usizeConvert canonical POSIX open flags to native kernel open flags.
posixToKernelProt decl
pub fn posixToKernelProt(canonical: u32) usizeConvert canonical mmap prot flags to native kernel prot flags.
posixToKernelMapFlags decl
pub fn posixToKernelMapFlags(canonical: u32) usizeConvert canonical mmap flags to native kernel mmap flags.
SyscallEntry decl
pub const SyscallEntry = structInternal operation identifiers — these are indices into the kernel ops table (see KernelOps in main.zig).
For the kernel personality, we dispatch directly by syscall number since the numbers ARE the kernel's native ABI. This table maps the SYS_* constants to kernel operation indices.
UNIMPLEMENTED decl
pub const UNIMPLEMENTED: SyscallEntry = .{ .op_index = -1, .returns_fd = false };The default operation to return for unimplemented syscalls.
lookup decl
pub fn lookup(syscall_num: usize) ?SyscallEntryTranslate a native kernel syscall number to a kernel operation table index. Returns null for ENOSYS.
personality/src/linux/tables.zig
linux/tables.zig — Linux syscall number definitions and dispatch table.
This file defines the Linux syscall ABI for x86_64, aarch64, and riscv64. Each architecture has its own syscall number assignment; the dispatch table maps from (arch, number) to a kernel operation index.
ABI summary (Linux)
x86_64 (syscall instruction):
- Number in RAX, arguments in RDI, RSI, RDX, R10, R8, R9.
- Return value in RAX (positive or zero on success).
- Error: RAX = -errno (negative errno, 0..=4095 range).
- RCX and R11 are clobbered (RCX = return RIP, R11 = saved RFLAGS).
aarch64 (svc #0):
- Number in X8, arguments in X0..X5.
- Return value in X0.
- Error: X0 in range [-4095..-1] (negative errno).
riscv64 (ecall):
- Number in A7, arguments in A0..A5.
- Return value in A0.
- Error: A0 in range [-4095..-1] (negative errno).
References
- /usr/include/asm/unistd_64.h (x86_64)
- /usr/include/asm/unistd.h (aarch64, riscv64)
- https://github.com/torvalds/linux/tree/master/arch/x86/entry/syscalls
- https://github.com/torvalds/linux/tree/master/include/uapi/asm-generic/unistd.h
SyscallEntry decl
pub const SyscallEntry = structDescribes a syscall table entry.
UNIMPLEMENTED decl
pub const UNIMPLEMENTED: SyscallEntry = .x86_64_table decl
pub const x86_64_table = init:aarch64_table decl
pub const aarch64_table = init:riscv64_table decl
pub const riscv64_table = aarch64_table;Arch decl
pub const Arch = enum(u32)Arch identifier for per-arch table selection.
getTable decl
pub fn getTable(arch: Arch) *const [512]SyscallEntryReturn the syscall table for the given architecture.
personality/src/linux/shim.zig
linux/shim.zig — Translates Linux ABI data structures and arguments into the kernel's canonical internal representation.
Each personality must provide shim functions for every syscall whose arguments include pointers to structures whose layout differs between the foreign OS and the kernel internals, OR whose flag/value constants have different numeric definitions.
The functions here are called from the Linux dispatch table handler in main.zig when the needs_translation flag is set.
linuxToCanonicalOpenFlags decl
pub fn linuxToCanonicalOpenFlags(linux_flags: u32) u32Linux open flags → canonical open flags. Flags not listed here are passed through unchanged.
linuxToCanonicalProt decl
pub fn linuxToCanonicalProt(linux_prot: u32) u32Linux mmap prot flags → canonical prot flags (values are identical).
linuxToCanonicalMapFlags decl
pub fn linuxToCanonicalMapFlags(linux_flags: u32) u32Linux mmap flags → canonical mmap flags.
LinuxStat decl
pub const LinuxStat = extern structLinux struct stat layout (x86_64) → canonical FileStat.
Linux x86_64 struct stat (from <asm/stat.h>):
struct stat {
unsigned long st_dev; // 8 bytes (offset 0)
unsigned long st_ino; // 8 bytes (offset 8)
unsigned long st_nlink; // 8 bytes (offset 16)
unsigned int st_mode; // 4 bytes (offset 24)
unsigned int st_uid; // 4 bytes (offset 28)
unsigned int st_gid; // 4 bytes (offset 32)
unsigned int __pad0; // 4 bytes (offset 36)
unsigned long st_rdev; // 8 bytes (offset 40)
long st_size; // 8 bytes (offset 48)
long st_blksize; // 8 bytes (offset 56)
long st_blocks; // 8 bytes (offset 64)
struct timespec st_atim; // 16 bytes (offset 72)
struct timespec st_mtim; // 16 bytes (offset 88)
struct timespec st_ctim; // 16 bytes (offset 104)
long __unused[3];// 24 bytes (offset 120)
}; // total size = 144 bytestoCanonical decl
pub fn toCanonical(self: *const LinuxStat) types.FileStatConvert a Linux stat to the canonical internal FileStat.
LinuxStatAarch64 decl
pub const LinuxStatAarch64 = extern structLinux struct stat layout (aarch64) — differs from x86_64 in field types.
ARM64 struct stat (from <asm/stat.h>):
struct stat {
unsigned long long st_dev; // 8 (0)
unsigned long long st_ino; // 8 (8)
unsigned int st_mode; // 4 (16)
unsigned int st_nlink; // 4 (20)
unsigned int st_uid; // 4 (24)
unsigned int st_gid; // 4 (28)
unsigned long long st_rdev; // 8 (32)
unsigned long long __pad0; // 8 (40)
long long st_size; // 8 (48)
int st_blksize; // 4 (56)
int __pad1; // 4 (60)
long long st_blocks; // 8 (64)
struct timespec st_atim; // 16 (72)
struct timespec st_mtim; // 16 (88)
struct timespec st_ctim; // 16 (104)
long long __unused[2];// 16 (120)
}; // total = 128 bytes (ARM64 has no padding for alignment)toCanonical decl
pub fn toCanonical(self: *const LinuxStatAarch64) types.FileStatLinuxTimeSpec decl
pub const LinuxTimeSpec = extern structLinux struct timespec (both x86_64 and aarch64):
struct timespec {
long tv_sec; // 8 bytes
long tv_nsec; // 8 bytes
};Note: Linux long is always 8 bytes on x86_64 and aarch64. Our canonical TimeSpec uses i64, i32.
toCanonical decl
pub fn toCanonical(self: *const LinuxTimeSpec) types.TimeSpecfromCanonical decl
pub fn fromCanonical(canon: *const types.TimeSpec) LinuxTimeSpecLinuxCompatTimeSpec decl
pub const LinuxCompatTimeSpec = packed structLinux struct timespec for 32-bit x86 (compat):
struct timespec {
long long tv_sec; // 8 bytes
long tv_nsec; // 4 bytes on 32-bit
};toCanonical decl
pub fn toCanonical(self: *const LinuxCompatTimeSpec) types.TimeSpecLinuxSigaction decl
pub const LinuxSigaction = extern structLinux struct sigaction layout (x86_64):
struct sigaction {
void (*sa_handler)(int); // 8 bytes
unsigned long sa_flags; // 8 bytes
void (*sa_restorer)(void); // 8 bytes
sigset_t sa_mask; // 8 bytes (on x86_64, sigset_t is unsigned long)
};Note: This differs from our canonical sigaction (if any). We'll need this when implementing Linux signal delivery.
LinuxRLimit decl
pub const LinuxRLimit = extern structLinux struct rlimit (x86_64):
struct rlimit {
unsigned long rlim_cur; // 8 bytes
unsigned long rlim_max; // 8 bytes
};LinuxUtsName decl
pub const LinuxUtsName = extern structLinux struct utsname (for uname syscall):
struct utsname {
char sysname[65];
char nodename[65];
char release[65];
char version[65];
char machine[65];
char domainname[65];
};linuxErrnoToCanonical decl
pub fn linuxErrnoToCanonical(linux_errno: i32) i32Linux errno values are identical to our canonical errno values (Linux-compatible from the start). No translation is needed.
canonicalToLinuxResult decl
pub fn canonicalToLinuxResult(result_code: i64, errno: i32) i64Translate a canonical errno to the Linux return convention. Linux returns negative errno in the return register.
personality/src/main.zig
main.zig — Multi-personality syscall dispatch.
Convention
Kernel ops return i32: non-negative=success, negative=-errno. invokeOperation sign-extends i32→isize→usize so negative values survive as large usize. decodeResult reverses this: usize→isize→i32 to extract errno.
get decl
pub fn get(self: *const @This(), index: usize) ?KernelOppersonality_init decl
export fn personality_init(ops: *const KernelOps) voidpersonality_syscall decl
export fn personality_syscall(personality/src/types.zig
types.zig — Shared type definitions for the personality syscall layer.
This file defines the data structures that bridge foreign-OS ABIs and the kernel's internal representation. Each personality shim translates between foreign struct layouts (e.g., Linux struct stat) and these canonical internal types, which are then passed to the kernel operation callbacks.
Canonical internal types
FileStat decl
pub const FileStat = extern structCanonical metadata about a file (bridge between all OS stat variants).
TimeSpec decl
pub const TimeSpec = extern structCanonical time specification.
Map decl
pub const Map = extern structCanonical memory map description.
S_IFMT decl
pub const S_IFMT: u32 = 0o170000;S_IFSOCK decl
pub const S_IFSOCK: u32 = 0o140000;S_IFLNK decl
pub const S_IFLNK: u32 = 0o120000;S_IFREG decl
pub const S_IFREG: u32 = 0o100000;S_IFBLK decl
pub const S_IFBLK: u32 = 0o060000;S_IFDIR decl
pub const S_IFDIR: u32 = 0o040000;S_IFCHR decl
pub const S_IFCHR: u32 = 0o020000;S_IFIFO decl
pub const S_IFIFO: u32 = 0o010000;S_ISUID decl
pub const S_ISUID: u32 = 0o4000;S_ISGID decl
pub const S_ISGID: u32 = 0o2000;S_ISVTX decl
pub const S_ISVTX: u32 = 0o1000;S_IRWXU decl
pub const S_IRWXU: u32 = 0o0700;S_IRUSR decl
pub const S_IRUSR: u32 = 0o0400;S_IWUSR decl
pub const S_IWUSR: u32 = 0o0200;S_IXUSR decl
pub const S_IXUSR: u32 = 0o0100;S_IRWXG decl
pub const S_IRWXG: u32 = 0o0070;S_IRGRP decl
pub const S_IRGRP: u32 = 0o0040;S_IWGRP decl
pub const S_IWGRP: u32 = 0o0020;S_IXGRP decl
pub const S_IXGRP: u32 = 0o0010;S_IRWXO decl
pub const S_IRWXO: u32 = 0o0007;S_IROTH decl
pub const S_IROTH: u32 = 0o0004;S_IWOTH decl
pub const S_IWOTH: u32 = 0o0002;S_IXOTH decl
pub const S_IXOTH: u32 = 0o0001;O_ACCMODE decl
pub const O_ACCMODE: u32 = 0x0003;Canonical open flags (common subset of O_RDONLY, O_WRONLY, O_RDWR etc.)
O_RDONLY decl
pub const O_RDONLY: u32 = 0x0000;O_WRONLY decl
pub const O_WRONLY: u32 = 0x0001;O_RDWR decl
pub const O_RDWR: u32 = 0x0002;O_CREAT decl
pub const O_CREAT: u32 = 0x0040;O_EXCL decl
pub const O_EXCL: u32 = 0x0080;O_NOCTTY decl
pub const O_NOCTTY: u32 = 0x0100;O_TRUNC decl
pub const O_TRUNC: u32 = 0x0200;O_APPEND decl
pub const O_APPEND: u32 = 0x0400;O_NONBLOCK decl
pub const O_NONBLOCK: u32 = 0x0800;O_DSYNC decl
pub const O_DSYNC: u32 = 0x1000;O_DIRECTORY decl
pub const O_DIRECTORY: u32 = 0x2000;O_NOFOLLOW decl
pub const O_NOFOLLOW: u32 = 0x4000;O_CLOEXEC decl
pub const O_CLOEXEC: u32 = 0x8000;O_SYNC decl
pub const O_SYNC: u32 = 0x4010000; // __O_SYNC | O_DSYNC in LinuxSEEK_SET decl
pub const SEEK_SET: u32 = 0;Canonical seek whence.
SEEK_CUR decl
pub const SEEK_CUR: u32 = 1;SEEK_END decl
pub const SEEK_END: u32 = 2;PROT_NONE decl
pub const PROT_NONE: u32 = 0;Canonical mmap prot flags.
PROT_READ decl
pub const PROT_READ: u32 = 1;PROT_WRITE decl
pub const PROT_WRITE: u32 = 2;PROT_EXEC decl
pub const PROT_EXEC: u32 = 4;MAP_SHARED decl
pub const MAP_SHARED: u32 = 0x01;Canonical mmap flags.
MAP_PRIVATE decl
pub const MAP_PRIVATE: u32 = 0x02;MAP_FIXED decl
pub const MAP_FIXED: u32 = 0x10;MAP_ANONYMOUS decl
pub const MAP_ANONYMOUS: u32 = 0x20;MAP_GROWSDOWN decl
pub const MAP_GROWSDOWN: u32 = 0x0100;MAP_DENYWRITE decl
pub const MAP_DENYWRITE: u32 = 0x0800;MAP_EXECUTABLE decl
pub const MAP_EXECUTABLE: u32 = 0x1000;MAP_LOCKED decl
pub const MAP_LOCKED: u32 = 0x2000;MAP_NORESERVE decl
pub const MAP_NORESERVE: u32 = 0x4000;MAP_POPULATE decl
pub const MAP_POPULATE: u32 = 0x8000;SIG_HUP decl
pub const SIG_HUP: u32 = 1;Canonical signal numbers (Linux-compatible as the baseline). Each personality shim maps foreign signals to/from these.
SIG_INT decl
pub const SIG_INT: u32 = 2;SIG_QUIT decl
pub const SIG_QUIT: u32 = 3;SIG_ILL decl
pub const SIG_ILL: u32 = 4;SIG_TRAP decl
pub const SIG_TRAP: u32 = 5;SIG_ABRT decl
pub const SIG_ABRT: u32 = 6;SIG_EMT decl
pub const SIG_EMT: u32 = 7;SIG_FPE decl
pub const SIG_FPE: u32 = 8;SIG_KILL decl
pub const SIG_KILL: u32 = 9;SIG_BUS decl
pub const SIG_BUS: u32 = 10;SIG_SEGV decl
pub const SIG_SEGV: u32 = 11;SIG_SYS decl
pub const SIG_SYS: u32 = 12;SIG_PIPE decl
pub const SIG_PIPE: u32 = 13;SIG_ALRM decl
pub const SIG_ALRM: u32 = 14;SIG_TERM decl
pub const SIG_TERM: u32 = 15;SIG_URG decl
pub const SIG_URG: u32 = 16;SIG_STOP decl
pub const SIG_STOP: u32 = 17;SIG_TSTP decl
pub const SIG_TSTP: u32 = 18;SIG_CONT decl
pub const SIG_CONT: u32 = 19;SIG_CHLD decl
pub const SIG_CHLD: u32 = 20;SIG_TTIN decl
pub const SIG_TTIN: u32 = 21;SIG_TTOU decl
pub const SIG_TTOU: u32 = 22;SIG_IO decl
pub const SIG_IO: u32 = 23;SIG_XCPU decl
pub const SIG_XCPU: u32 = 24;SIG_XFSZ decl
pub const SIG_XFSZ: u32 = 25;SIG_VTALRM decl
pub const SIG_VTALRM: u32 = 26;SIG_PROF decl
pub const SIG_PROF: u32 = 27;SIG_WINCH decl
pub const SIG_WINCH: u32 = 28;SIG_INFO decl
pub const SIG_INFO: u32 = 29;SIG_USR1 decl
pub const SIG_USR1: u32 = 30;SIG_USR2 decl
pub const SIG_USR2: u32 = 31;SIG_MAX decl
pub const SIG_MAX: u32 = 31;Maximum canonical signal number.
EPERM decl
pub const EPERM: i32 = 1;Canonical errno constants (Linux-compatible; the kernel's internal error space already uses these values — see syscall/src/error.rs).
Each personality shim translates between foreign errno values and these internal ones. The kernel operation callbacks return these values.
ENOENT decl
pub const ENOENT: i32 = 2;ESRCH decl
pub const ESRCH: i32 = 3;EINTR decl
pub const EINTR: i32 = 4;EIO decl
pub const EIO: i32 = 5;ENXIO decl
pub const ENXIO: i32 = 6;E2BIG decl
pub const E2BIG: i32 = 7;ENOEXEC decl
pub const ENOEXEC: i32 = 8;EBADF decl
pub const EBADF: i32 = 9;ECHILD decl
pub const ECHILD: i32 = 10;EAGAIN decl
pub const EAGAIN: i32 = 11;ENOMEM decl
pub const ENOMEM: i32 = 12;EACCES decl
pub const EACCES: i32 = 13;EFAULT decl
pub const EFAULT: i32 = 14;ENOTBLK decl
pub const ENOTBLK: i32 = 15;EBUSY decl
pub const EBUSY: i32 = 16;EEXIST decl
pub const EEXIST: i32 = 17;EXDEV decl
pub const EXDEV: i32 = 18;ENODEV decl
pub const ENODEV: i32 = 19;ENOTDIR decl
pub const ENOTDIR: i32 = 20;EISDIR decl
pub const EISDIR: i32 = 21;EINVAL decl
pub const EINVAL: i32 = 22;ENFILE decl
pub const ENFILE: i32 = 23;EMFILE decl
pub const EMFILE: i32 = 24;ENOTTY decl
pub const ENOTTY: i32 = 25;ETXTBSY decl
pub const ETXTBSY: i32 = 26;EFBIG decl
pub const EFBIG: i32 = 27;ENOSPC decl
pub const ENOSPC: i32 = 28;ESPIPE decl
pub const ESPIPE: i32 = 29;EROFS decl
pub const EROFS: i32 = 30;EMLINK decl
pub const EMLINK: i32 = 31;EPIPE decl
pub const EPIPE: i32 = 32;EDOM decl
pub const EDOM: i32 = 33;ERANGE decl
pub const ERANGE: i32 = 34;EDEADLK decl
pub const EDEADLK: i32 = 35;ENAMETOOLONG decl
pub const ENAMETOOLONG: i32 = 36;ENOLCK decl
pub const ENOLCK: i32 = 37;ENOSYS decl
pub const ENOSYS: i32 = 38;ENOTEMPTY decl
pub const ENOTEMPTY: i32 = 39;ELOOP decl
pub const ELOOP: i32 = 40;EWOULDBLOCK decl
pub const EWOULDBLOCK: i32 = 41;ENOMSG decl
pub const ENOMSG: i32 = 42;EIDRM decl
pub const EIDRM: i32 = 43;ECHRNG decl
pub const ECHRNG: i32 = 44;EL2NSYNC decl
pub const EL2NSYNC: i32 = 45;EL3HLT decl
pub const EL3HLT: i32 = 46;EL3RST decl
pub const EL3RST: i32 = 47;ELNRNG decl
pub const ELNRNG: i32 = 48;EUNATCH decl
pub const EUNATCH: i32 = 49;ENOCSI decl
pub const ENOCSI: i32 = 50;EL2HLT decl
pub const EL2HLT: i32 = 51;EBADE decl
pub const EBADE: i32 = 52;EBADR decl
pub const EBADR: i32 = 53;EXFULL decl
pub const EXFULL: i32 = 54;ENOANO decl
pub const ENOANO: i32 = 55;EBADRQC decl
pub const EBADRQC: i32 = 56;EBADSLT decl
pub const EBADSLT: i32 = 57;EDEADLOCK decl
pub const EDEADLOCK: i32 = 58;EBFONT decl
pub const EBFONT: i32 = 59;ENOSTR decl
pub const ENOSTR: i32 = 60;ENODATA decl
pub const ENODATA: i32 = 61;ETIME decl
pub const ETIME: i32 = 62;ENOSR decl
pub const ENOSR: i32 = 63;ENONET decl
pub const ENONET: i32 = 64;ENOPKG decl
pub const ENOPKG: i32 = 65;EREMOTE decl
pub const EREMOTE: i32 = 66;ENOLINK decl
pub const ENOLINK: i32 = 67;EADV decl
pub const EADV: i32 = 68;ESRMNT decl
pub const ESRMNT: i32 = 69;ECOMM decl
pub const ECOMM: i32 = 70;EPROTO decl
pub const EPROTO: i32 = 71;EMULTIHOP decl
pub const EMULTIHOP: i32 = 72;EDOTDOT decl
pub const EDOTDOT: i32 = 73;EBADMSG decl
pub const EBADMSG: i32 = 74;EOVERFLOW decl
pub const EOVERFLOW: i32 = 75;ENOTUNIQ decl
pub const ENOTUNIQ: i32 = 76;EBADFD decl
pub const EBADFD: i32 = 77;EREMCHG decl
pub const EREMCHG: i32 = 78;ELIBACC decl
pub const ELIBACC: i32 = 79;ELIBBAD decl
pub const ELIBBAD: i32 = 80;ELIBSCN decl
pub const ELIBSCN: i32 = 81;ELIBMAX decl
pub const ELIBMAX: i32 = 82;ELIBEXEC decl
pub const ELIBEXEC: i32 = 83;EILSEQ decl
pub const EILSEQ: i32 = 84;ERESTART decl
pub const ERESTART: i32 = 85;ESTRPIPE decl
pub const ESTRPIPE: i32 = 86;EUSERS decl
pub const EUSERS: i32 = 87;ENOTSOCK decl
pub const ENOTSOCK: i32 = 88;EDESTADDRREQ decl
pub const EDESTADDRREQ: i32 = 89;EMSGSIZE decl
pub const EMSGSIZE: i32 = 90;EPROTOTYPE decl
pub const EPROTOTYPE: i32 = 91;ENOPROTOOPT decl
pub const ENOPROTOOPT: i32 = 92;EPROTONOSUPPORT decl
pub const EPROTONOSUPPORT: i32 = 93;ESOCKTNOSUPPORT decl
pub const ESOCKTNOSUPPORT: i32 = 94;EOPNOTSUPP decl
pub const EOPNOTSUPP: i32 = 95;EPFNOSUPPORT decl
pub const EPFNOSUPPORT: i32 = 96;EAFNOSUPPORT decl
pub const EAFNOSUPPORT: i32 = 97;EADDRINUSE decl
pub const EADDRINUSE: i32 = 98;EADDRNOTAVAIL decl
pub const EADDRNOTAVAIL: i32 = 99;ENETDOWN decl
pub const ENETDOWN: i32 = 100;ENETUNREACH decl
pub const ENETUNREACH: i32 = 101;ENETRESET decl
pub const ENETRESET: i32 = 102;ECONNABORTED decl
pub const ECONNABORTED: i32 = 103;ECONNRESET decl
pub const ECONNRESET: i32 = 104;ENOBUFS decl
pub const ENOBUFS: i32 = 105;EISCONN decl
pub const EISCONN: i32 = 106;ENOTCONN decl
pub const ENOTCONN: i32 = 107;ESHUTDOWN decl
pub const ESHUTDOWN: i32 = 108;ETOOMANYREFS decl
pub const ETOOMANYREFS: i32 = 109;ETIMEDOUT decl
pub const ETIMEDOUT: i32 = 110;ECONNREFUSED decl
pub const ECONNREFUSED: i32 = 111;EHOSTDOWN decl
pub const EHOSTDOWN: i32 = 112;EHOSTUNREACH decl
pub const EHOSTUNREACH: i32 = 113;EALREADY decl
pub const EALREADY: i32 = 114;EINPROGRESS decl
pub const EINPROGRESS: i32 = 115;ESTALE decl
pub const ESTALE: i32 = 116;EUCLEAN decl
pub const EUCLEAN: i32 = 117;ENOTNAM decl
pub const ENOTNAM: i32 = 118;ENAVAIL decl
pub const ENAVAIL: i32 = 119;EISNAM decl
pub const EISNAM: i32 = 120;EREMOTEIO decl
pub const EREMOTEIO: i32 = 121;EDQUOT decl
pub const EDQUOT: i32 = 122;ENOMEDIUM decl
pub const ENOMEDIUM: i32 = 123;EMEDIUMTYPE decl
pub const EMEDIUMTYPE: i32 = 124;ECANCELED decl
pub const ECANCELED: i32 = 125;ENOKEY decl
pub const ENOKEY: i32 = 126;EKEYEXPIRED decl
pub const EKEYEXPIRED: i32 = 127;EKEYREVOKED decl
pub const EKEYREVOKED: i32 = 128;EKEYREJECTED decl
pub const EKEYREJECTED: i32 = 129;EOWNERDEAD decl
pub const EOWNERDEAD: i32 = 130;ENOTRECOVERABLE decl
pub const ENOTRECOVERABLE: i32 = 131;