Linux – development of low-level services and libraries (LNXPR1)
Unix-like systems, Linux - programming
On Linux and other Unix systems, applications interact with the operating system via system calls to the kernel and sometimes with shared memory. The system C library and POSIX define APIs beyond ISO C, while Linux offers extra practical extensions for performance and integration.
Interprocess communication includes POSIX and System V queues, semaphores and shared memory, plus sockets and pipes that can transfer file descriptors. Linux integrates signal handling and timer events into event loops. Languages: C, C++, Rust, Python.
Location, current course term
Contact us
The course:
Hide detail
-
Operating system interface
-
System calls (syscalls)
-
Standard library and POSIX.1-2024
-
Tools for tracing kernel communication
-
Errors in system calls
-
Handling fatal and recoverable errors
-
Handling and propagating OS errors
-
System calls interrupted by signals
-
Communication, input and output
-
Standard streams (stdin, stdout, stderr)
-
File descriptors
-
Buffered streams in C, C++ and Rust
-
Filesystem and directory structure
-
Filesystem operations
-
Relative paths and current working directory
-
File permissions and attributes
-
Working with files
-
Opening for reading or writing
-
Hybrid approaches to file access
-
Workarounds for lack of transactions
-
Clocks and time measurement
-
Current time and time intervals
-
Timer signals, events and timerfd
-
Waiting and suspending processes (wait)
-
Process and thread management
-
fork, exec and spawn functions
-
Corresponding system calls
-
Standard threads and pthreads
-
Resource sharing
-
When using fork or clone
-
Closing or preserving resources across exec
-
Program return value
-
Environment and the shell
-
Process groups and background processes
-
System services and the service manager
-
Combining processes started from the shell
-
Operating system tasks
-
Difference between process and thread (LWP)
-
Choosing between multiprocessing and multithreading
-
Threads and processes in C, C++, Rust and Python
-
Signals and their handling
-
Asynchronous signal handling
-
Synchronous handling via timerfd
-
Communication using real-time signals
-
Blocking and non-blocking communication
-
When we don't want syscalls to sleep the process
-
File descriptor readiness
-
EWOULDBLOCK returned instead of blocking
-
I/O multiplexing
-
Waiting for a set of possible events
-
Events come from file descriptors
-
External event-management libraries
-
Basic interprocess communication
-
Pipes between processes (pipe)
-
Named pipes in the filesystem (named pipe)
-
Handling broken pipes and SIGPIPE
-
Message queues
-
POSIX and System V variants
-
Multiple senders and receivers
-
In some ways more flexible than sockets
-
Local (Unix) sockets
-
Forking processes and socketpair
-
Local client-server architecture
-
Socket types and their limitations
-
Network sockets
-
Client-server architecture
-
The Internet and TCP/IP protocol
-
Workaround with SO_REUSEADDR
-
Connection handling strategies
-
Forking processes or starting threads
-
Using a pool of processes or threads
-
Non-blocking sockets and an event queue
-
Name services
-
Domain names and getaddrinfo
-
glibc and /etc/nsswitch.conf
-
Limitations, errors and alternatives
-
Memory management and mapping
-
Dynamic memory allocation (heap, alloca)
-
Mapping files from the filesystem
-
Boundaries between kernel and user space
-
Shared memory
-
Automatic for threads
-
Explicit POSIX or System V (shm)
-
The only communication that does not go through the kernel
-
Passing file descriptors
-
The kernel can transfer file descriptors
-
Can use a pipe or a local socket, for example
-
Any file descriptor can then be sent
-
Synchronization primitives
-
pthreads tools (mutex, condition variable)
-
POSIX and System V semaphores and eventfd
-
Atomic variables and lock-free operations
-
Debugging options
-
ptrace system call
-
Interactive debuggers like GDB
-
Tracers like strace
-
Shared dynamic libraries
-
Linking libraries at program start
-
Explicit loading via dlopen
-
Library dependencies
-
Bonus: Optimized data paths
-
Optimized polling via epoll
-
Zero-copy techniques in the kernel
-
The io_uring mechanism
-
Assumed knowledge:
-
Good knowledge of C programming.
-
Recommended previous course:
-
Linux – Basic Administration (LNX1)
-
Recommended subsequent course:
-
Operating System Interface on Linux and POSIX Platforms (LNXPR2)
-
Schedule:
-
3 days (9:00 AM - 5:00 PM )
-
Language:
-
Vybrané zákaznické reference
ComAp a.s., Jan T.
Linux – development of low-level services and libraries (
LNXPR1)
"Lektor ma viditelne vysokou odbornost a dobre pedagogicke schopnosti. Prostor pro zlepseni vidim ve vyjadrovani, napriklad mene castem pouzivani obratu "...jak kdyby.." :-)"