• Customers
  • Pricing
  • Docs
Sign Up

Compute Glossary

How computers for agents work, from the hardware to the sandbox.

  1. Compute Glossary
  2. /
  3. Kernel

System call

Also called Syscall

DeviceKernelSystem call tableSwitch to kernel modeLibrary wrapperProgram

A system call is the interface through which a program in user mode asks the kernel to do work that only the kernel may do. Everything a process does beyond pure computation passes through one. Pure computation, such as adding numbers in registers, runs on the processor without the kernel. Even ending a program takes a system call, as does asking for more memory.

A program that wants to read a file or send data over the network cannot reach the disk or the network card itself. It makes a system call, and the kernel decides whether to allow the request. The program never touches the device, so the kernel can share it safely among many programs. The same check also enforces who may read which file.

Because every request to the kernel goes through a system call, the set of calls a program can make is its attack surface on the kernel. Seccomp filters shrink that set, and a virtual machine sends the calls of a guest to a kernel of its own. In a guest, a bug reached through a system call compromises only the guest kernel. The hypervisor still stands between that kernel and the host.

Entry into the kernel

Entry into the kernel is the switch a system call makes from user mode to kernel mode. The program places a number that identifies the call, and its arguments, in registers, then executes a special instruction. Which register holds what is fixed for each architecture, so the kernel always knows where to look. Before dedicated instructions existed, programs entered the kernel through a software interrupt, which was slower.

The processor switches to kernel mode and jumps to a fixed entry point. The kernel looks up the handler for that number, carries out the request, and returns a result or an error code to user mode. A call that has to wait, such as a read from a slow disk, puts the thread to sleep while the kernel runs other work. Interfaces such as io_uring let a program queue many requests and collect the results without one call per request.

A system call costs far more than a function call, because of the switch and the mitigations for speculative-execution attacks. Linux avoids the switch for a few read-only calls, such as reading the clock, by mapping a small piece of kernel code called the vDSO into every process. Batching requests is the usual way for a program to pay that cost less often. A server that handles many small messages can spend more time entering and leaving the kernel than doing its own work.

ArchitectureDescription
x86-64Programs enter the kernel with the syscall instruction.
AArch64Programs enter the kernel with the svc instruction.

Wrappers

Wrappers are ordinary library functions that make system calls for a program. The C library wraps most calls in functions of the same name, and higher-level languages wrap those again. The wrapper puts the arguments where the kernel expects them and turns an error into a value the program can check. Go on Linux is an exception, since its runtime makes system calls directly without the C library.

Few programs therefore make system calls by hand. A single line of application code can turn into many system calls, and tracing tools such as strace make them visible on Linux. Printing a line, for example, may make no call at all until the buffer of the library fills. Tracing shows where a slow program waits on the kernel.

Wrappers also hide the differences between kernels and architectures from application code. The same program source can then be built for many systems without changes to its calls. The POSIX standard defines many of these functions, so they behave alike across Unix-like systems. Windows goes further and keeps its system calls private, so programs reach the kernel only through its libraries.

Interface stability

Interface stability is the promise that the calls a kernel offers keep working across versions. On Linux, a call that worked years ago keeps working, which is why old binaries still run on new kernels. Other systems, such as macOS and OpenBSD, promise stability only for the C library and may change the calls beneath it. Linux has no C library of its own, which is why its kernel keeps the promise itself.

The interface is still not the same everywhere. The set of calls and their numbers differ by instruction set architecture, so a binary built for one cannot use the calls of another. Even on one architecture, a call can exist in several versions, because a newer call is added rather than the old one changed. Old calls stay in place beside the new ones, so the list only grows.

Stability also lets other software stand in for the kernel. The gVisor runtime answers the system calls of a sandboxed program in a user-space kernel of its own, which works because the interface it copies does not change. The first Windows Subsystem for Linux worked the same way, answering the calls of Linux programs on top of the Windows kernel. Any call such a layer gets wrong shows up as a program that fails there but works on Linux.

Related terms

  • Kernel
  • Process
  • Seccomp
  • CPU architecture
  • Isolation
PreviousKernelNextProcess

On this page

Compute Glossary
  1. Foundations
    • Sandbox
    • Virtual machine
    • vCPU
    • Block storage
    • Virtual network interface
    • Kernel
    • Hardware virtualization
    • Hypervisor
    • GPU
    • CPU core
    • Memory
    • CPU
    • Local disk
    • Network interface card
    • Compute
    • Workload
    • Latency
  2. Sandboxes
    • Isolation
    • Lifecycle
    • Snapshot
    • Persistence
  3. Virtualization
    • KVM
    • MicroVM
    • Container
  4. Hardware
    • Server
    • CPU architecture
    • CPU type
    • GPU memory
    • GPU model
    • Mac model
  5. Kernel
    • System call
    • Process
    • Memory page
    • Namespace
    • Control group
    • Seccomp
  6. Storage
    • Object storage
    • File system
  7. Networking
    • Egress control
    • SSH
  8. Infrastructure
    • Control plane
    • Scheduler
    • Overcommit
    • Preemption
    • Region
    • Capacity
    • Scale
  9. Agents
    • AI agent
    • Tool call
    • Untrusted code
  10. Reinforcement learning
    • Reinforcement learning
    • Environment
    • Rollout
    • Verifier
    • Reward hacking
    • Actor–learner architecture

Computersfor Agents

Isolated sandboxes for agent code,
ready in under 100 ms.

Start for Free

Subscribe to DotFiles Insider, our monthly digest of AI infrastructure news, deep dives, and Daytona product releases.

Company

  • About
  • Careers
  • Brand
  • Partners
  • Startup Program
  • Research Grants
  • Events
  • Contact

Product

  • Pricing
  • Docs
  • Changelog

Resources

  • Guides
  • Blog

Legal

  • DPA
  • SLA
  • Terms of Service
  • Privacy Policy
Trust Center
All Systems Operational