AsAssembly · Lesson 7 of 10
System Calls
A syscall is the gate between user space and the kernel. Reading files, writing to the terminal, allocating memory, creating threads — all of it goes through syscalls. In x86-64 Linux, the interface is beautifully simple.
✦ Tip
The syscall table is in `/usr/include/asm/unistd_64.h` or at `man 2 syscalls`. You can also trace syscalls of any running program with `strace ./program` — this is incredibly useful for understanding what your OS is doing and for debugging segfaults that happen inside libc.
The syscall table is in `/usr/include/asm/unistd_64.h` or at `man 2 syscalls`. You can also trace syscalls of any running program with `strace ./program` — this is incredibly useful for understanding what your OS is doing and for debugging segfaults that happen inside libc.