I teach both "standard" and
tailored Linux and UNIX system programming courses of
varying length, based on the content of
The Linux Programming Interface.
"Standard" courses are five days long.
The content may vary a little,
according to specific topic requests and time constraints,
but will look more or less as in the outline shown below.
By default, these courses are oriented towards Linux,
but the Linux-specific material is clearly delineated, so that,
like
The Linux Programming Interface,
the courses are also useful to attendees working on
UNIX systems other than Linux.
The courses include practical programming sessions,
and you should be prepared to work fairly hard (and also learn a lot)
during the week.
The length and content of tailored courses is determined by your choice
of topics, typically based on a subset of
the topics
in
The Linux Programming Interface.
(Relevant topics that are not in the list are also possible;
contact me if you have specific requests.)
Prerequisites
You should have a reading knowledge of the C programming language.
(The content of the course is applicable
in a range of compiled programming
languages, such as C++ and
D, and scripting languages
such as Perl, Python, and Ruby, but all of the examples
presented in the course will be in C.)
You should have a basic knowledge of UNIX/Linux shell commands.
The requirements here are not arduous, but you should have some
experience of logging into a UNIX or Linux system,
know how to use basic commands such as ls,
grep, and cp,
and be able to use one of the
available text editors (e.g., vi or emacs).
Rates
Contact me by email regarding availability and rates.
(Rates are negotiable,
depending on the amount of travel required and the location;
I have varied and somewhat adventurous travel interests,
which may work in your favor.)
Inquiries
General inquiries about the course should be sent to
training AT man7.org.
Mailing list
If you would like to be added to a mailing list to receive notifications of
"standard" training courses that are scheduled in the future,
send a mail (noting your location) to
training AT man7.org.
Likely future locations are Europe and USA West Coast,
but other locations may also be possible,
especially if I can schedule them to coincide with
an interesting conference.
"Standard" Linux/UNIX System Programming Course Outline
History and Standards
UNIX; BSD & System V
GNU project; Linux Kernel
POSIX, SUSv3, SUSv4
Concepts
System calls and library functions
Error handling
Feature test macros
System data types
System limits and options (sysconf(), pathconf())
System parameters: the /proc file system
File I/O
I/O system calls versus stdio
I/O system calls: open(), close(), read(), write()
Effect of I/O buffering in stdio and the kernel; controlling buffering
Seeking to a file offset: lseek()
ioctl()
Atomicity and race conditions
File control: fcntl()
Open file status flags
Open files and file descriptors
Duplicating file descriptors
Processes
Process ID and Parent process ID
Memory layout
Stack
Heap
Command-line arguments
Environment list
Nonlocal gotos: setjmp() and longjmp()
Process Credentials
Password and group file
User and group IDs
Real, effective, and saved set IDs
Supplementary group IDs
Set-user-ID and set-group-ID programs
Retrieving and modifying process credentials
Time
Measuring time
Converting and displaying times and dates
POSIX clocks
File Attributes
Retrieving file information: stat()
File timestamps
File ownership
File permissions
Directories and Links
Hard and soft (symbolic) links
Directories
Scanning directories; walking directory trees
Current working directory
Working with pathnames
Monitoring File System Events: inotify
The inotify API
inotify events
inotify limitations
Signals
Signal types and default actions
Setting signal dispositions
Signal handlers
Sending signals
Signal sets
Blocking signals (the signal mask)
Interruption and restarting of system calls
Designing signal handlers
Realtime signals
Waiting for signals
Reading signals via a file descriptor (signalfd)
Timers and Sleeping
Sleep APIs
POSIX interval timers
Timers that notify via file descriptors: timerfd
Older APIs for sleeping and setting timers
Process Creation and Termination
Process creation: fork()
Race conditions after fork()
Process termination: exit(3) and _exit(2)
Exit handlers
Waiting for child processes: wait(), waitpid(), waitid()
The SIGCHLD signal
Executing Programs
execve()
exec() library functions
Interpreter scripts
File descriptors and exec()
Signals and exec()
Executing shell commands: system()
Threads
Thread creation
Thread termination
Joining and detaching threads
Threads versus processes
Protecting shared resources: mutexes
Signaling state changes: condition variables
Overview of advanced Pthreads features
Daemons
Steps in creating a daemon
Using SIGHUP to reinitialize a daemon
Message logging: syslog
Secure Programming
A checklist for writing safe and robust programs
Capabilities
Interprocess Communication Overview
Taxonomy of IPC facilities
Comparison of IPC facilities
Pipes and FIFOs
Creating and using pipes
Using pipes to connect filters
Communicating with shell commands: popen() and pclose()
FIFOs
Semantics of I/O on pipes and FIFOs
Memory Mappings
Overview
Private file mappings
Shared file mappings
Anonymous mappings
Swap space overcommitting
Introduction to POSIX IPC
Common features of POSIX IPC
Contrast with System V IPC (why POSIX IPC is preferred)
POSIX Message Queues
Open, closing, and unlinking MQs
Message queue attributes
Exchanging messages
Message notification
Message queue limits
POSIX Semaphores
Named semaphores: opening, closing, and removing
Semaphore operations
Unnamed semaphores
Semaphore limits
POSIX Shared Memory
Opening shared memory objects
Using shared memory objects
Removing shared memory objects
File Locking
BSD file locks
POSIX (fcntl()) locks
Limitations of file locking APIs
Introduction to Sockets
Basic socket system calls
Stream sockets
Datagram sockets
UNIX Domain Sockets
Stream and datagram sockets
Socket permissions
Creating a socket pair: socketpair()
Linux abstract sockets
Internet Domain Sockets
TCP/IP fundamentals
Protocols and layers: IP, UDP, and TCP
IP addresses
Port numbers
Internet socket addresses
Data representation issues
Domain Name System
/etc/services file
Converting host and service names between symbolic and binary form: getaddrinfo() and getnameinfo()