by W. Richard Stevens
Addison-Wesley Professional Computing Series
0-201-56317-7 * Hardcover * 768 pages * ©1992
[Buy this book]
Example | Relevant Functions | |
---|---|---|
15.1 | A program to drive the add2 filter (14.8) |
signal,
s_pipe,
fork, close, fgets, fputs, strlen, write, read, err_msg, err_sys, err_quit (Stevens' lib), ferror, dup2, printf, execl, |
15.2 | s_pipe:
Create a full-duplex pipe |
pipe |
15.3 | s_pipe:
Create a full-duplex pipe |
socketpair |
15.4 | send_err: |
strlen, writen (Stevens' lib), send_fd (Stevens' lib) |
15.5 | send_fd (SVR4 version) : |
write, ioctl |
15.6 | recv_fd
(SVR4 version) : |
getmsg, err_ret (Stevens' lib), err_dump (Stevens' lib), err_sys (Stevens' lib), ioctl |
15.7 | send_fd
(4.3BSD/SunOs Version) : |
sendmsg |
15.8 | recv_fd
(4.3BSD/SunOs version) : |
recvmsg, err_ret (Stevens' lib), err_dump (Stevens' lib), err_sys (Stevens' lib) |
15.9 | send_fd
(4.3BSD Reno/4.4BSD Version) : |
malloc, sendmsg |
15.10 | recv_fd
(4.3BSD Reno/4.4BSD version) : |
malloc,
recvmsg, err_ret (Stevens' lib), err_dump (Stevens' lib), err_sys (Stevens' lib) |
15.11 | The open.h header: |
csopen:
Client/Server open (Stevens' library function) |
15.12 | Remote get file:
a client program that: |
fgets,
read,
write,
close, csopen, err_sys (Stevens' lib) |
15.13 | csopen: |
s_pipe,
err_sys (Stevens' lib), fork, close, dup2, execl, sprintf, writev |
15.14 | The opend.h
header file |
Functions appear below |
15.15 | main server side function |
read,
exit, err_sys (Stevens' lib), request (Stevens' func) |
15.16 | request |
buf_args (Stevens' func), cli_args (Stevens' func), send_err (Stevens' func), |
15.17 | The buf_args function |
strtok, cli_args (Stevens' func. Indirect call) |
15.18 | The cli_args function |
strcmp, strcpy, atoi |
15.19 | serv_listen |
unlink,
creat,
close, pipe, ioctl, fattach |
15.20 | serv_accept |
ioctl |
15.21 | cli_conn |
open, isastream |
15.22 | serv_listen |
socket,
unlink, memset strcpy, strlen, bind, listen |
15.23 | cli_conn |
socket,
memset,
sprintf, getpid, strlen, err_quit (Stevens' lib), unlink, bind, chmod strcpy, connect, |
15.24 | serv_accept |
accept, stat, time, unlink |
15.25 | csopen: |
cli_conn (Stevens' func.), err_sys (Stevens' lib), sprintf, strlen, writev recv_fd |
15.26 | The opend.h header file |
cli_args (Stevens' func.) client_add (Stevens' func.), client_del (Stevens' func.), loop (Stevens' func.), request |
15.27 | client.c: |
malloc,
realloc, err_sys (Stevens' lib), |
15.28 | Main server function |
getopt,
err_quit (Stevens' lib), daemon_init (see 13.1), loop |
15.29 | loop (Version 1): |
select,
read,
close, serv_listen (Stevens' func), serv_accept (Stevens' func), log_sys (Stevens' lib), log_msg (Stevens' lib), client_add (Stevens' func), client_del (Stevens' func), request (Stevens' func) |
15.30 | loop (Version 2):
|
read,
malloc,
close, err_sys (Stevens' lib), log_sys (Stevens' lib), log_msg (Stevens' lib), serv_listen (Stevens' func), serv_accept (Stevens' func), client_add (Stevens' func), client_del (Stevens' func), request (Stevens' func) poll |
15.31 | request: |
open,
sprintf, log_sys (Stevens' lib), log_msg (Stevens' lib), buf_args (Stevens' func), cli_args (Stevens' func.) send_err (Stevens' func), send_fd (Stevens' lib), close, |