| Example | Relevant Functions |
1.1 | List all files in a directory |
opendir, readdir, closedir |
1.2 | Copy standard input to standard output (unbuffered) |
read,
write
|
1.3 | Copy standard input to standard output (buffered, using stdio) |
getc,
putc,
ferror,
|
1.4 | Get process ID |
getpid
|
1.5 | mini-shell: read commands from stdin and execute them |
fgets,
fork,
execlp,
waitpid
|
1.6 | Print system errors |
strerror,
perror,
errno
|
1.7 | Print User-ID and Group-ID |
getuid,
getgid
|
1.8 | mini-shell (read & exec commands) + basic signal handling |
fgets,
fork,
execlp,
waitpid,
signal,
SIGINT, SIG_ERR
|