Jump to content
  • Advertisement
Sign in to follow this  
faculaganymede

[.net] C/C++: select() and signal() ??

This topic is 4261 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

C/C++ gurus, I am looking a some code written by another person:
int main()
{
...
signal(...);
signal(...);
signal(...);
...

time_struct.tv_sec = 0;
time_struct.tv_usec = 500000;

select( (int) NULL, (fd_set *)NULL, (fd_set *)NULL,(fd_set *)NULL, &time_struct );
...
return 0;
}

Notice all the parameters passed to select() are NULL, what is the purpose of this call to select()? How is select() related to the signal() calls, if at all?

Share this post


Link to post
Share on other sites
Advertisement
Here select() will be waiting for 500000 microseconds. signal() registers signal handlers, which are handled asynchronously and thus may be called even while select() is waiting. Knowing what the signals are would be helpful.

These aren't C/C++ but POSIX functions.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!