Subject: poll and struct pollfd arrays...
To: None <>
From: Josh <>
List: netbsd-users
Date: 12/03/2004 14:51:48

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?