[att.unix] HELP PLEASE: select

bfb@mtund.UUCP (09/17/87)

---

	5.3 includes a better select() called poll().  Poll takes an array of
pollfd's a long which is the number in the array and a timeout in milliseconds.
You can also get a signal when there is something waiting to poll on.

Undocumented features:
timeouts >= than MAXINT/HZ crash the machine in strange ways in 5.3 may be fixed in
5.3.1.
If you need to sleep with a granularity in milliseconds set the fd in a pollfd to
-1 (ignore) then poll on it with the time you want to sleep in the timeout.

More stuff than you wanted to know:
5.3 comes with a million new features that nobody inside att seems to know about.
For those people that think sockects are the greatest thing since irradiated
food read about TLI in section 3N.  If you need pty's try a stream pipe and
LD0 and ntty.

For you att people still out there running 4.2, 5.3 is better and 9.5 is on
the way.

Barry Books
mtune!mtund!bfb

better is bigger

nz@hotlg.UUCP (09/18/87)

In article <891@mtund.ATT.COM> bfb@mtund.UUCP (jrc-Barry Books) writes:
 > ---
 > 
 > 	5.3 includes a better select() called poll().  Poll takes an array of
 > pollfd's a long which is the number in the array and a timeout in milliseconds.
 > You can also get a signal when there is something waiting to poll on.

Poll is not better than select.  At best, it is equivalent.  If you
want to poll on a non-stream, you are just plain out of luck.  At least
all the doc I have seen said that poll only works for steams.  Select 
also can take a time-out time.  Barry also mentioned streams v. ptys.
I believe that streams are superior conceptually, but it they don't provide
the functionality of a pseudo-terminal then the conceptual niceness
doesn't matter.


 > More stuff than you wanted to know:
 > 5.3 comes with a million new features that nobody inside att seems to know about.

Too true, unfortunately.  Maybe AT&T-IS should publish a list of the order
numbers for some of the neat books about SysVr3, so that those of us out here
with no easy access to them can order our own copies easily.  Barry, if you
have a minute, please post some references about streams, TLI, and other neat
features of 5.3.

 > For those people that think sockects are the greatest thing since irradiated
 > food read about TLI in section 3N.  If you need pty's try a stream pipe and
 > LD0 and ntty.

The problem with TLI, as I see it, is that there is no simple way to find
out who you want to talk to on another machine.  For instance, one piece
of documentation I read (a long time ago) contained a line of code that
went something like this:

	tli.address = get_tliaddr();    /* magic address-generator */

Sockets, as implemented on BSD, have a complicated but usable addressing
scheme associated with them, courtesy of TCP, Internet, etc.  Maybe this
issue has been addressed since that last time I looked into it, but I have
heard rumors to the contrary.

 > For you att people still out there running 4.2, 5.3 is better and 9.5 is on
 > the way.

I hope that most of the people in AT&T who run Berk UNIX are up to 4.3 by now.
SysVr3 is a big step in the right direction, but I'm afraid I feel that it
still has some catching up to do.  Pet Peeve: Why is Wollongong still making
the Ethernet support product for the 3B2 and VAX for System V?  Why doesn't
AT&T have a competing product??   And as long as I am garnering flames here,
when is some version of System V going to have reasonably long filenames?

 > Barry Books

-- 
...nz  (Neal Ziring  @  ATT-BL Holmdel, x2354, 3H-437)
	"You can fit an infinite number of wires into this junction box,
	but we usually don't go that far in practice."
					London Electric Co. Worker, 1880s