ADVANCED UNIX PROGRAMMING Course Duration: 4 Days Course Overview: The UNIX operating system providex a rich API which has been standardized across all UNIX platforms. This five-day course covers most of the POSIXstandard calls and the basics of UNIX network programming. Some of the topics covered in this course are device and file I/O, memory mapped I/O, file and directory manipulation, process manipulation, signals, pipes, and network communication, both client and server. This class is aimed at students who already know the basics of C programming and want to know how to take advantage of the services (system calls) offered by a Linux or UNIX kernel. The class also covers functions in the ANSI standard C library that provide either commonly-needed functions and/or a better interface to some of the system calls. After the student has completed the source, they will be able to write portable code that can make use of of file and directory manipulation, processes, signals, inter-process communication on within a machine, and network communication. This course is hands on, with an approximate 50/50 percent mix of lab and lecture. Who should attend: Programmers who: want to know how to program using the standard system calls and library functions provided on all UNIX systems, want to know how to write network client and server programs will benefit most from this course. Prerequisites: The programmer must · · ·
be familiar with the C programming language, be familiar with basic UNIX file manipulation, knows how to use a UNIX editor or knows how to transfer files to/from themachine where the student will be doing the editing.
COURSE OUTLINE Introduction · Student and Instructor introductions · Assumptions about your background · Class logistics, schedule · Class texts · Typographic conventions · Standards · Standards and portability · System Calls and Library Functions · Error handling · Lab Unbuffered I/O · Introduction · File descriptors · open · umask · close · read and write · lseek · Lab The Standard I/O Library · Introduction · Opening and closing FILEs · Buffering · Other non-I/O stdio functions · I/O functions · Lab Miscellaneous Functions, part 1 · Time functions and values · Determining system limits at runtime · Password and group file functions · Lab Files and Directories, part 1 · The stat functions · st_mode: File type and permission bits · chmod and fchmod · access: check file accessibility · File ownership of new files · Changing ownership · File size · File times · Lab
Files and Directories, part 2 · Inode number · rename · Link count · Linking files · Unlinking files · Symbolic links · Filesystem · Lab Files and Directories, part 3 · Creating directories · Deleting directories · Changing the current directory · The current directory's path · Reading from directories · Lab Other I/O Topics · Atomic appending · File Sharing · Synchronous I/O · Memory mapped I/O · Lab The Environment of a Process · Command line arguments · Command-line argument processing · Environment variables · Process termination · Dynamic memory allocation · Lab Working with Processes, part 1 · Process identifiers · Process groups · Sessions · Controlling terminal · fork · Waiting for children · Zombies · Lab
Introduction select select and non-blocking I/O A networking example Lab
Working with processes, part 2 · The exec family of functions · Set user-ID and group-ID files · Lab
· · · · ·
Simplified signal handling · Signal concepts · Some important signals · Generating signals · kill · alarm · Handling signals · Example · Lab
Network Communication, part 1 · IPv4 address structure · Byte ordering · Name and address mapping · Utility functions · Example · Ports · Example · Lab
Reliable signal handling · Unreliable signals · Reliable signal terminology · Signal sets and the functions that work with them · Handling signals · Interrupted system calls · Reentrant functions · fork, exec, and signals · Lab
Network Communication, part 2 (UDP) · An introduction to UDP · Function calls used with UDP · A sample server · A sample client · Lab
Miscellaneous Functions, part 2 · Resource usage · Setting resource limits · Non-local gotos · Lab Daemon Processes · What is a daemon? · Becoming a daemon · Daemon error logging · Lab Advanced I/O, part 1 · I/O Redirection · fcntl · File locking · Lab Interprocess Communication · Pipes · Shared memory · Command-line access to IPC structures · Lab Advanced I/O, part 2
Network Communication, part 3 (TCP) · An introduction to TCP · Function calls used with TCP · A sample server · A sample client · Lab Network Communication, part 4 · UDP programming considerations · TCP programming considerations · Server architecture choices · Getting a signal when I/O is available · Socket options · Lab