By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,750 Members | 1,159 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,750 IT Pros & Developers. It's quick & easy.

ualarm() Interrupting select()

P: n/a
For the following code snippet:

for ( ;; ) {
numFDInSet = select( fdmax+1, &readfds, NULL, NULL, &tv );

// ...

signal( SIGALRM, alarm_handler );

// ...

ualarm( waitPeriod * 1000, 0 );
}

The problem being if the alarm goes off when select() is scanning the
FD_SET, select is interruped with the following error:

Error on select(): Interrupted system call

Ideally, when the alarm goes off, I would still want select() to continue
scanning the FD_SET and the "main loop" to continue ( select() is inside
the main loop ). Any suggestions to achieving achieving this is
appreicated.

Jul 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Sun, 27 Mar 2005 11:59:34 -0500, William
<wh******@student.cs.uwaterloo.ca> wrote in comp.lang.c++:
For the following code snippet:

for ( ;; ) {
numFDInSet = select( fdmax+1, &readfds, NULL, NULL, &tv );

// ...

signal( SIGALRM, alarm_handler );

// ...

ualarm( waitPeriod * 1000, 0 );
}

The problem being if the alarm goes off when select() is scanning the
FD_SET, select is interruped with the following error:

Error on select(): Interrupted system call

Ideally, when the alarm goes off, I would still want select() to continue
scanning the FD_SET and the "main loop" to continue ( select() is inside
the main loop ). Any suggestions to achieving achieving this is
appreicated.


There are no functions named select or ualarm defined by the C++
language. These are extensions provided by your particular
compiler/operating system combination, not the language. You need to
ask in a group that supports that combination.

There isn't enough information in your post's headers for me to tell
for sure, so I'll suggest a few possibilities:

news:comp.os.linux.development.apps for Linux
news:comp.unix.programmer for UNIX variants
news:comp.os.ms-windows.programmer.win32 for Windows

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jul 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.