Skip to content
systemcoding.dev

Tag

c

362 posts

Flat illustration of heap memory as allocated and free blocks, with the C, Rust and Zig logos.
Debugging

Find Memory Leaks With Valgrind Memcheck

Run a C program under Valgrind Memcheck with --leak-check=full to find memory that was allocated and never freed, and read the report down to the source line.

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

What Is errno and How Does It Work in C

errno is a per-thread integer that C library and system calls set on failure. Learn when it is valid and how to read it correctly with glibc 2.41.

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

The Complete Guide to Linux Kernel Modules

A complete guide to Linux kernel modules: lifecycle, build, load, parameters, exported symbols, a working misc device, licensing, signing, DKMS and debugging.

27 min read
Flat illustration of a shield with a lock, a key and a password field, with the Linux, C and Rust logos.
Security

Write a seccomp Filter With libseccomp

Build a default-deny seccomp allow-list in C with libseccomp, add an argument rule that limits write to one file descriptor, and inspect the generated BPF.

6 min read
Flat illustration of network packets crossing between two hosts, with the C, Rust and Linux logos.
Networking

Resolve Hostnames in C with getaddrinfo

Resolve hostnames in C with getaddrinfo, walk the result list, connect to the first address that works, and free it with freeaddrinfo on Linux.

6 min read