Operating System - HP-UX
1821986 Members
3486 Online
109638 Solutions
New Discussion юеВ

What kind of reasons caused select() call return EINTR?

 
Ying Li_1
Occasional Contributor

What kind of reasons caused select() call return EINTR?

Hello,

In my application, we often got a return value EINTR for select() call so that our application server shuted down. I'd like to know what kind of possible reasons to cause this happened.

In my case, I used select as below on the 11.23.
select(FD_SETSIZE, &buf, NULL, NULL, NULL); Is passing FD_SETSIZE as the first parameter to select() call safer?

Thanks in advance.
-Ying
2 REPLIES 2
A. Clay Stephenson
Acclaimed Contributor

Re: What kind of reasons caused select() call return EINTR?

That simply means that the process received a non-blocked signal.
If it ain't broke, I can fix that.
rick jones
Honored Contributor

Re: What kind of reasons caused select() call return EINTR?

manpages can be useful things :)

$ man select

...

ERRORS
Under the following conditions, select() fails and sets errno to:

...

[EINTR] The select() function was interrupted before any of the selected events occurred and before the timeout interval expired. If SA_RESTART has been set for the interrupting signal, it is implementation-dependent whether select() restarts or returns with EINTR.


If you want to see _which_ signal was raised, you could try using tusc to trace the process - IIRC it will show the signal. ftp://ftp.cup.hp.com/dist/networking/tools/
there is no rest for the wicked yet the virtuous have no pillows