#separator:tab
#html:false
front	back	tags
What is Application Binary Interface (ABI)?	Named as the binary counterpart to a source-level Application Programming Interface, an ABI fixes register assignments, stack alignment (`16`-byte on x86-64 System V, `8`-byte on ARMv7 AAPCS), struct padding, and syscall trap conventions (`syscall` on x86-64, `svc	course:linux-c-sysio glossary
What is Auxiliary Vector (`auxv`)?	Named for the auxiliary `(key, value)` pairs appended by the Linux kernel `execve()` loader immediately after `envp[]` on the initial user stack, delivering hardware capabilities, `AT_PAGESZ`, and the `AT_SYSINFO_EHDR` base address of `linux-vdso.so.1` without extra syscalls.	course:linux-c-sysio glossary
What is Container-Of Macro (`CONTAINER_OF`)?	Named from intrusive object containment in the Linux kernel (`include/linux/container_of.h`), a compile-time type-checked macro combining `_Generic` or `typeof` with `offsetof(type, member)` over `char *` arithmetic to recover an enclosing structure pointer from an embedded field pointer.	course:linux-c-sysio glossary
What is Cyclic Redundancy Check (`CRC32`)?	Coined by W. Wesley Peterson in 1961 from polynomial division over $GF(2)$, the reflected IEEE 802.3 CRC32 (`0xEDB88320U`) detects burst bit errors, torn writes, and stale zeroed sectors inside binary Write-Ahead Log frames.	course:linux-c-sysio glossary
What is Direct I/O (`O_DIRECT`)?	Named for bypassing the Linux kernel page cache so user-space buffers transfer directly via storage controller Direct Memory Access (DMA), requiring memory address, transfer length, and file offset alignment to `statx()` `STATX_DIOALIGN` boundaries.	course:linux-c-sysio glossary
What is Directory Entry (`dentry`)?	Coined in the Linux Virtual File System (VFS) for a human-readable `(name, inode_number)` mapping cached in the kernel dcache; unlinking a dentry decrements `st_nlink`, whereas storage blocks persist until both `st_nlink == 0` and open `struct file` references drop to zero.	course:linux-c-sysio glossary
What is Dynamic Loader Trampoline (`.plt` / `.got.plt`)?	Named for the Executable and Linkable Format (ELF) Procedure Linkage Table and Global Offset Table, an indirect jump table patched by `ld-linux` so position-independent user code resolves shared `glibc` symbols at runtime.	course:linux-c-sysio glossary
What is End-Of-File Sentinel (`EOF`)?	Named in standard `<stdio.h>` for the negative `int` sentinel (typically `-1`) returned by `fgetc()` outside the `256` valid `unsigned char` byte values (`0x00..0xFF`), requiring an `int` receiver variable rather than `char` to prevent `0xFF` truncation or sign-extension bugs.	course:linux-c-sysio glossary
What is Executable and Linkable Format (`ELF`)?	Standardized by the Unix System Laboratories ABI for relocatable (`.o`), executable, and shared (`.so`) binaries, separating read-only instructions (`.text`), initialized data (`.data`), zero-initialized storage (`.bss`), and symbol tables (`.symtab`, `.dynsym`).	course:linux-c-sysio glossary
What is Feature Test Macro (`_POSIX_C_SOURCE`)?	Standardized by IEEE Std 1003.1 (`POSIX`) to gate which declarations system headers expose above baseline ISO C11; it must be defined before the very first `#include` directive in every translation unit.	course:linux-c-sysio glossary
What is File Creation Mask (`umask`)?	Named from "user file-creation mode mask" in Version 7 Unix, a per-process octal bitmask stored in `current->fs->umask` that clears permission bits during `open(..., O_CREAT, mode)` via `effective_mode = mode & ~umask`.	course:linux-c-sysio glossary
What is File Data Synchronization (`fdatasync`)?	Standardized by POSIX.1b real-time extensions to flush dirty page-cache folios and only metadata required to retrieve those bytes (such as `st_size` changes), skipping non-essential timestamp journal commits incurred by full `fsync()`.	course:linux-c-sysio glossary
What is File Descriptor (`fd`)?	Coined in early Unix for a non-negative `int` array index into a process's private `files_struct` descriptor table (`0` `STDIN_FILENO`, `1` `STDOUT_FILENO`, `2` `STDERR_FILENO`), allocated from the lowest unused slot unless pinned via `dup2()` or `dup3()`.	course:linux-c-sysio glossary
What is Index Node (`inode`)?	Named by Dennis Ritchie for "index node" in the original Unix filesystem, the metadata record storing numeric ownership, `st_mode`, `st_size`, `st_blocks`, link count (`st_nlink`), and physical block extents—intentionally excluding filenames.	course:linux-c-sysio glossary
What is Open File Description (`struct file`)?	The middle tier of the Linux kernel three-table VFS hierarchy allocated per `openat()` call, holding mutable session state (`f_pos` byte offset, `f_flags` status bits, `f_op` dispatch table, and `f_count` reference count across `dup()` and `fork()`).	course:linux-c-sysio glossary
What is Page Cache?	The RAM-resident radix/XArray folio cache (`struct address_space`) managed by the Linux kernel between VFS `read()`/`write()` syscalls and block devices; dirty pages survive `SIGKILL` of a user process but vanish on sudden power loss unless flushed via `fsync()` or `fdatasync()`.	course:linux-c-sysio glossary
What is Positional I/O (`pread` / `pwrite`)?	Introduced in UNIX System V Release 4 and POSIX.1-2001 ("positional read/write") to transfer bytes at an explicit `off_t offset` in a single atomic syscall without reading or mutating the shared `struct file.f_pos` cursor.	course:linux-c-sysio glossary
What is Signed Byte Count (`ssize_t`)?	Standardized by POSIX ("signed size type") with ceiling `SSIZE_MAX` so `read()`, `write()`, `pread()`, and `pwrite()` can return a non-negative byte count (`0..MAX_RW_COUNT`, `0x7ffff000` on Linux) alongside the `-1` error sentinel.	course:linux-c-sysio glossary
What is Sparse File Extent Hole?	A logical byte range created by advancing `f_pos` past `EOF` with `lseek()` (or `ftruncate()`) without writing bytes; the filesystem allocates `0` physical `512`-byte sectors (`st_blocks`) for the hole while VFS synthesizes `0x00` bytes on read.	course:linux-c-sysio glossary
What is Standard I/O Stream (`FILE`)?	An opaque user-space control block managed by `glibc` `<stdio.h>` containing a heap or caller-supplied byte buffer, read/write cursors, `_IOFBF`/`_IOLBF`/`_IONBF` mode flags, sticky `EOF`/error indicators, and an underlying POSIX `fd`.	course:linux-c-sysio glossary
What is Thread-Local Error Number (`errno`)?	Originally a global `int` in early Unix and redefined since ISO C99/POSIX threads as a modifiable thread-local lvalue (`*__errno_location()`), populated by `glibc` wrappers only when a raw kernel syscall returns an architecture-specific negative `-errno` value.	course:linux-c-sysio glossary
What is Time-Of-Check to Time-Of-Use (`TOCTOU`)?	Coined in 1970s operating-system security audits for a race window between inspecting a pathname (`access()` or `stat()`) and acting on it (`open()`), eliminated by atomic single-lookup kernel primitives (`O_CREAT | O_EXCL` and directory-pinned `openat()`).	course:linux-c-sysio glossary
What is Undefined Behavior (`UB`)?	Defined in ISO/IEC 9899:2011 (`C11` §3.4.3) as constructs—such as signed integer overflow, strict-aliasing violations, uninitialized reads, or shifting `1 << 31`—for which the standard imposes zero requirements, permitting optimizing compilers to elide surrounding safety checks.	course:linux-c-sysio glossary
What is Virtual Dynamic Shared Object (`vDSO`)?	Mapped into every user address space as `linux-vdso.so.1` by the Linux kernel `execve()` loader, exposing read-only kernel timekeeper pages and Ring 3 helper functions (`clock_gettime`, `gettimeofday`) that read hardware counters with zero Ring 0 trap overhead.	course:linux-c-sysio glossary
What is Write-Ahead Log (`WAL`)?	Originated in ARIES database recovery architecture, an append-only binary log where every mutation is framed with magic bytes, a monotonic `64`-bit sequence number, payload lengths, and a `CRC32` checksum and flushed via `fdatasync()` before acknowledgment so startup `ftruncate()` heals torn tails deterministically.	course:linux-c-sysio glossary
Define vDSO Shared User-Space Timekeeping Page.	Read-only kernel-mapped ELF object (linux-vdso.so.1, exposed via AT_SYSINFO_EHDR) allowing latency-critical queries like clock_gettime() to read kernel timekeeper sequence counters in Ring 3 / EL0 with zero privilege-switching traps.	course:linux-c-sysio concept
Misconception check: vDSO Shared User-Space Timekeeping Page. What do people get wrong, and why is it wrong?	Assuming every POSIX system interface visible in section-2 documentation triggers a kernel trap in strace, causing engineers to misdiagnose missing clock_gettime() lines in strace or over-budget timestamping overhead.	course:linux-c-sysio misconception
Define ISO C11 Behavior Taxonomy & Sanitizer Gate.	Partition of ISO C11 semantics into Well-Defined, Unspecified, Implementation-Defined (such as ARM unsigned char vs x86_64 signed char), and Undefined Behavior (signed overflow, shift >= width, strict-aliasing violations), verified dynamically via -fsanitize=address,undefined.	course:linux-c-sysio concept
Misconception check: ISO C11 Behavior Taxonomy & Sanitizer Gate. What do people get wrong, and why is it wrong?	Treating signed integer overflow or pointer type-punning as benign hardware behavior, only to have GCC -O2 delete overflow/NULL guards under the C11 as-if rule or reorder loads under -fstrict-aliasing.	course:linux-c-sysio misconception
Define Tentative Definitions & ELF Symbol Visibility.	C11 linkage rule where uninitialized file-scope declarations without extern emit distinct .bss symbols that collide under GCC 10+ -fno-common, paired with static/visibility control over STB_LOCAL vs STB_GLOBAL ELF symbol tables.	course:linux-c-sysio concept
Misconception check: Tentative Definitions & ELF Symbol Visibility. What do people get wrong, and why is it wrong?	Placing int err_count; in a shared header without extern, triggering multiple-definition linker failures on modern GCC toolchains after compiling cleanly on legacy -fcommon compilers.	course:linux-c-sysio misconception
Define ELF PT_INTERP, GOT/PLT Relocation & Interposition.	Dynamic-linking mechanism routing shared-library calls through Procedure Linkage Table (.plt) stubs and Global Offset Table (.got.plt) jump slots populated by the PT_INTERP loader (ld-linux), inspectable via readelf -rW and objdump -d.	course:linux-c-sysio concept
Misconception check: ELF PT_INTERP, GOT/PLT Relocation & Interposition. What do people get wrong, and why is it wrong?	Misinterpreting execve returning ENOENT ('No such file or directory') on an existing binary when its ELF PT_INTERP dynamic loader path (/lib/ld-linux-armhf.so.3) is missing from a rootfs or container.	course:linux-c-sysio misconception
Define CRT Initial Stack Frame & .init_array Lifecycle.	Kernel-constructed execve() user stack holding argc, argv[], envp[], and Elf_auxv_t records handed to _start (crt1.o) and __libc_start_main() to run .init_array constructors before main() and .fini_array / atexit() teardown afterward.	course:linux-c-sysio concept
Misconception check: CRT Initial Stack Frame & .init_array Lifecycle. What do people get wrong, and why is it wrong?	Assuming C globals initialize by magic or that main() is the first instruction executed, causing crashes in constructor hooks or custom -nostdlib builds that misalign RSP/SP or skip .bss clearing.	course:linux-c-sysio misconception
Define UB-Free Unsigned Bitmasks & Width-Safe Bit Rotation.	Unsigned bit-manipulation discipline using 1U << bit / UINT32_C(1) and masked shift counts (n & 31U) with (-n & 31U) to prevent signed sign-bit overflow and shift-by-width Undefined Behavior.	course:linux-c-sysio concept
Misconception check: UB-Free Unsigned Bitmasks & Width-Safe Bit Rotation. What do people get wrong, and why is it wrong?	Writing (1 << 31) for bit 31 on 32-bit int or (x << n) | (x >> (32 - n)) in hash/CRC helpers, triggering C11 Undefined Behavior and UBSan failures when n == 0.	course:linux-c-sysio misconception
Define Linux MAX_RW_COUNT Cap & Signed ssize_t Guard.	Linux kernel VFS transfer ceiling (MAX_RW_COUNT = 0x7ffff000 = 2,147,479,552 bytes) capping every single read() or write() call even on 64-bit regular files, requiring signed ssize_t retry loops.	course:linux-c-sysio concept
Misconception check: Linux MAX_RW_COUNT Cap & Signed ssize_t Guard. What do people get wrong, and why is it wrong?	Assuming read() or write() on a local disk file never returns a short count, or storing the return value in unsigned size_t where -1 converts to SIZE_MAX and corrupts pointer arithmetic.	course:linux-c-sysio misconception
Define off_t Overflow Guards & SEEK_DATA / SEEK_HOLE.	Signed 64-bit off_t pre-addition bounds validation (cur > INT64_MAX - delta) paired with Linux lseek() SEEK_DATA and SEEK_HOLE modes that walk sparse filesystem extent trees in O(extents) without reading zero holes.	course:linux-c-sysio concept
Misconception check: off_t Overflow Guards & SEEK_DATA / SEEK_HOLE. What do people get wrong, and why is it wrong?	Scanning sparse VM images or database files with read() loops to locate non-zero regions, polluting the page cache and wasting I/O bandwidth instead of walking extents via SEEK_DATA and SEEK_HOLE.	course:linux-c-sysio misconception
Define VFS Function Vtables & Intrusive container_of.	Zero-overhead C polymorphism in Linux VFS pairing struct file_operations function-pointer tables with intrusive struct embedding recovered via offsetof(type, member) and pointer-to-pointer (struct node **pp) list surgery.	course:linux-c-sysio concept
Misconception check: VFS Function Vtables & Intrusive container_of. What do people get wrong, and why is it wrong?	Allocating separate void * heap wrapper nodes with extra pointer indirection and unchecked casts instead of embedding anchor members inside domain structs and recovering the enclosing type via offsetof.	course:linux-c-sysio misconception
Define LIFO goto Unwinding & Scope Cleanup Guards.	Structured single-exit C resource teardown unwinding acquired descriptors, mappings, and heap buffers in reverse LIFO order via numbered goto out_* labels initialized with rc = -1 (or __attribute__((cleanup))).	course:linux-c-sysio concept
Misconception check: LIFO goto Unwinding & Scope Cleanup Guards. What do people get wrong, and why is it wrong?	Initializing int rc = 0 before validation and jumping to out: without setting rc = -1 (silently returning success on failure!), or jumping over a pointer's initialization to a label that calls free() on uninitialized stack garbage.	course:linux-c-sysio misconception
Define Directory-Pinned *at() & Crash-Safe File Replacement.	Path-race-immune VFS operations anchored to a verified O_DIRECTORY descriptor (openat with O_NOFOLLOW | O_CLOEXEC, O_TMPFILE, renameat / renameat2) combined with fdatasync(tfd) + renameat() + fsync(dfd) atomic replacement.	course:linux-c-sysio concept
Misconception check: Directory-Pinned *at() & Crash-Safe File Replacement. What do people get wrong, and why is it wrong?	Using path-based open() on predictable /tmp filenames without O_NOFOLLOW or directory-descriptor pinning, or calling rename() without syncing both the staged file and the parent directory descriptor.	course:linux-c-sysio misconception
Define ABI-Stable ioctl Struct Encoding & Padding.	Linux _IOC/_IOR/_IOW/_IOWR 32-bit command encoding embedding sizeof(struct) into bits [29:16], requiring fixed-width <stdint.h> types, explicit zeroed reserved fields, and _Static_assert(sizeof(...)) verification.	course:linux-c-sysio concept
Misconception check: ABI-Stable ioctl Struct Encoding & Padding. What do people get wrong, and why is it wrong?	Placing unsigned long, raw pointers, or implicit compiler padding holes inside ioctl UAPI structs, changing the encoded command code across 32/64-bit builds (ENOTTY) and leaking kernel stack bytes if padding is not zeroed.	course:linux-c-sysio misconception
Define Memory-Backed FILE Streams (open_memstream & fmemopen).	POSIX.1-2008 interfaces binding glibc's internal FILE read/write cursor vtable onto dynamic heap buffers (open_memstream) or fixed caller RAM slices (fmemopen) with zero /tmp filesystem side effects.	course:linux-c-sysio concept
Misconception check: Memory-Backed FILE Streams (open_memstream & fmemopen). What do people get wrong, and why is it wrong?	Creating fragile /tmp scratch files just to invoke or test C APIs that accept FILE * streams, when open_memstream(&buf, &len) and fmemopen() stream directly in RAM.	course:linux-c-sysio misconception
Define fgetc() 257-State int Contract vs ARM Unsigned char Trap.	ISO C stream rule where fgetc() and getchar() return unsigned char [0..255] widened to int plus (int)-1 for EOF; storing the return in plain char truncates 0xFF to -1 on x86_64 and loops forever at EOF on ARMv7 unsigned char.	course:linux-c-sysio concept
Misconception check: fgetc() 257-State int Contract vs ARM Unsigned char Trap. What do people get wrong, and why is it wrong?	Writing char c; while ((c = fgetc(fp)) != EOF) on x86_64, passing ASCII tests, and deploying to 32-bit ARM Cortex-A7 where plain char is unsigned (0..255 != -1) and the loop spins at 100% CPU forever.	course:linux-c-sysio misconception
Define STATX_DIOALIGN, posix_fadvise & Demand-Paged mmap Faults.	Linux 6.12 page-cache and direct-I/O control combining statx(STATX_DIOALIGN) dynamic alignment queries, posix_fadvise(POSIX_FADV_DONTNEED) cache eviction, and demand-paged mmap (MAP_SHARED aliasing vs MAP_PRIVATE CoW, minflt/majflt).	course:linux-c-sysio concept
Misconception check: STATX_DIOALIGN, posix_fadvise & Demand-Paged mmap Faults. What do people get wrong, and why is it wrong?	Hardcoding 512-byte O_DIRECT alignment on 4Kn NVMe media (failing with EINVAL), polluting RAM during one-pass scans, or confusing MAP_PRIVATE Copy-on-Write shadow pages with MAP_SHARED page-cache write-through.	course:linux-c-sysio misconception
Define Branchless Reflected CRC32 & Monotonic WAL Epochs.	LSB-first IEEE 802.3 CRC32 polynomial (0xEDB88320U) evaluated via constant-time mask -(crc & 1U) paired with a strictly monotonic 64-bit epoch/sequence counter to detect stale frames in recycled WAL sectors.	course:linux-c-sysio concept
Misconception check: Branchless Reflected CRC32 & Monotonic WAL Epochs. What do people get wrong, and why is it wrong?	Relying on CRC32 alone when recycling pre-allocated circular WAL files, where an interrupted overwrite leaves an intact, valid-CRC frame from a previous epoch that masquerades as current committed data.	course:linux-c-sysio misconception
Complete the statement (fact: con_m01_l01_privilege_rings, con_m01_l01_syscall_gate): GL-C01 opens the 4-course Linux Systems Programming in C series by est…	GL-C01 opens the 4-course Linux Systems Programming in C series by establishing the toolchain, VFS descriptor, and stdio buffering foundation used across filesystems, IPC, sockets, and /dev peripherals.	course:linux-c-sysio ku fact lesson:m01-l01
Complete the statement (fact: con_m01_l01_privilege_rings, con_m01_l01_syscall_gate): Bare-metal firmware mixes user logic and raw MMIO register writes in o…	Bare-metal firmware mixes user logic and raw MMIO register writes in one flat address space, whereas Linux isolates Ring 3 / EL0 user processes from Ring 0 / EL1 struct file_operations drivers via the MMU.	course:linux-c-sysio ku fact lesson:m01-l01
Complete the statement (fact: con_m01_l01_privilege_rings, con_m01_l01_syscall_gate): The Linux kernel mediates hardware and shared resources across seven c…	The Linux kernel mediates hardware and shared resources across seven core subsystems: system calls, VFS, virtual memory, scheduling, IPC, networking, and device drivers.	course:linux-c-sysio ku fact lesson:m01-l01
Complete the statement (fact: con_m01_l01_privilege_rings, con_m01_l01_syscall_gate): Standard user-space C code compiles cleanly across x86_64 workstations…	Standard user-space C code compiles cleanly across x86_64 workstations and embedded ARM targets when built with strict -std=c11 -Wall -Wextra -Werror discipline.	course:linux-c-sysio ku fact lesson:m01-l01
Complete the statement (fact: con_m01_l02_gcc_four_stage, con_m01_l02_feature_macros): Compile multi-file systems C projects explicitly across preprocessing …	Compile multi-file systems C projects explicitly across preprocessing (-E), compilation (-S), assembly (-c), archiving (ar rcs), and linking with -std=c11 -Wall -Wextra -Werror.	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_m01_l02_gcc_four_stage, con_m01_l02_feature_macros): Define feature-test macros (_POSIX_C_SOURCE 200809L, _FILE_OFFSET_BITS…	Define feature-test macros (_POSIX_C_SOURCE 200809L, _FILE_OFFSET_BITS 64) before the very first #include in every .c translation unit.	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_m01_l02_gcc_four_stage, con_m01_l02_feature_macros): Consult man 2 for Linux kernel syscalls and man 3 for glibc functions,…	Consult man 2 for Linux kernel syscalls and man 3 for glibc functions, verifying SYNOPSIS, RETURN VALUE, and ERRORS before coding.	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_m01_l02_gcc_four_stage, con_m01_l02_feature_macros): Pair unsigned size_t capacities with signed ssize_t / off_t return che…	Pair unsigned size_t capacities with signed ssize_t / off_t return checks, pass explicit (ptr, len) pairs for uint8_t binary buffers, and write octal mode_t literals (0644).	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_m01_l03_glibc_wrapper, con_m01_l03_pure_lib_fn): glibc (libc.so.6) separates pure Ring 3 memory/string helpers (strlen(…	glibc (libc.so.6) separates pure Ring 3 memory/string helpers (strlen(), memcpy(), snprintf()) from Ring 0 syscall wrappers (write(), read(), open()) observable with strace.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_m01_l03_glibc_wrapper, con_m01_l03_pure_lib_fn): Every POSIX process inherits STDIN_FILENO (0), STDOUT_FILENO (1), and …	Every POSIX process inherits STDIN_FILENO (0), STDOUT_FILENO (1), and STDERR_FILENO (2) from startup.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_m01_l03_glibc_wrapper, con_m01_l03_pure_lib_fn): When a syscall fails, the Linux kernel returns -errno and the glibc wr…	When a syscall fails, the Linux kernel returns -errno and the glibc wrapper sets positive thread-local errno (EBADF, EINTR, formatted via perror() / strerror()) and returns -1.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_m01_l03_glibc_wrapper, con_m01_l03_pure_lib_fn): ELF binaries enter at _start (crt1.o) -> __libc_start_main(), guarante…	ELF binaries enter at _start (crt1.o) -> __libc_start_main(), guaranteeing argv[argc] == NULL and forwarding main()'s 8-bit status (EXIT_SUCCESS / EXIT_FAILURE) to shell $?.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_m02_l01_fd_lowest_slot, con_m02_l01_open_flags_bitmask): Every process indexes open VFS objects through non-negative int file d…	Every process indexes open VFS objects through non-negative int file descriptors (0..RLIMIT_NOFILE-1), pre-populating 0, 1, 2 and always allocating the lowest unused integer.	course:linux-c-sysio ku fact lesson:m02-l01
Complete the statement (fact: con_m02_l01_fd_lowest_slot, con_m02_l01_open_flags_bitmask): open() requires one access mode (O_RDONLY, O_WRONLY, or O_RDWR, tested…	open() requires one access mode (O_RDONLY, O_WRONLY, or O_RDWR, tested via O_ACCMODE) combined with creation/status flags such as O_CREAT, O_EXCL, O_TRUNC, O_APPEND, and O_CLOEXEC.	course:linux-c-sysio ku fact lesson:m02-l01
Complete the statement (fact: con_m02_l01_fd_lowest_slot, con_m02_l01_open_flags_bitmask): Whenever O_CREAT or O_TMPFILE is present, pass the third mode_t argume…	Whenever O_CREAT or O_TMPFILE is present, pass the third mode_t argument (0644 or S_I* macros); the kernel applies effective_mode = mode & ~umask.	course:linux-c-sysio ku fact lesson:m02-l01
Complete the statement (fact: con_m02_l01_fd_lowest_slot, con_m02_l01_open_flags_bitmask): Close descriptors in reverse acquisition order on error paths so long-…	Close descriptors in reverse acquisition order on error paths so long-running processes never hit EMFILE.	course:linux-c-sysio ku fact lesson:m02-l01
Complete the statement (fact: con_m02_l02_short_counts, con_m02_l02_raw_byte_transfer): write() and read() return signed ssize_t across four regimes: full cou…	write() and read() return signed ssize_t across four regimes: full count, positive short count (0 < n < count), 0 (clean EOF on read()), and -1 (EINTR retry vs fatal errno).	course:linux-c-sysio ku fact lesson:m02-l02
Complete the statement (fact: con_m02_l02_short_counts, con_m02_l02_raw_byte_transfer): Wrap binary I/O in write_all() and read_full() helpers that cast void …	Wrap binary I/O in write_all() and read_full() helpers that cast void * to uint8_t * and advance pointers by (size_t)n.	course:linux-c-sysio ku fact lesson:m02-l02
Complete the statement (fact: con_m02_l02_short_counts, con_m02_l02_raw_byte_transfer): Never pass raw read() buffers to C string functions without explicit b…	Never pass raw read() buffers to C string functions without explicit bounds or buf[n] = '\0' termination.	course:linux-c-sysio ku fact lesson:m02-l02
Complete the statement (fact: con_m02_l02_short_counts, con_m02_l02_raw_byte_transfer): Always call close(fd), check close(fd) == -1 for deferred EIO errors, …	Always call close(fd), check close(fd) == -1 for deferred EIO errors, and never retry close(fd) on the Linux kernel.	course:linux-c-sysio ku fact lesson:m02-l02
Complete the statement (fact: con_m02_l03_shared_fpos, con_m02_l03_lseek_whence): Sequential read() and write() calls automatically advance the descript…	Sequential read() and write() calls automatically advance the descriptor's shared byte offset f_pos by the transferred count.	course:linux-c-sysio ku fact lesson:m02-l03
Complete the statement (fact: con_m02_l03_shared_fpos, con_m02_l03_lseek_whence): lseek(fd, offset, whence) repositions f_pos relative to SEEK_SET, SEEK…	lseek(fd, offset, whence) repositions f_pos relative to SEEK_SET, SEEK_CUR (lseek(fd, 0, SEEK_CUR) queries position), or SEEK_END (lseek(fd, 0, SEEK_END) queries file size).	course:linux-c-sysio ku fact lesson:m02-l03
Complete the statement (fact: con_m02_l03_shared_fpos, con_m02_l03_lseek_whence): lseek() returns (off_t)-1 with EINVAL on negative resulting offsets an…	lseek() returns (off_t)-1 with EINVAL on negative resulting offsets and ESPIPE on pipes, FIFOs, and sockets; define _FILE_OFFSET_BITS 64 for 32-bit ARM safety.	course:linux-c-sysio ku fact lesson:m02-l03
Complete the statement (fact: con_m02_l03_shared_fpos, con_m02_l03_lseek_whence): Combine ENOENT probes, O_CREAT | O_EXCL atomic creation, O_TRUNC overw…	Combine ENOENT probes, O_CREAT | O_EXCL atomic creation, O_TRUNC overwrites, and pre-validated SEEK_END bounds checks to build side-effect-safe binary slice tools.	course:linux-c-sysio ku fact lesson:m02-l03
Complete the statement (fact: con_m03_l01_dentry_vs_inode, con_m03_l01_three_tier_vfs): Block storage groups 512-byte sectors into 4 KiB blocks organized into…	Block storage groups 512-byte sectors into 4 KiB blocks organized into boot block, superblock, inode table (metadata + extents, never filenames), and directory/data blocks.	course:linux-c-sysio ku fact lesson:m03-l01
Complete the statement (fact: con_m03_l01_dentry_vs_inode, con_m03_l01_three_tier_vfs): Directory entries map filenames to st_ino numbers (ls -i, stat()), all…	Directory entries map filenames to st_ino numbers (ls -i, stat()), allowing hard links (link()) to share one underlying inode (st_nlink >= 2).	course:linux-c-sysio ku fact lesson:m03-l01
Complete the statement (fact: con_m03_l01_dentry_vs_inode, con_m03_l01_three_tier_vfs): Calling open() links three dynamic kernel RAM tiers: per-process files…	Calling open() links three dynamic kernel RAM tiers: per-process files_struct (fd, FD_CLOEXEC) -> system-wide struct file (f_flags, f_pos, f_count) -> shared VFS struct inode + page cache.	course:linux-c-sysio ku fact lesson:m03-l01
Complete the statement (fact: con_m03_l01_dentry_vs_inode, con_m03_l01_three_tier_vfs): /proc/self/fdinfo/<fd> exposes live kernel pos: and octal flags: for a…	/proc/self/fdinfo/<fd> exposes live kernel pos: and octal flags: for any open descriptor, and disk blocks are freed only when both st_nlink == 0 and f_count == 0.	course:linux-c-sysio ku fact lesson:m03-l01
Complete the statement (fact: con_m03_l02_tls_errno, con_m03_l02_strerror_r): Failed Linux kernel syscalls return -errno in registers; glibc wrapper…	Failed Linux kernel syscalls return -errno in registers; glibc wrappers store the positive error code in thread-local errno (<errno.h>) and return -1.	course:linux-c-sysio ku fact lesson:m03-l02
Complete the statement (fact: con_m03_l02_tls_errno, con_m03_l02_strerror_r): Successful calls never reset errno to 0; always check ret == -1 first,…	Successful calls never reset errno to 0; always check ret == -1 first, capture int saved_errno = errno; immediately, and format via perror() or thread-safe strerror_r().	course:linux-c-sysio ku fact lesson:m03-l02
Complete the statement (fact: con_m03_l02_tls_errno, con_m03_l02_strerror_r): Memorize the high-frequency diagnostic codes: ENOENT (2), EINTR (4), E…	Memorize the high-frequency diagnostic codes: ENOENT (2), EINTR (4), EIO (5), EBADF (9), EAGAIN (11), EACCES (13), EEXIST (17), EINVAL (22), ENOSPC (28), and ESPIPE (29).	course:linux-c-sysio ku fact lesson:m03-l02
Complete the statement (fact: con_m03_l02_tls_errno, con_m03_l02_strerror_r): return in main and exit() run atexit() handlers (LIFO) and flush stdio…	return in main and exit() run atexit() handlers (LIFO) and flush stdio streams, whereas _exit() / _Exit() trap directly to the kernel without user-space buffer flushing.	course:linux-c-sysio ku fact lesson:m03-l02
Complete the statement (fact: con_m03_l03_sparse_hole, con_m03_l03_st_blocks_units): Seeking past EOF with lseek() and calling write() creates a sparse hol…	Seeking past EOF with lseek() and calling write() creates a sparse hole file: read() across unallocated holes returns VFS-synthesized 0x00 bytes without consuming physical disk blocks.	course:linux-c-sysio ku fact lesson:m03-l03
Complete the statement (fact: con_m03_l03_sparse_hole, con_m03_l03_st_blocks_units): fstat() separates logical byte length st.st_size (ls -lh) from physica…	fstat() separates logical byte length st.st_size (ls -lh) from physical storage (long long)st.st_blocks * 512LL (du -h, always counted in 512-byte POSIX units).	course:linux-c-sysio ku fact lesson:m03-l03
Complete the statement (fact: con_m03_l03_sparse_hole, con_m03_l03_st_blocks_units): O_TRUNC (with O_WRONLY or O_RDWR) resets st_size to 0 and reclaims all…	O_TRUNC (with O_WRONLY or O_RDWR) resets st_size to 0 and reclaims allocated blocks during open().	course:linux-c-sysio ku fact lesson:m03-l03
Complete the statement (fact: con_m03_l03_sparse_hole, con_m03_l03_st_blocks_units): O_APPEND leaves read() seekable via lseek(), but forces every write() …	O_APPEND leaves read() seekable via lseek(), but forces every write() inside the Linux kernel to jump atomically to EOF, ignoring any prior lseek() offset.	course:linux-c-sysio ku fact lesson:m03-l03
Complete the statement (fact: con_m04_dual_open_tables, con_m04_dup_shared_file): Two open() calls on the same path create two independent struct file e…	Two open() calls on the same path create two independent struct file entries with separate f_pos cursors over one shared struct inode and page cache.	course:linux-c-sysio ku fact lesson:m04-l01
Complete the statement (fact: con_m04_dual_open_tables, con_m04_dup_shared_file): dup(), dup2(), and dup3() bind multiple descriptor integers to a singl…	dup(), dup2(), and dup3() bind multiple descriptor integers to a single struct file, sharing f_pos and f_flags while keeping FD_CLOEXEC private to each descriptor slot.	course:linux-c-sysio ku fact lesson:m04-l01
Complete the statement (fact: con_m04_dual_open_tables, con_m04_dup_shared_file): dup2(fd, fd) is a safe no-op returning fd, whereas dup3(fd, fd, O_CLOE…	dup2(fd, fd) is a safe no-op returning fd, whereas dup3(fd, fd, O_CLOEXEC) returns -1 with errno == EINVAL.	course:linux-c-sysio ku fact lesson:m04-l01
Complete the statement (fact: con_m04_dual_open_tables, con_m04_dup_shared_file): Redirecting STDOUT_FILENO safely requires saving the original descript…	Redirecting STDOUT_FILENO safely requires saving the original descriptor with dup(), rebinding with dup2(), calling fflush(stdout) before restoring, and closing the saved duplicate.	course:linux-c-sysio ku fact lesson:m04-l01
Complete the statement (fact: con_m04_toctou_oexcl, con_m04_stateless_pread_pwrite): Any file invariant split across two user-space syscalls (access + open…	Any file invariant split across two user-space syscalls (access + open, or lseek + write) is vulnerable to kernel scheduler preemption races.	course:linux-c-sysio ku fact lesson:m04-l02
Complete the statement (fact: con_m04_toctou_oexcl, con_m04_stateless_pread_pwrite): open(..., O_CREAT | O_EXCL, mode) fuses existence testing and inode cr…	open(..., O_CREAT | O_EXCL, mode) fuses existence testing and inode creation into one atomic VFS directory operation that fails with EEXIST on collision.	course:linux-c-sysio ku fact lesson:m04-l02
Complete the statement (fact: con_m04_toctou_oexcl, con_m04_stateless_pread_pwrite): pread() and pwrite() transfer bytes at an explicit off_t coordinate wi…	pread() and pwrite() transfer bytes at an explicit off_t coordinate without reading or mutating struct file.f_pos (provided O_APPEND is not set on Linux).	course:linux-c-sysio ku fact lesson:m04-l02
Complete the statement (fact: con_m04_toctou_oexcl, con_m04_stateless_pread_pwrite): Opening log descriptors with O_APPEND serializes offset placement (f_p…	Opening log descriptors with O_APPEND serializes offset placement (f_pos = i_size) and payload copy under the kernel inode write lock.	course:linux-c-sysio ku fact lesson:m04-l02
Complete the statement (fact: con_m04_fcntl_flag_tiers, con_m04_ioctl_out_of_band): fcntl() separates per-descriptor table control (F_DUPFD_CLOEXEC, F_GET…	fcntl() separates per-descriptor table control (F_DUPFD_CLOEXEC, F_GETFD/F_SETFD for FD_CLOEXEC) from shared struct file status flags (F_GETFL/F_SETFL).	course:linux-c-sysio ku fact lesson:m04-l03
Complete the statement (fact: con_m04_fcntl_flag_tiers, con_m04_ioctl_out_of_band): F_SETFL can toggle O_APPEND, O_NONBLOCK, O_ASYNC, O_DIRECT, and O_NOAT…	F_SETFL can toggle O_APPEND, O_NONBLOCK, O_ASYNC, O_DIRECT, and O_NOATIME via read-modify-write, whereas (flags & O_ACCMODE) is immutable after open().	course:linux-c-sysio ku fact lesson:m04-l03
Complete the statement (fact: con_m04_fcntl_flag_tiers, con_m04_ioctl_out_of_band): ioctl() dispatches out-of-band driver and kernel queries (FIONREAD, TI…	ioctl() dispatches out-of-band driver and kernel queries (FIONREAD, TIOCGWINSZ) and fails with ENOTTY when applied to an inappropriate file type.	course:linux-c-sysio ku fact lesson:m04-l03
Complete the statement (fact: con_m04_fcntl_flag_tiers, con_m04_ioctl_out_of_band): ftruncate() (requiring a writable fd) and truncate() shrink or zero-ex…	ftruncate() (requiring a writable fd) and truncate() shrink or zero-extend regular files directly without modifying struct file.f_pos.	course:linux-c-sysio ku fact lesson:m04-l03
Complete the statement (fact: con_m05_file_stream_struct, con_m05_fopen_mode_mapping): glibc FILE streams wrap integer file descriptors with user-space buffe…	glibc FILE streams wrap integer file descriptors with user-space buffers and sticky status flags to amortize user-to-kernel syscall overhead across small I/O operations.	course:linux-c-sysio ku fact lesson:m05-l01
Complete the statement (fact: con_m05_file_stream_struct, con_m05_fopen_mode_mapping): Every C process begins with pre-opened stdin (0), stdout (1), and stde…	Every C process begins with pre-opened stdin (0), stdout (1), and stderr (2) streams declared in <stdio.h>.	course:linux-c-sysio ku fact lesson:m05-l01
Complete the statement (fact: con_m05_file_stream_struct, con_m05_fopen_mode_mapping): fopen() modes "r", "r+", "w", "w+", "a", and "a+" map deterministicall…	fopen() modes "r", "r+", "w", "w+", "a", and "a+" map deterministically to O_RDONLY/O_RDWR/O_WRONLY plus O_CREAT, O_TRUNC, or O_APPEND, while "b" is a POSIX no-op.	course:linux-c-sysio ku fact lesson:m05-l01
Complete the statement (fact: con_m05_file_stream_struct, con_m05_fopen_mode_mapping): Linux glibc extensions "e" (O_CLOEXEC) and "x" (O_EXCL) close descript…	Linux glibc extensions "e" (O_CLOEXEC) and "x" (O_EXCL) close descriptor-leak and file-creation race windows inside the initial openat() syscall.	course:linux-c-sysio ku fact lesson:m05-l01
Complete the statement (fact: con_m05_item_counted_io, con_m05_fseeko_turnaround): fread() and fwrite() return counts of complete items (0..nmemb); use s…	fread() and fwrite() return counts of complete items (0..nmemb); use size = 1 for raw byte buffers or size = sizeof(struct) for fixed binary records.	course:linux-c-sysio ku fact lesson:m05-l02
Complete the statement (fact: con_m05_item_counted_io, con_m05_fseeko_turnaround): Prefer 64-bit fseeko() and ftello() (off_t), and remember rewind(fp) r…	Prefer 64-bit fseeko() and ftello() (off_t), and remember rewind(fp) resets both position 0 and sticky stream error/end-of-file indicators.	course:linux-c-sysio ku fact lesson:m05-l02
Complete the statement (fact: con_m05_item_counted_io, con_m05_fseeko_turnaround): On update ("+") streams, always insert fseeko() (or fflush() after wri…	On update ("+") streams, always insert fseeko() (or fflush() after writes) when switching between fwrite() and fread().	course:linux-c-sysio ku fact lesson:m05-l02
Complete the statement (fact: con_m05_item_counted_io, con_m05_fseeko_turnaround): Drive read loops with while (fread(...) == 1) rather than while (!feof…	Drive read loops with while (fread(...) == 1) rather than while (!feof(fp)), then inspect ferror(fp) vs feof(fp) after the loop terminates.	course:linux-c-sysio ku fact lesson:m05-l02
Complete the statement (fact: con_m05_snprintf_truncation, con_m05_portable_format_macros): Never call sprintf(); always bound output with snprintf(buf, sz, ...) …	Never call sprintf(); always bound output with snprintf(buf, sz, ...) (or emit directly to a descriptor via dprintf(fd, ...)) and test ret < 0 || (size_t)ret >= sz.	course:linux-c-sysio ku fact lesson:m05-l03
Complete the statement (fact: con_m05_snprintf_truncation, con_m05_portable_format_macros): Match exact C types to length modifiers (%zu/%zd for size_t/ssize_t, P…	Match exact C types to length modifiers (%zu/%zd for size_t/ssize_t, PRId64/PRIu64 for 64-bit integers) so -Wformat -Werror passes across 32-bit and 64-bit targets.	course:linux-c-sysio ku fact lesson:m05-l03
Complete the statement (fact: con_m05_snprintf_truncation, con_m05_portable_format_macros): Set scanf/sscanf string and scanset widths to sizeof(buf) - 1 (%31[^\n…	Set scanf/sscanf string and scanset widths to sizeof(buf) - 1 (%31[^\n] for char[32]) to reserve room for the terminating '\0'.	course:linux-c-sysio ku fact lesson:m05-l03
Complete the statement (fact: con_m05_snprintf_truncation, con_m05_portable_format_macros): Parse text streams line-first with fgets() (draining oversized lines) …	Parse text streams line-first with fgets() (draining oversized lines) plus sscanf()/strtol() so malformed records never wedge the input stream.	course:linux-c-sysio ku fact lesson:m05-l03
Complete the statement (fact: con_m06_page_cache_writeback, con_m06_fdatasync_dirsync): A successful write() only places bytes in the volatile Linux kernel pa…	A successful write() only places bytes in the volatile Linux kernel page cache; surviving power loss requires an explicit persistence barrier.	course:linux-c-sysio ku fact lesson:m06-l01
Complete the statement (fact: con_m06_page_cache_writeback, con_m06_fdatasync_dirsync): fsync(fd) flushes data and all inode metadata, fdatasync(fd) skips non…	fsync(fd) flushes data and all inode metadata, fdatasync(fd) skips non-essential timestamp flushes for higher commit throughput, and fsync(dir_fd) hardens newly created or renamed directory entries.	course:linux-c-sysio ku fact lesson:m06-l01
Complete the statement (fact: con_m06_page_cache_writeback, con_m06_fdatasync_dirsync): O_SYNC and O_DSYNC apply fsync or fdatasync semantics automatically on…	O_SYNC and O_DSYNC apply fsync or fdatasync semantics automatically on every write() to that open file description.	course:linux-c-sysio ku fact lesson:m06-l01
Complete the statement (fact: con_m06_page_cache_writeback, con_m06_fdatasync_dirsync): O_DIRECT bypasses the page cache via posix_memalign() buffers when mem…	O_DIRECT bypasses the page cache via posix_memalign() buffers when memory address, transfer size, and file offset are all block-aligned (falling back cleanly if tmpfs returns EINVAL).	course:linux-c-sysio ku fact lesson:m06-l01
Complete the statement (fact: con_m06_setvbuf_modes, con_m06_two_stage_durability): glibc FILE streams support _IOFBF (full, default on files/pipes), _IOL…	glibc FILE streams support _IOFBF (full, default on files/pipes), _IOLBF (line, default on terminals), and _IONBF (unbuffered, default on stderr), configured via setvbuf() before any I/O.	course:linux-c-sysio ku fact lesson:m06-l02
Complete the statement (fact: con_m06_setvbuf_modes, con_m06_two_stage_durability): Normal exit() flushes all user-space FILE streams, whereas _exit() ter…	Normal exit() flushes all user-space FILE streams, whereas _exit() terminates immediately in the kernel and drops unflushed user-space buffers (and fflush(NULL) must precede fork()).	course:linux-c-sysio ku fact lesson:m06-l02
Complete the statement (fact: con_m06_setvbuf_modes, con_m06_two_stage_durability): Power-safe stdio durability requires the strict two-stage barrier fwri…	Power-safe stdio durability requires the strict two-stage barrier fwrite() -> fflush(fp) -> fdatasync(fileno(fp)) -> fclose(fp).	course:linux-c-sysio ku fact lesson:m06-l02
Complete the statement (fact: con_m06_setvbuf_modes, con_m06_two_stage_durability): fdopen(fd, mode) transfers descriptor ownership to fp (fclose(fp) clos…	fdopen(fd, mode) transfers descriptor ownership to fp (fclose(fp) closes fd); fileno(fp) borrows the integer without transferring ownership.	course:linux-c-sysio ku fact lesson:m06-l02
Complete the statement (fact: con_m06_crc32_wal_framing, con_m06_torn_tail_ftruncate): A crash-safe Write-Ahead Log synthesizes O_CLOEXEC handle hygiene, bin…	A crash-safe Write-Ahead Log synthesizes O_CLOEXEC handle hygiene, binary length-prefixed CRC32 framing, fdatasync() + directory fsync() durability barriers, ftruncate() torn-tail healing, and stateless pread() indexed reads.	course:linux-c-sysio ku fact lesson:m06-l03
Complete the statement (fact: con_m06_crc32_wal_framing, con_m06_torn_tail_ftruncate): Checksumming both header lengths and payload bytes lets startup recove…	Checksumming both header lengths and payload bytes lets startup recovery distinguish committed transactions from torn or corrupted crash tails deterministically.	course:linux-c-sysio ku fact lesson:m06-l03
Complete the statement (fact: con_m06_crc32_wal_framing, con_m06_torn_tail_ftruncate): Append-only immutable frames turn overwrites into sequential tail appe…	Append-only immutable frames turn overwrites into sequential tail appends, preventing in-place power-loss corruption while allowing lock-free pread() lookups on committed offsets.	course:linux-c-sysio ku fact lesson:m06-l03
Complete the statement (fact: con_m06_crc32_wal_framing, con_m06_torn_tail_ftruncate): With Linux file I/O, kernel descriptor tables, stdio codecs, and two-l…	With Linux file I/O, kernel descriptor tables, stdio codecs, and two-layer durability mastered in GL-C01, you are ready for filesystems, signals, processes, and threads in GL-C02.	course:linux-c-sysio ku fact lesson:m06-l03
Complete the statement (fact: con_sys_001_vdso_fastpath): Standard system calls cross from Ring 3 / EL0 user mode into Ring 0 / …	Standard system calls cross from Ring 3 / EL0 user mode into Ring 0 / EL1 Linux kernel mode via synchronous CPU trap instructions (syscall on x86_64, svc #0 on ARM), flushing pipeline state and switching stacks, whereas the Linux kernel maps linux-vdso.so.1 (passed via ELF auxiliary vector AT_SYSINFO_EHDR and visible in /proc/self/maps) as a read-only shared kernel page so latency-critical queries like clock_gettime(CLOCK_MONOTONIC) and gettimeofday() read timekeeper sequence data directly in user space with zero privilege switches and 0 strace syscall traps.	course:linux-c-sysio ku fact lesson:m01-l01
Complete the statement (fact: con_sys_002_c11_ub_taxonomy): ISO C11 distinguishes well-defined unsigned modulo arithmetic, unspeci…	ISO C11 distinguishes well-defined unsigned modulo arithmetic, unspecified evaluation order, implementation-defined choices (plain char is unsigned [0..255] on ARM EABI vs signed [-128..127] on x86_64 System V), and Undefined Behavior (signed integer overflow, shifts < 0 or >= bit-width, null/dangling dereference, and -fstrict-aliasing pointer type-punning). Under the C11 as-if rule, GCC -O2 assumes UB never occurs and deletes downstream guards like (len + hdr < len), whereas zero-cost type-punning uses memcpy(&dst, &src, sizeof(dst)), struct layout obeys _Alignof and offsetof padding rules, and host builds verify memory and arithmetic safety with -fsanitize=address,undefined (ASan and UBSan).	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_sys_003_fno_common_visibility): In ISO C11, an uninitialized file-scope declaration such as int status…	In ISO C11, an uninitialized file-scope declaration such as int status; without extern is a tentative definition that emits an allocated .bss symbol per translation unit under GCC 10+ (-fno-common default), causing multiple-definition linker errors unless headers declare extern int status; and exactly one .c file defines it. Static archives (ar rcs libfoo.a) must appear after callers on the link line, while static linkage and visibility attributes separate module-private STB_LOCAL symbols from exported STB_GLOBAL and STB_WEAK symbols in nm and readelf -sW.	course:linux-c-sysio ku fact lesson:m01-l02
Complete the statement (fact: con_sys_004_plt_got_interp): Position-Independent Code (PIC) routes external shared-library calls s…	Position-Independent Code (PIC) routes external shared-library calls such as write@plt through Procedure Linkage Table (.plt) trampolines and Global Offset Table (.got.plt / .got) slots populated by the ELF PT_INTERP runtime loader (ld-linux) via JUMP_SLOT relocations (inspected with readelf -l -rW -d, objdump -d, and LD_DEBUG=bindings), enabling symbol interposition via LD_PRELOAD or ld --wrap=sym. If the PT_INTERP dynamic loader path encoded in the ELF header is absent from a container or target rootfs, execve() fails with ENOENT even though the binary file itself exists.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_sys_005_crt_auxv_abi): During execve(), the Linux kernel ELF loader maps .text (read-execute)…	During execve(), the Linux kernel ELF loader maps .text (read-execute), .rodata (read-only), and .data/.bss (read-write VMA segments) and builds the initial user stack containing argc, argv[] pointers, NULL, envp[] pointers, NULL, and Elf_auxv_t key-value pairs before jumping to _start (crt1.o), which aligns the stack pointer to ABI boundaries and calls __libc_start_main() to execute .init_array constructors prior to main() and .fini_array / atexit() handlers on normal return.	course:linux-c-sysio ku fact lesson:m01-l03
Complete the statement (fact: con_sys_006_unsigned_bitops): Bitwise flag composition and register masks must operate on unsigned i…	Bitwise flag composition and register masks must operate on unsigned integer types (1U << 31, UINT32_C(1) << bit) because shifting into the sign bit of a 32-bit signed int (1 << 31) or shifting by >= bit-width (x >> 32 when n == 0) is ISO C11 Undefined Behavior. Masking 32-bit left rotation as (x << (n & 31U)) | (x >> ((-n) & 31U)) eliminates the n == 0 UB edge and lowers under GCC -O2 to a single hardware rotate instruction.	course:linux-c-sysio ku fact lesson:m02-l01
Complete the statement (fact: con_sys_007_max_rw_count): POSIX read() and write() return signed ssize_t (-1 on error), and the …	POSIX read() and write() return signed ssize_t (-1 on error), and the Linux kernel caps every single read() or write() transfer—even on 64-bit local regular files—to MAX_RW_COUNT (0x7ffff000 = 2,147,479,552 bytes, one 4 KiB page below 2 GiB). Storing the return value in unsigned size_t promotes -1 into SIZE_MAX, wrapping pointer arithmetic (p += n; left -= n) into segmentation faults, whereas signed ssize_t retry loops transfer multi-gigabyte payloads safely.	course:linux-c-sysio ku fact lesson:m02-l02
Complete the statement (fact: con_sys_008_seek_data_hole): Under _FILE_OFFSET_BITS=64, off_t is a signed 64-bit integer so negati…	Under _FILE_OFFSET_BITS=64, off_t is a signed 64-bit integer so negative SEEK_CUR deltas and (off_t)-1 errors remain representable; checking (delta > 0 && cur > INT64_MAX - delta) prevents signed overflow UB before lseek(). On Linux (_GNU_SOURCE), lseek(fd, cur, SEEK_DATA) and lseek(fd, data_off, SEEK_HOLE) query filesystem extent trees directly in O(extents) time (returning ENXIO at EOF) without reading unallocated sparse zero blocks into RAM.	course:linux-c-sysio ku fact lesson:m02-l03
Complete the statement (fact: con_sys_009_vfs_container_of): The Linux VFS implements zero-overhead polymorphism in ISO C by dispat…	The Linux VFS implements zero-overhead polymorphism in ISO C by dispatching generic read(), write(), and lseek() calls through struct file_operations and struct inode_operations vtables across ext4, pipefs, procfs, and character drivers, while subsystems embed anchor structs intrusively and recover the enclosing parent struct via offsetof(type, member) with compile-time pointer-type checking (CONTAINER_OF) and remove list nodes without special-case head branches via indirect pointers (struct node **pp).	course:linux-c-sysio ku fact lesson:m03-l01
Complete the statement (fact: con_sys_010_lifo_goto_cleanup): Multi-resource C functions (open -> mmap -> malloc) prevent leaks with…	Multi-resource C functions (open -> mmap -> malloc) prevent leaks without deeply nested branches by initializing int rc = -1, pre-initializing pointers/descriptors to NULL/-1, and unwinding in strict reverse acquisition (LIFO) order via numbered goto labels (goto out_buf; goto out_fd;)—avoiding the two classic goto defects of returning rc = 0 on failure or calling free() on uninitialized stack slots—or by binding GCC __attribute__((cleanup(fn))) scope guards (mirrored by Linux 6.12 <linux/cleanup.h>).	course:linux-c-sysio ku fact lesson:m03-l02
Complete the statement (fact: con_sys_011_dir_pinned_at_ops): Path-based syscalls re-walk directory prefixes on every call, allowing…	Path-based syscalls re-walk directory prefixes on every call, allowing a concurrent attacker or cleaner to swap a parent path with a symlink; pinning operations to an O_RDONLY | O_DIRECTORY | O_CLOEXEC descriptor via openat(dfd, name, O_WRONLY | O_CREAT | O_EXCL | O_NOFOLLOW | O_CLOEXEC, 0600), O_TMPFILE + linkat(), and renameat() / renameat2(..., RENAME_NOREPLACE) eliminates path-prefix TOCTOU races, and pairing write_all() + fdatasync(tfd) + close(tfd) + renameat(dfd, tmp, dfd, dst) + fsync(dfd) achieves crash-safe atomic file replacement.	course:linux-c-sysio ku fact lesson:m04-l02
Complete the statement (fact: con_sys_012_ioctl_abi_layout): Linux _IOR, _IOW, and _IOWR macros encode direction [31:30], payload b…	Linux _IOR, _IOW, and _IOWR macros encode direction [31:30], payload byte size sizeof(struct) [29:16], magic type [15:8], and command number [7:0] directly into the 32-bit ioctl request code (_IOC_SIZE(cmd)). Using long, pointers, or implicit padding holes alters sizeof(struct) between 32-bit ARM and 64-bit x86_64 builds (causing ENOTTY) and risks kernel stack infoleaks unless UAPI structs use fixed-width uint32_t/uint64_t fields, explicit zero-checked reserved fields, memset(&cfg, 0, sizeof(cfg)), and _Static_assert(sizeof(...) == expected).	course:linux-c-sysio ku fact lesson:m04-l03
Complete the statement (fact: con_sys_013_memstream_file_vtable): A glibc FILE control block maintains user-space _IO_read_ptr/_IO_read_…	A glibc FILE control block maintains user-space _IO_read_ptr/_IO_read_end and _IO_write_ptr/_IO_write_end cursors plus an internal lock so fgetc() and fputc() advance RAM pointers until buffer refill/flush; POSIX.1-2008 open_memstream(&buf, &sz) and fmemopen(buf, len, mode) attach that exact FILE interface onto dynamic heap or caller-owned memory buffers (with fileno(mfp) returning -1 and errno == EBADF), eliminating fragile temporary files when testing or driving FILE *-based serializers.	course:linux-c-sysio ku fact lesson:m05-l01
Complete the statement (fact: con_sys_014_fgetc_eof_char_trap): ISO C11 specifies that fgetc() and getchar() read the next byte as uns…	ISO C11 specifies that fgetc() and getchar() read the next byte as unsigned char [0..255] converted to int, reserving negative (int)-1 for EOF—257 distinct outcomes that cannot fit inside any 8-bit char. Assigning the result to char c causes valid binary byte 0xFF to sign-extend to -1 on x86_64 (premature false EOF) and causes (c != EOF) to evaluate true forever on ARM EABI / -funsigned-char where unsigned char [0..255] never equals -1; always capture int ch = fgetc(fp); check ch != EOF, and cast (uint8_t)ch.	course:linux-c-sysio ku fact lesson:m05-l02
Complete the statement (fact: con_sys_015_statx_dio_mmap_faults): Buffered I/O dirties page-cache folios governed by vm.dirty_background…	Buffered I/O dirties page-cache folios governed by vm.dirty_background_ratio and vm.dirty_ratio, whereas Linux 6.1+ statx(fd, "", AT_EMPTY_PATH, STATX_DIOALIGN, &sx) queries exact stx_dio_mem_align and stx_dio_offset_align boundaries for O_DIRECT DMA, and posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED) evicts cold sequential cache pages. The same VFS page cache backs demand-paged mmap(): first-touch PTE population records minor faults (ru_minflt / /proc/self/stat minflt) when pages reside in RAM versus major faults (ru_majflt / majflt) on storage reads, while MAP_SHARED aliases page-cache frames directly and MAP_PRIVATE clones private Copy-on-Write pages on store.	course:linux-c-sysio ku fact lesson:m06-l01
Complete the statement (fact: con_sys_016_crc32_wal_epoch): Reflected IEEE 802.3 CRC32 (polynomial 0xEDB88320U) processes bits LSB…	Reflected IEEE 802.3 CRC32 (polynomial 0xEDB88320U) processes bits LSB-first to match little-endian byte order using the branchless mask crc = (crc >> 1) ^ (0xEDB88320U & -(crc & 1U)) without data-dependent branch mispredictions. When Write-Ahead Log files pre-allocate or recycle sectors without truncating to zero, pairing magic + crc32 with a strictly monotonic 64-bit seq/epoch header field ensures recovery stops immediately if an interrupted overwrite exposes a syntactically valid CRC frame left over from an older epoch.	course:linux-c-sysio ku fact lesson:m06-l03
