Deep-dive implementations of UNIX systems concepts: processes, signals, IPC, sockets
A collection of systems programming exercises covering the full UNIX API surface. Each module is self-contained with its own Makefile, annotated source, and test harness. Built to demonstrate mastery of low-level UNIX programming.
unix-system-programming/
βββ 01-processes/
β βββ fork_exec.c # fork + execve + waitpid patterns
β βββ process_tree.c # Build a process tree, print with indentation
βββ 02-signals/
β βββ signal_handler.c # sigaction, SA_RESTART, signal masks
β βββ job_control.c # SIGCHLD, SIGTSTP, fg/bg job tracking
βββ 03-ipc/
β βββ pipe_redir.c # Pipes and dup2 for shell-style redirection
β βββ shared_mem.c # POSIX shm_open + mmap producer-consumer
β βββ message_queue.c # POSIX mq_open for async messaging
βββ 04-sockets/
β βββ tcp_server.c # Concurrent TCP server with poll()
β βββ unix_socket.c # AF_UNIX datagram socket IPC
βββ 05-threads/
β βββ thread_pool.c # POSIX threads + condition variables
β βββ rwlock.c # Read-write lock from scratch
βββ README.md
git clone https://github.com/gitisabel/unix-system-programming
cd unix-system-programming/04-sockets
make
./tcp_server &
./tcp_client 127.0.0.1 8080// Non-blocking poll()-based TCP server (04-sockets/tcp_server.c)
int epfd = epoll_create1(0);
epoll_ctl(epfd, EPOLL_CTL_ADD, listenfd, &ev);
while (1) {
int n = epoll_wait(epfd, events, MAX_EVENTS, -1);
for (int i = 0; i < n; i++) handle_event(&events[i]);
}Each module has a make test target that runs correctness checks and checks for fd/memory leaks with valgrind.
MIT Β© Isabel