Skip to content
systemcoding.dev

Tag

c

362 posts

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

Parse Ethernet, IP and TCP Headers in C

Read raw frames with an AF_PACKET socket and parse Ethernet, IPv4 and TCP headers in C using the Linux header structs, with length checks at every layer.

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

Create Processes with CreateProcess

Start a program from C with CreateProcessW, quote the command line correctly, redirect its output to a file, wait with a timeout and avoid handle leaks.

9 min read