[118] in 6.033-lab

home help back first fref pref prev next nref lref last post

Re: correction? and is it necessary

daemon@ATHENA.MIT.EDU (Kevin Fu)
Sun Feb 21 19:00:57 1999

To: 6.033-lab@MIT.EDU
Date: Sun, 21 Feb 1999 19:00:50 EST
From: Kevin Fu <fubob@MIT.EDU>

Ivan points out a correction in my statement about select().  The
semantics of its return value depends on your operating system.

--------
Kevin E. Fu (fubob@mit.edu)
PGP key: finger fubob@monk.mit.edu

------- Forwarded Message
To: 6.033-lab-tas@MIT.EDU
Subject: correction? and is it necessary
Date: Sun, 21 Feb 1999 14:37:19 EST
From: Ivan D Nestlerode <nestler@MIT.EDU>


I think that the answer to this students question is implementation-
dependent.

>If file descriptor n is ready for both input and output, and no other
>descriptors are ready, does select return 1 or 2?
>The info in the handout is not clear. Is there a manpage for it?

The TA's said select will return the total number of bits set in the
bit masks.

In Stallman's "Advanced Programming in the UNIX Environment", it says
on p. 400 that there is a discrepancy in the BSD and SVR4 behaviors
in regard to when an fd is in ready in both read and write. BSD returns
2 and SVR4 returns 1 according to this.

Also, isn't it possible to implement cb_check() without worrying
about which positive value select returns? I didn't find the need
to check the value (other than checking for a negative value), and
I think I have cb_check() working properly.

Ivan

------- End of Forwarded Message


home help back first fref pref prev next nref lref last post