Subject: poll and struct pollfd arrays...
To: None <netbsd-users@netbsd.org>
From: Josh <pkplex@orcon.net.nz>
List: netbsd-users
Date: 12/03/2004 14:51:48
Hello...

I am using netbsd 2.0 RC4... and while writing a server program I stumbled into a poll problem;

I have a pollfd array:

struct pollfd foo[10];

I set the foo array up:

for (x = 0; x < sizeof(foo) / sizeof(struct pollfd); x++) {
  foo[x].fd = -1;
  foo[x].events = 0;
}

I create a server socket, and use the 10th element in the foo array:

foo[9].fd = server_socket;
foo[9].fd = POLLIN;

I then call poll, But it never triggers.

If I put it at the start of the array, it works. Is this deliberate?

Thanks, 
 Josh.