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

How Rust's std Wraps libc and System Calls

Rust's standard library does not talk to the kernel directly on Linux. It calls libc, which issues the syscall. See the layers from File::open down to openat.

6 min read
Flat illustration of a microcontroller wired to an LED and a sensor, with the Bluetooth, Nordic Semiconductor and Arm logos.
Embedded

Create a Custom BLE GATT Service on nRF52

Define a custom 128-bit GATT service on nRF52 with Zephyr: characteristic properties, read and write callbacks, notifications through the CCC and MTU limits.

9 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

Process Lines Efficiently with getline

Read lines of any length in C with getline, reuse one growing buffer, strip the newline, spot read errors and handle files without a final newline.

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

Write Errors to stderr with perror and err

Report failures from a C tool the Unix way: perror, strerror and the err and warn family, with errno saved correctly and messages sent to stderr.

6 min read
Flat illustration of a magnifier over lines of a log, with the Linux, C and Rust logos.
Kernels

printk Log Levels and pr_* Helpers Explained

Learn the eight printk log levels, the pr_info and pr_err helpers, pr_fmt prefixes, rate limiting and the console loglevel that decides what reaches the screen.

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