Chapter 6: System Programming
Sections 61--70 System programming is where C shines -- and where Auto chooses a different path.
C was born to write operating systems. Its standard library sits directly on top of kernel system calls, and every C programmer eventually learns about file descriptors, processes, signals, and memory mapping. Auto takes a higher-level approach: it wraps the dangerous primitives in safe APIs and does not expose raw syscalls.
This chapter is heavy on C-only concepts. We present them as essential knowledge for understanding how programs interact with the operating system, then show Auto's simplified alternatives where they exist.
61. System Calls vs Standard Library
Every operating system provides a set of system calls -- functions that request services from the kernel. In C, you can call them directly:
/* Raw syscall */
ssize_t n = read(fd, buffer, sizeof(buffer));
/* Stdlib wrapper (buffers data, more portable) */
size_t n = fread(buffer, 1, sizeof(buffer), file);The standard library wraps raw syscalls with buffering, error handling, and portability. fread() calls read() internally but adds a user-space buffer.
Auto goes further: functions like print(), read_file(), and write_file() hide all the syscall details entirely. You never deal with file descriptors or buffer management.