On Thu, Aug 22, 2002 at 07:37:17PM -0400, dhcp@softsysgrp.com wrote: > > I agree with everything you say below, I was just questioning the > implementation. The select call does take a timeout pointer value, and > (struct timeval *)0 is a pointer value that points to address 0 which I > don't think is the same as a pointer to a variable that has been set to > zero. No they are different and have different meanings to select. The manpage for select() (on Linux at least) says: timeout is an upper bound on the amount of time elapsed before select returns. It may be zero, causing select to return immediately. (This is useful for polling.) If timeout is NULL (no timeout), select can block indefinitely. As you can see, there is a difference in functionality whether the values of "timeout" is a valid structure in memory with a value of zero in it and the NULL pointer (pointing to address 0). They do different things. Now to quote Ted: > The select system call is supposed to take a timeout pointer value of zero > to mean no timeout, not timeout immediately. If your operating system > does not support this, it's not compatible. select is a bsd thing, and > AFAIK is not included in POSIX, so this isn't a terrible faux pas, but the > problem is with the operating system, not the code in dispatch.c. It is the intention of the use of select() in this case to block until there is an I/O condition on one of the "select"ed sockets. It is not supposed to return immediately as it would if the timeout value were valid and had a zero in it. b. -- Brian J. Murrell -- Attached file included as plaintext by Ecartis -- -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.7 (GNU/Linux) iD8DBQE9ZXhxl3EQlGLyuXARApyRAJ4nfqJXYZUIFmJB/34Wls+dXMBnRwCggFUF LIVSB/KOWfbd+48YopFNALQ= =DLGU -----END PGP SIGNATURE----- Content-Description: Signature-Type: text/plain -- Brian J. Murrell