nanomsg/nanomsg — pull request #233 by mdre77 (2014-04-02 06:12:40+00:00)
Title: Added poll modification flag NN_POLLSYS

The patch adds the possibility to poll for system file handles. This avoids using socket options to extract NN_RCVFD/NN_SNDFD for use in another poll wrapper.
```
struct nn_polld pfd [2];
pfd [0].fd = nanomsgFD;
pfd [0].events = NN_POLLIN | NN_POLLOUT;
pfd [1].fd = systemFD;
// now tell nanomsg that we are polling a native file handle
pfd [1].events = NN_POLLIN | NN_POLLSYS;
rc = nn_poll (pfd, 2, 2000);
if (rc == 0) {
printf ("Timeout!");
exit (1);
}
if (rc == -1) {
printf ("Error!");
exit (1);
}
if (pfd [0].revents & NN_POLLIN) {
printf ("Message can be received from s1!");
exit (1);
}
```