lkml.org 
[lkml]   [1997]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: how to tell if data is available for a file descriptor
On Fri, 12 Sep 1997, Jason Burrell wrote:

> Unless I'm missing something blatently obvious, NULL == 0, and thus this
> manpage is nonsensical. "It may be zero, causing select to return
> immediately. If timeout is NULL (no timeout), select can block
> indefinately." How can it return immediately *and* block indefinately?
>
> I'm confused. I've never actually used select(), as odd as that may seem
> to some. Well, not with indefinate or zero timeouts, anyway.

If the value of the passed pointer is 0 (a.k.a. NULL), then select() will
block indefinitely. The "zero" refered to in the man page is the value
contained within the fields of a passwd timeval strcuture. Thus, the
pointer would be non-NULL and the fields tv_sec and tv_usec would be 0.

Tom



\
 
 \ /
  Last update: 2005-03-22 13:40    [W:0.031 / U:0.400 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site