Solved

SIGALRM doesn't interrupt gets()?

Posted on 1997-07-21
1
247 Views
Last Modified: 2013-12-26
I supposed that system calls such gets(), getc() should be interrupted by SIGALRM. And it seems to be true under Unixware 2.01, but it doesn't work under Linux. Why? What should I use to implement timed read?
0
Comment
Question by:boa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 4

Accepted Solution

by:
jos010697 earned 200 total points
ID: 1294019
You're halfway there; the default behavior of 'read' is to
restart after it has been interrupted by a signal _and_ if
nothing has been read just before the signal was raised.
BTW, gets() or getc() aren't system calls; it's the 'read'
call underneath that does all the work.

Check out the sigaction() call; it tells the signal handlers
_not_ to restart certain interrupted system calls ('read' is
one of them), by resetting the SA_RESTART bit ...

kind regards,

Jos aka jos@and.nl
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

626 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question