Map files into process virtual memory with mmap() and msync(), coordinate concurrent writers with fcntl() byte-range record locks and flock(), and build local IPC pipelines over pipe2(), mkfifo(), and POSIX shm_open() shared memory.
Trace packet encapsulation across OSI and TCP/IP layers, manipulate IPv4/IPv6 CIDR subnets and network byte order cleanly, and decode 20-byte TCP headers, RFC 1071 pseudo-header checksums, and 3-way/4-way connection state transitions.
Author out-of-source ISO C11 CMake build graphs, propagate PRIVATE/PUBLIC/INTERFACE usage requirements, generate headers via configure_file(), and cross-compile multi-directory trees with toolchain files.
Encode and decode OASIS MQTT 3.1.1 binary control packets, implement QoS 0/1/2, Retained, LWT, and KeepAlive state machines, and integrate CMake + nonblocking epoll into a deterministic MQTT client.
Welcome to Course 3 (GL-C03) in the Linux Systems Programming in C11 track. Building on GL-C01 open-file descriptions and GL-C02 process, signal, and thread primitives, you will contrast TASK_INTERRUPTIBLE wait-queue sleep against O_NONBLOCK status flags, handle EAGAIN and EWOULDBLOCK safely, and quantify why unthrottled polling loops waste 100% of a CPU core.
Unthrottled O_NONBLOCK loops burn 100% CPU while blocking read() stalls on the first quiet stream. You will multiplex nonblocking channels at 0% idle CPU with select() and poll(), contrast destructive 1024-bit fd_set bitmasks against reusable struct pollfd arrays, prevent FD_SETSIZE stack overflows, and quantify stateless O(N) kernel scan costs.
Evaluate O_ASYNC/F_SETSIG signal-driven I/O hazards, epoll readiness, and Linux 6.12 io_uring SQ/CQ rings. Register descriptors in epollO(log N) red-black trees (epoll_ctl) and harvest O(1) events via epoll_wait(). Write EPOLLETO_NONBLOCK drain-to-EAGAIN loops with eventfd() shutdown wakeups and EPOLLONESHOT safety.
Map files into process virtual memory with mmap() and msync(), coordinate concurrent writers with fcntl() byte-range record locks and flock(), and build local IPC pipelines over pipe2(), mkfifo(), and POSIX shm_open() shared memory.
Contrast cooperative advisory locking on Linux against deprecated System V mandatory locking (S_ISGID mode bits). Use whole-file BSD flock(LOCK_SH | LOCK_EX | LOCK_NB) locks bound to struct file across dup() and fork(). Implement byte-range POSIX fcntl(F_SETLK) and Linux F_OFD_SETLK (l_pid = 0) locks without close() lock loss.
Build pipe2(O_CLOEXEC) byte streams using <= PIPE_BUF (4096 B) atomic writes and strict unused-fd close() discipline. Configure mkfifo()S_IFIFO rendezvous nodes enabling unrelated local processes to stream through kernel RAM. Construct zero-copy shm_open and memfd_create (F_ADD_SEALS) MAP_SHARED rings synchronized with sem_t.
├── m03/ Network Architecture, IP Addressing & TCP Wire
Trace packet encapsulation across OSI and TCP/IP layers, manipulate IPv4/IPv6 CIDR subnets and network byte order cleanly, and decode 20-byte TCP headers, RFC 1071 pseudo-header checksums, and 3-way/4-way connection state transitions.
Differentiate Layer-2 48-bit MAC LAN frame switching from Layer-3 IP routing that rewrites link headers per hop. Trace TCP/UDP segment, IPv4/IPv6 packet, and 14-byte Ethernet II encapsulation yielding MSS = 1460 at MTU = 1500. Apply <arpa/inet.h>htons(), htonl(), ntohs(), and ntohl() conversions with alignment-safe memcpy() loads.
Configure SOCK_STREAM | SOCK_CLOEXEC listeners with SO_REUSEADDR and SO_REUSEPORT before bind() and listen(). Execute collision-free loopback socket tests by binding 127.0.0.1 port htons(0) and querying getsockname(). Build [uint32_t be_len][payload] TCP framing using scatter-gather writev(), recv_exact(), and shutdown(SHUT_WR).
Use SOCK_DGRAMsendto()/recvfrom() to preserve 1-to-1 datagram boundaries and connected UDP to surface ECONNREFUSED. Diagnose truncated UDP packets via MSG_TRUNC, bound blocking reads via SO_RCVTIMEO, and batch recvmmsg(). Implement dual-stack getaddrinfo()/freeaddrinfo() endpoint resolution alongside AF_UNIXsocketpair() IPC.
├── m05/ Modern CMake Build Systems & Cross-Toolchains
Author out-of-source ISO C11 CMake build graphs, propagate PRIVATE/PUBLIC/INTERFACE usage requirements, generate headers via configure_file(), and cross-compile multi-directory trees with toolchain files.
Execute out-of-source CMake workflows (cmake -S . -B build) with -MMD -MP header tracking and compile_commands.json. Configure cmake_minimum_required(VERSION 3.16) and project(... LANGUAGES C) to lock policies and skip C++ probes. Build STATIC.a archives, -fPICSHARED.so libraries (OUTPUT_NAME), and sanitizer builds in PROJECT_BINARY_DIR.
Apply PRIVATE, PUBLIC, and INTERFACE target usage requirements cleanly across target_link_libraries() DAG edges. Configure strict ISO C11 (-std=c11) compilation with CMAKE_C_STANDARD 11, STANDARD_REQUIRED ON, and EXTENSIONS OFF. Select persistent option() cache flags in CMakeCache.txt versus lexical function() variables with PARENT_SCOPE.
Encode and decode OASIS MQTT 3.1.1 binary control packets, implement QoS 0/1/2, Retained, LWT, and KeepAlive state machines, and integrate CMake + nonblocking epoll into a deterministic MQTT client.
Trace MQTT QoS 0, QoS 1 (PUBACK, DUP=1), and QoS 2 (PUBREC/PUBREL/PUBCOMP) under min(pub_qos, sub_qos). Configure RETAIN=1 last-known-good broker state caches and clear stale retained entries via zero-byte retained payloads. Diagnose Last Will & Testament (LWT) triggers across 1.5 * KeepAlivePINGREQ/PINGRESP timeouts vs DISCONNECT (0xE0).
Leitner spaced-repetition terminal cards and TSV deck for syscalls, flags, and pitfalls.
# Kernel Systems Academy engineering studio
Every Kernel Systems Academy course follows our 35% principles / 20% guided investigation / 45% engineering studio pedagogy. Listings are compiled against Linux 6.12 · C11 · glibc 2.39 under strict compiler flags (-Wall -Wextra -Werror), and each module culminates in an evidence-checked lab graded locally by ./check.sh.
Unlock GL-C03 + All 16 KSA Terminal Courses (Linux 6.12 · ISO C11)
US$39/month · US$349/year (save 25% · 3 months free) · Team US$290/seat/year (3+ seats, Card or Net-30 PO invoice). Opening preview lessons & Lab 1 are free.
# Frequently asked questions
Can I study this course offline from disk?
Yes. All fonts, stylesheets, diagrams, search indexes, and progress trackers use relative paths and local browser storage, so the bundle works identically over HTTP and file://.
How are the hands-on labs graded?
Each lab directory includes starter source files and an executable ./check.sh runner emitting TAP version 13 diagnostics (ok / not ok) and exiting 0 when every check passes.
What is included in the free preview?
Preview lessons and the opening module lab are unlocked in full so you can inspect our C11 listings, strace transcripts, and ./check.sh workflow before subscribing.