Free Linux system programming course

Free Linux System Programming Course

Master System Calls, Processes, IPC & Networking

60+ Chapters
500+ Syscalls
100% Free

About This free Linux System Programming Course

Welcome to the most comprehensive Linux System Programming and UNIX System Programming guide available online. This course covers everything from basic file I/O operationsprocess management, and memory allocation to advanced topics like POSIX threadsnetwork programming with socketsinterprocess communication (IPC), and signal handling.

Whether you’re learning embedded systems programmingLinux kernel development, or building high-performance applications, this index will guide you through all essential topics including system callslibrary functionsprocess synchronization, and network socket programming.

🔍 Topics Covered

Linux System Programming UNIX System Programming File I/O Process Management POSIX Threads Socket Programming IPC Signal Handling Memory Management System Calls Network Programming Shared Memory Semaphores Message Queues File Systems Process Credentials Timers Daemons

📚 Part 1: Fundamentals of Linux & UNIX System Programming

History and Standards

Understanding UNIX history, Linux evolution, POSIX standards, SUSv3, SUSv4, GNU Project, C programming language standards, and Linux Standard Base (LSB)

UNIX History Linux Kernel POSIX Standards GNU Project C Standards SUSv3/SUSv4

Fundamental Concepts

Core operating system concepts: kernel architecture, shell programming, users and groups, directory hierarchy, file I/O model, processes, memory mappings, static and shared libraries, IPC mechanisms

Linux Kernel Shell Scripting File System Hierarchy Process Model Memory Mapping /proc File System

System Programming Concepts

System calls vs library functions, GNU C Library (glibc), error handling with errno, feature test macros, system data types, portability issues in C programming

System Calls Library Functions glibc Error Handling errno Portability

📁 Part 2: File I/O – The Universal I/O Model

File I/O: The Universal I/O Model

File descriptors, open(), read(), write(), close(), lseek(), file offset manipulation, ioctl() operations, universal I/O in Linux

open() read() write() close() lseek() File Descriptors ioctl()

File I/O: Further Details

Atomicity and race conditions, fcntl(), file status flags, duplicating file descriptors (dup/dup2), pread/pwrite, scatter-gather I/O (readv/writev), truncate operations, nonblocking I/O, large file support

fcntl() dup()/dup2() pread()/pwrite() readv()/writev() Scatter-Gather I/O Nonblocking I/O O_NONBLOCK

File I/O Buffering

Kernel buffer cache, stdio library buffering, synchronous I/O (sync/fsync/fdatasync), direct I/O, posix_fadvise(), mixing system calls and stdio

Buffer Cache stdio Buffering sync() fsync() Direct I/O posix_fadvise()

⚙️ Part 3: Process Management and Execution

Processes

Process and program concepts, process ID (PID), parent process ID (PPID), memory layout (text, data, heap, stack), virtual memory management, command-line arguments (argc/argv), environment variables, setjmp/longjmp for nonlocal gotos

Process ID Memory Layout Heap and Stack argc/argv Environment Variables setjmp/longjmp

Memory Allocation

Heap memory allocation with malloc(), free(), calloc(), realloc(), program break adjustment (brk/sbrk), memory allocation implementation, stack allocation with alloca()

malloc() free() calloc() realloc() brk()/sbrk() alloca() Heap Management

Process Creation

Creating processes with fork(), process termination (exit/_exit), waiting for child processes (wait/waitpid), executing programs (exec family), vfork() system call, race conditions after fork(), process synchronization

fork() vfork() exit()/_exit() wait()/waitpid() exec() Process Synchronization

Process Termination

Process termination details, exit handlers (atexit/on_exit), interactions between fork() and stdio buffers

Process Exit atexit() on_exit() Exit Handlers

Monitoring Child Processes

Wait system calls (wait/waitpid/waitid), wait status values, orphan and zombie processes, SIGCHLD signal handling

wait() waitpid() waitid() Zombie Processes Orphan Processes SIGCHLD

Program Execution

Executing programs with execve(), exec family functions (execl, execv, execle, execvp, execlp), PATH environment variable, interpreter scripts, file descriptors and exec(), signals and exec(), system() function

execve() exec Family system() PATH Variable Shell Scripts

Process Creation and Program Execution in More Detail

Process accounting, clone() system call, speed of process creation, effect of exec() and fork() on process attributes

clone() Process Accounting Process Attributes Performance Optimization

🔐 Part 4: Users, Groups, and Process Credentials

Users and Groups

Password file (/etc/passwd), shadow password file (/etc/shadow), group file (/etc/group), retrieving user and group information, password encryption and user authentication

/etc/passwd /etc/shadow /etc/group getpwnam() getgrnam() Password Authentication

Process Credentials

Real user ID, effective user ID, saved set-user-ID, file-system user ID, set-user-ID and set-group-ID programs, supplementary group IDs, retrieving and modifying process credentials

Real UID Effective UID Set-UID Programs setuid()/seteuid() setgid()/setegid() Process Privileges

⏰ Part 5: Time, Timers, and Date Operations

Time

Calendar time, time_t, time conversion functions, broken-down time (struct tm), time zones, locales, updating system clock, software clock (jiffies), process time measurement

time() gettimeofday() gmtime()/localtime() strftime() Time Zones Process Time

Timers and Sleeping

Interval timers (setitimer/getitimer), timer scheduling and accuracy, timeout on blocking operations, sleeping functions (sleep/nanosleep), POSIX clocks, POSIX interval timers, timerfd API

setitimer() sleep()/nanosleep() timer_create() timer_settime() POSIX Timers timerfd

📡 Part 6: Signals – Asynchronous Events

Signals: Fundamental Concepts

Signal concepts, signal types and default actions, changing signal dispositions (signal/sigaction), signal handlers, sending signals (kill/raise/killpg), signal sets, signal mask, pending signals, pause() function

Signals signal() sigaction() kill() Signal Handlers Signal Mask sigprocmask()

Signals: Signal Handlers

Designing signal handlers, reentrant and async-signal-safe functions, global variables in signal handlers (sig_atomic_t), nonlocal goto from signal handler, abnormal process termination (abort), alternate signal stack (sigaltstack), SA_SIGINFO flag, system call interruption and restarting

Signal Handler Design Reentrant Functions sig_atomic_t sigaltstack() SA_RESTART

Signals: Advanced Features

Core dump files, hardware-generated signals, realtime signals, waiting for signals (sigsuspend/sigwaitinfo/sigtimedwait), reading signals via file descriptor (signalfd), interprocess communication with signals

Realtime Signals sigqueue() sigsuspend() sigwaitinfo() signalfd() Core Dumps

🧵 Part 7: POSIX Threads (Pthreads)

Threads: Introduction

Thread concepts, Pthreads API basics, thread creation (pthread_create), thread termination, thread IDs, joining threads (pthread_join), detaching threads, thread attributes, threads vs processes comparison

POSIX Threads pthread_create() pthread_join() pthread_detach() Thread Attributes Multithreading

Threads: Thread Synchronization

Mutexes for protecting shared variables (pthread_mutex), mutex locking/unlocking, mutex deadlocks, mutex types, condition variables (pthread_cond) for signaling state changes, producer-consumer pattern

Mutexes pthread_mutex_lock() Condition Variables pthread_cond_wait() Thread Synchronization Deadlock Prevention

Threads: Thread Safety and Per-Thread Storage

Thread safety and reentrancy, one-time initialization (pthread_once), thread-specific data (TSD), thread-local storage (TLS)

Thread Safety pthread_once() Thread-Specific Data pthread_key_create() Thread-Local Storage

Threads: Thread Cancellation

Canceling threads (pthread_cancel), cancellation state and type, cancellation points, cleanup handlers

pthread_cancel() Thread Cancellation Cleanup Handlers Cancellation Points

💬 Part 8: Interprocess Communication (IPC)

Pipes and FIFOs

Creating and using pipes (pipe), bidirectional communication, pipes and stdio, FIFOs (named pipes), mkfifo(), pipe and FIFO I/O semantics, nonblocking I/O on pipes/FIFOs

pipe() mkfifo() Named Pipes FIFOs IPC Pipes

System V IPC

System V IPC overview, message queues (msgget/msgsnd/msgrcv), semaphores (semget/semop/semctl), shared memory (shmget/shmat/shmdt/shmctl), IPC object permissions, IPC keys and identifiers

System V IPC Message Queues Semaphores Shared Memory msgget()/msgsnd() semget()/semop() shmget()/shmat()

Memory Mappings and POSIX IPC

Memory mappings (mmap/munmap), shared memory mappings, memory-mapped I/O, POSIX message queues (mq_open/mq_send/mq_receive), POSIX semaphores (sem_open/sem_wait/sem_post), POSIX shared memory (shm_open/shm_unlink), memory protection (mprotect)

mmap() munmap() Memory Mapping POSIX Message Queues POSIX Semaphores POSIX Shared Memory mprotect()

💾 Part 9: File Systems and Advanced File Operations

File Systems

Device special files, disks and partitions, file system structure, i-nodes, virtual file system (VFS), journaling file systems, mount points, mounting and unmounting (mount/umount), tmpfs virtual memory file system

File Systems I-nodes VFS mount() umount() tmpfs Journaling

File Attributes

Retrieving file information (stat/lstat/fstat), file timestamps, file ownership (chown/fchown), file permissions, set-user-ID/set-group-ID/sticky bits, umask, chmod/fchmod, extended file attributes (ext2)

stat() File Permissions chmod() chown() umask() File Timestamps

Extended Attributes and Access Control Lists

Extended attributes (EA) overview, system calls for EA manipulation (setxattr/getxattr/listxattr/removexattr), Access Control Lists (ACLs), ACL permission-checking, ACL API

Extended Attributes setxattr()/getxattr() ACLs Access Control Lists File Security

Directories and Links

Directories and hard links, symbolic links, creating/removing links (link/unlink), renaming files (rename), working with symbolic links (symlink/readlink), creating/removing directories (mkdir/rmdir), reading directories (opendir/readdir), file tree walking (nftw), current working directory, chroot

link()/unlink() symlink() mkdir()/rmdir() opendir()/readdir() Hard Links Symbolic Links chroot()

Monitoring File Events

inotify API for monitoring file events, inotify_init/inotify_add_watch, reading inotify events, inotify events types, queue limits

inotify inotify_init() inotify_add_watch() File Monitoring File Events

🌐 Part 10: Sockets and Network Programming

Sockets: Introduction and UNIX Domain

Socket concepts, socket(), bind(), listen(), accept(), connect(), socket addresses, stream sockets, datagram sockets, UNIX domain sockets, socketpair(), socket I/O operations

Sockets socket() bind() listen() accept() connect() UNIX Domain Sockets
Chapter 59-61

Sockets: Internet Domain and Network Programming

Internet domain sockets, IPv4 and IPv6 addresses, network byte order, host and service conversion (getaddrinfo/getnameinfo), TCP/IP fundamentals, UDP sockets, socket options (setsockopt/getsockopt), server design, inetd daemon

Internet Sockets TCP/IP UDP IPv4/IPv6 getaddrinfo() Network Programming Client-Server

Alternative I/O Models

I/O multiplexing with select() and poll(), signal-driven I/O, epoll API (epoll_create/epoll_ctl/epoll_wait), comparing I/O models, edge-triggered and level-triggered notification

select() poll() epoll I/O Multiplexing Event-Driven I/O epoll_wait()

🚀 Part 11: Advanced System Programming Topics

Process Scheduling and Priority

Process scheduling overview, realtime scheduling policies (SCHED_FIFO, SCHED_RR), scheduling priority, CPU affinity, resource limits (getrlimit/setrlimit)

Process Scheduling sched_setscheduler() Realtime Scheduling CPU Affinity Resource Limits setrlimit()

Process Groups, Sessions, and Terminals

Process groups (setpgid/getpgid), sessions (setsid), controlling terminals, foreground and background process groups, job control, terminal I/O, pseudoterminals (pty)

Process Groups Sessions setpgid() setsid() Job Control Terminal I/O Pseudoterminals

Shared Libraries and Dynamic Linking

Creating and using shared libraries, static libraries, library versions, soname, dynamic linking, dlopen/dlsym/dlclose, symbol visibility, library initialization and finalization

Shared Libraries Dynamic Linking dlopen() dlsym() Static Libraries Library Versioning

Daemons and System Logging

Daemon processes, creating daemons, daemon conventions, syslog logging facility (syslog/openlog/closelog), /var/log files

Daemon Processes Creating Daemons syslog System Logging Background Processes

System Limits and System Information

System limits and options, sysconf/pathconf/fpathconf, /proc file system, system identification (uname), retrieving system information

sysconf() /proc Filesystem uname() System Limits System Information

File Locking

File locking overview, flock() for whole-file locking, fcntl() record locking, mandatory vs advisory locking, lock inheritance and release, lock limits and performance

File Locking flock() fcntl() Locking Record Locking Advisory Locking Mandatory Locking

📖 Recommended Learning Path

1 Fundamentals

Start with Chapters 1-3 to understand UNIX/Linux history, standards, and basic system programming concepts including system calls and library functions.

2 File I/O

Master file I/O operations (Chapters 4-5, 13) including open(), read(), write(), and buffering mechanisms – the foundation of all I/O in UNIX.

3 Process Management

Learn process creation, execution, and management (Chapters 6-7, 24-28) including fork(), exec(), wait(), and process attributes.

4 Signals

Understand asynchronous event handling with signals (Chapters 20-22) including signal handlers, signal sets, and realtime signals.

5 IPC

Master interprocess communication mechanisms (Chapters 44-54) including pipes, message queues, semaphores, and shared memory.

6 Threading

Learn POSIX threads programming (Chapters 29-32) including thread creation, synchronization with mutexes and condition variables.

7 Network Programming

Build network applications (Chapters 56-63) using sockets API, TCP/IP, UDP, and advanced I/O models like epoll.

8 Advanced Topics

Explore advanced subjects including process scheduling, daemons, shared libraries, file locking, and terminal I/O.

🔑 Complete Topics Coverage

This Linux system programming course covers POSIX-compliant system programmingGNU/Linux programmingembedded Linux developmentkernel-level programming conceptssystems software developmentlow-level programming in CUNIX API programming, and Linux application development.

Learn essential topics: file descriptor managementprocess controlinter-thread communicationsocket programming TCP UDPPOSIX message queuesshared memory programmingsemaphore programmingsignal handling in Linuxasynchronous I/Omemory-mapped filesvirtual memory managementprocess scheduling algorithmsrealtime programming, and concurrent programming.

Master system calls: fork() system callexec() familywait() and waitpid()pipe() and mkfifo()socket() and bind()pthread_create()pthread_mutex_lock()mmap() and munmap()select() poll() epoll()signal() and sigaction()open() read() write()malloc() and free(), and hundreds more.

Start Your Linux System Programming Journey Today!

This complete index covers all essential topics in Linux and UNIX system programming. Whether you’re preparing for embedded systems development, kernel programming, or building high-performance applications, this comprehensive guide will take you from basics to advanced concepts.

Free Learning to all !!

EmbeddedPathashala.

Leave a Reply

Your email address will not be published. Required fields are marked *