Skip to content
systemcoding.dev

Library

Everything you need to level up your coding skills.

Flat illustration of user space above the system call boundary, the kernel and the hardware, with the C, Linux and FreeBSD logos.
Systems Programming

Print All Environment Variables Using environ

The global environ is the NULL-terminated array behind getenv. Loop over it to list every NAME=value entry, split entries safely and avoid the stale envp trap.

7 min read
Flat illustration of user space above the system call boundary, the kernel and the hardware, with the C, FreeBSD and Linux logos.
Systems Programming

How argc and argv Reach main in a C Program

The kernel copies argc and argv onto the new process's stack on execve, then startup code hands them to main. See the layout and measure it with a program.

6 min read
Flat illustration of user space above the system call boundary, the kernel and the hardware, with the C, FreeBSD and Linux logos.
Systems Programming

Read Environment Variables in C with getenv

getenv returns a pointer to a variable's value, or NULL when it is unset. Check for NULL, tell empty from unset, copy what you keep and parse numbers safely.

8 min read
Flat illustration of user space above the system call boundary, the kernel and the hardware, with the Rust, Linux and GNU logos.
Kernels

Write Your First Rust Kernel Module

Write, build and load a first Rust kernel module in a Linux 6.18 tree: the module! macro, init and Drop, KVec, Kconfig and Makefile entries and dmesg output.

6 min read

Get new posts by email

We send one email when a new post is published. No spam.

Unsubscribe in one click. No spam, ever.