Skip to content

Glossary

BSD syscall

The POSIX-shaped syscall family in XNU — open, read, write, fork, kqueue, and ~480 others. Positive syscall numbers, errno semantics.

A BSD syscall is an entry in XNU's BSD personality — the half of the kernel inherited from 4.4BSD. Every POSIX call you know lives here: open, read, write, fork, execve, mmap, plus Darwin-specific extensions like kqueue and csops.

Two defining traits:

  • Positive syscall number. Stored in x16 on arm64, EAX (with class bits) on x86_64.
  • errno semantics. A non-zero return from the kernel sets the carry flag; the user-space stub stuffs the value into errno and returns -1.

The full table is declared in bsd/kern/syscalls.master. Dispatch goes through unix_syscall64() in bsd/dev/arm64/systemcalls.c.

Contrast with Mach trap — the other syscall family, with negative numbers and kern_return_t semantics.