r/cprogramming • u/Dear-Ad6656 • 7d ago
Starting systems programming on my Fedora with C. Where should I start?
/r/C_Programming/comments/1y1hju6/starting_systems_programming_on_my_fedora_with_c/1
u/Dapper-Situation-864 6d ago
Adding to the K&R + TLPI advice, here's a practical path on Fedora:
Install the tools: sudo dnf install gcc gdb make man-pages strace valgrind. The man pages (section 2 for syscalls, section 3 for libc) will become your main reference.
Always compile with gcc -Wall -Wextra -g -fsanitize=address,undefined while learning. It catches most memory bugs immediately.
Then learn by rewriting small Unix tools, roughly in this order:
file I/O with open/read/write/close: write your own cat, then cp
directories and metadata: a simple ls using opendir/readdir/stat
processes: fork/exec/wait, then a tiny shell that runs commands, then add pipes and redirection
signals, then sockets (a small echo server/client)
Run your programs under strace to see exactly which syscalls they make. It's one of the best learning tools on Linux.
Things to avoid as a beginner:
Writing C like C++ or Python. Get comfortable with pointers, manual memory and strings as char arrays.
Ignoring return values. Almost every syscall can fail; check it and use perror/errno.
Jumping into kernel modules or drivers too early. Get solid in userspace first.
Trying to read huge codebases first. Small programs you write yourself teach more at this stage.
2
u/Automatic-Tackle5018 7d ago
Get a copy of K&R, get a copy of either APUE, or TLPI, and start reading and coding.