![]() |
C / UNIX Interface
| Duration: 5 days |
| Participants: Experienced C Language Applications Programmers, and Systems Programmers. |
|
Objectives:
Upon successful completion of this course you will be able to:
- Make effective use of the C Language preprocessor. - Use standard C Language library functions to perform operations related to error handling. - Use UNIX system calls to perform operations related to file input and output. - Use standard C Language library functions to perform operations related to file input and output, and to manipulate character strings. - Use UNIX system calls to perform operations related to process creation, execution, and access. - Use standard C Language library functions to perform operations related to process creation, execution, and access. - Use UNIX system calls to perform interprocess communications via pipes. |
| Overview: This course provides experienced C Language programmers with the ability to better utilize the C Programming Language in conjunction with the system calls and standard library functions of the UNIX operating system. You are prepared to fully utilize the UNIX system calls and standard library functions to deal with processes and perform operations related to input and output. |
| Prerequisites: At lease six (6) months of C Language programming experience. Some knowledge of the UNIX system tables related to processes and to the file system is helpful. |
| Format: Lecture and discussion with lab sessions. |
|
Topic Outline:
- C Language Preprocessor Preprocessor Relationship to Compiler Directive Syntax Macro Substitution Token Replacement Macro Expansion Include Files Conditional Compilation Typedefs - System Calls and Error Handling System Calls vs. Library Routines Error Codes Error Variables System Error Messages (perror) Obtaining Core Dumps (abort) - I/O System Calls UNIX File Types File Definition System File Information (inode) File Permission Information File Descriptors File I/O Opening and Closing Files (open, close) Reading and Writing Data (read, write) Creating New Files (creat) Positioning within Files (lseek) Linking and Removing Files (link, unlink) Processing Directories Directory Structure Directory Processing Routines Affecting File Control Information Querying (stat, access) Default permissions (umask) Changing permissions (chmod) Setting Times (utime) Modifying Status (chown) Changing Directory (chdir) - Standard Library File Access freopen fseek ftell fileno fdopen fflush Process Communication popen pclose File Status feof ferror clearerr Character Classification isalpha islower isupper isdigit isspace Character Translation toupper tolower String Comparison strcmp strncmp String Handling strlen strcpy strncpy String Manipulation strchr strrchr strcat strncat strtok - Process System Calls Creating a New Process (fork) Executing a New Process exec Variations Inherited Attributes After exec Process Termination (exit, wait) Suspending Process Execution (sleep) Controlling Process Information setpgrp getpid getppid getpgrp Signaling a Process Sending a Signal (kill) Acting on a Signal (signal) Ignoring Signals Defaulting Signals Catching Signals - Process Library Process Environment What is Process Environment Parts of Process Environment Obtaining Environment Information Password Information What is Password File Obtaining Password File Information Obtaining Time & Date Information time ctime Processing Command Line Options (getopt) Dynamic Storage Allocation malloc realloc free - Pipes UNIX Internal File Tables Table Descriptions System File Table System Inode Table Unrelated Processes Related Processes Interprocess Communication System Calls pipe dup fcntl Self Communication Parent to Child Communication Child to Parent Communication End of Course Case Study |
|
|