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, FreeBSD and Rust logos.
Systems Programming

Limit a Process's Resources with setrlimit

Cap open files, CPU time, memory and core dumps for a Linux process with setrlimit, understand soft and hard limits, and read the results in /proc.

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

Redirect stdout to a File with dup2

Redirect stdout to a file in C by opening it and calling dup2 onto descriptor 1. Includes saving and restoring the terminal and the fork and exec case.

7 min read
Flat illustration of a CPU core with its cache levels and main memory, with the C, Arm and Apple logos.
Systems Programming

Check Resource Usage with getrusage

Read CPU time, peak memory, page faults and context switches for your own process with getrusage on Linux with glibc 2.40, and know which fields are filled.

7 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.