Networking
cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Poll on HPUX version 11.23 onwards

 
Highlighted
SamNoor
Occasional Visitor

Problem with Poll on HPUX version 11.23 onwards

Hi There,

I am facing a problem with Poll on HPUX platform. 

Poll is being called for read file descriptor. The revents are watched for POLLIN  as mentioned in below code.

if( !( revents & POLLIN))
{
clear_the_mask_value(readfds, fd);

On HPUX, we are getting revents set to POLLERR for read file descriptor. on other UNIX platforms we are getting revents set to POLLIN.  Is this expected? is something changed in HPUX Poll call ? Please suggest.

2 REPLIES 2
MKJ-HPE
HPE Pro

Re: Problem with Poll on HPUX version 11.23 onwards

pollerr indicates an error has occurred on the file descriptor. 

>> is something changed in HPUX Poll call ? Please suggest.

You can find details on HP-UX Polling mechanism in the documet "STREAMS/UX Programmer’s Guide HP-UX 11i v3".

The per above document, some of the  important aspects of poll(2) functionality are as below :

• The poll (2) system call returns to the calling application when one of the following two conditions is met.
It encounters at least one read-queue with at least one of the requested events (or a POLLERR, POLLHUP, or
POLLNVAL), or the wait period reaches the specified timeout value in milliseconds.
• A timeout value of -1 implies no timeout, that is, poll (2) will wait until at least one requested event (or a
POLLERR, POLLHUP or POLLNVAL) occurs on one of the read queues.
• For a timeout value of 0, poll (2) checks to see if any of the requested events occurred on any one of the
read-queues, and returns immediately, regardless of the results.

If you have any specific requirement/query on POLL functionality, please open a case wth HPE Support Center.


Accept or Kudo
SamNoor
Occasional Visitor

Re: Problem with Poll on HPUX version 11.23 onwards

Thank you for the detailed information.

So it is confirmed that in case of read-queue atleast one of the events (a POLLERR, POLLHUP, or
POLLNVAL) would occur and we need to handle it. 

Is this specific to HPUX? i donot see the same behavior in other unix flavor. Any reason behind it ?