Solved

SIGALRM doesn't interrupt gets()?

Posted on 1997-07-21
1
232 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
1 Comment
 
LVL 4

Accepted Solution

by:
jos010697 earned 200 total points
Comment Utility
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

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Named range not carried over 10 57
move a line in eclipse 3 60
no14 challenge 14 56
twoTwo  challenge 35 86
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

771 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now