Q: SIGALRM deferred during read() ?
From: Len Budney (lbudney_at_pobox.com)
Date: 10/28/03
- Next message: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Previous message: Chuck Dillon: "Re: Porting from OpenBSD/Linux to Solaris : daemon(3)"
- Next in thread: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Reply: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Reply: Floyd Davidson: "Re: Q: SIGALRM deferred during read() ?"
- Reply: Nils O. Selåsdal: "Re: Q: SIGALRM deferred during read() ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 28 Oct 2003 07:05:33 -0800
Hello,
I'm writing an app which sets an alarm, copies stdin to a file, and
quits if SIGALRM is received.
The first version set a flag in the alarm handler, set using
sigaction, and quit if read() returned -1 and errno was EINTR. The app
would never exit. If I also checked the flag set by the alarm handler,
then the app still wouldn't exit, until I supplied some input on
stdin.
Then I changed the handler to call _exit() directly, with the same
result: the app will not exit until I supply input on stdin.
Running strace indicates that the app is calling read(); during that
time I can send SIGALRM manually as much as I wish, with no effect. It
appears as if SIGALRM is deferred during the read() call, but I
explicitly didn't ask for this behavior. The behavior is the same
under Linux and FreeBSD. If I change the code to use SIGTERM or
SIGKILL instead of SIGALRM, the app dies immediately.
Is there something obvious I'm missing?
Thanks,
Len.
PS The code is somewhat involved, so paring it down to something
postable will be a chore. I'm first posing this as a general question,
in hopes I'm missing something obvious.
- Next message: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Previous message: Chuck Dillon: "Re: Porting from OpenBSD/Linux to Solaris : daemon(3)"
- Next in thread: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Reply: David Schwartz: "Re: SIGALRM deferred during read() ?"
- Reply: Floyd Davidson: "Re: Q: SIGALRM deferred during read() ?"
- Reply: Nils O. Selåsdal: "Re: Q: SIGALRM deferred during read() ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|