C for Systems Programming
Write, build and debug small C programs that call the C library and Linux system interfaces safely.
4 objectives 6 steps about 135 min
Check what you know
The lessons are coming later. The knowledge check is ready now.
This skill page is a public outline. Its lessons and knowledge check appear here as subject-matter experts approve them.
Learning objectives
- Compile, link and run multi-file C programs with gcc and a Makefile, with warnings and sanitizers enabled.
- Use pointers, arrays, strings, structs and heap allocation correctly, and explain stack versus heap lifetime.
- Check return values and errno from library and system calls and report errors with perror or strerror.
- Locate memory errors such as buffer overflows and use-after-free with AddressSanitizer, Valgrind or gdb.
Lesson plan
6 steps, about 135 min · 0 of 5 lessons available so far
- From source file to running program: preprocessing, compiling and linking Concept · 20 min · coming later
- Pointers, arrays and strings without the folklore Concept · 25 min · coming later
- Lab: a growable array with malloc, realloc and free, built by make Lab · 30 min · coming later
- Error handling the Unix way: return codes, errno and perror Worked example · 20 min · coming later
- Lab: catch an overflow and a use-after-free with ASan and gdb Lab · 25 min · coming later
- Check: read, build and fix a small C utility Knowledge check · 8 questions
Practise it
Write a C version of wc that takes file paths as arguments, reports unreadable files with errno messages, builds with a Makefile using -Wall -Wextra -fsanitize=address, and passes a provided test script.
Build it from scratch
Practice builds that exercise this skill by re-creating a real technology.
- Build your own ShellIntermediate · 8–16 h
- Build your own Text EditorIntermediate · 10–20 h
- Build your own Virtual MachineIntermediate · 6–12 h
- Build your own Memory AllocatorIntermediate · 6–12 h
- Build your own DebuggerAdvanced · 15–30 h
- Build your own Operating SystemAdvanced · 40–80 h
- Build your own Hash TableIntro · 3–6 h
- Build your own CompilerAdvanced · 30–60 h
References
Hard prerequisites
Unlocks
Nothing depends on this skill yet.
On these roadmaps
Progress and evidence for this skill are shared across all of them.