CSE 190 Sp 2000 -- Lecture 10 -- May 4, 2000


We talked about why sometimes waipid(2) is preferrable to wait(2), especially if you don't want to check the returned pid.

We also talked about inetd, the networking master daemon. You should glance at its configuration file /etc/inetd.conf to see what's there. I mentioned using fcntl to make I/O on a descriptor be non-blocking. This is done using the F_SETFL flag to set the O_NDELAY or the O_NONBLOCK flag. The latter is the POSIX-compliant way, so is preferred. I also talked about using select(3c) to wait until I/O is possible. This is done for accept(3N) as well as for read(2)ing and write(2)ing.

N.B. Solaris prefers the use of poll(2). select(3c) is built on top of this. On some BSD-derived systems, only select is available. poll is part of the XPG4 standard.

To build netd, netdata, and net_redir on solaris, the command that you'll have to run is

cc -o netd netd.c -lnsl -lsocket
cc -o netdata netdata.c -lnsl -lsocket
cc -o net_redir net_redir.c -lnsl -lsocket
after downloading these C files and the comp_environ.h header file. Note that an earlier version of netdata.c needs to have an #include directive changed so it will pick up comp_environ.h.
[ search CSE | CSE home | bsy's home page | webster i/f | MRQE | google | yahoo | hotbot | lycos | altavista | pgp key svr | spam | commerce ]
picture of bsy

bsy+cse190.s00@cs.ucsd.edu, last updated Thu May 4 18:32:33 PDT 2000. Copyright 2000 Bennet Yee.
email bsy.


Don't make me hand over my privacy keys!