For Programmers: Free Programming Magazines  


Home > Archive > Unix Programming > January 2006 > Signal question again. Last one for a while,









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Signal question again. Last one for a while,
Chad

2006-01-19, 9:58 pm

I think I know where the confusion is coming from.

In the book "Advanced Programming in the Unix Environment", 2nd
edition, at the end of page 313:

"The only time pause returns is if a signal handler is executed and
that handler returns. In that case, pause returns -1 with errno set to
EINTR."

Is the signal handler and handler the same thing? Also, does the
handler return when it encounters something like SIG_ERR? The reason I
ask this is because both figure 10.2 *on page 300 and figure 10.7 n
page 314 seem to suggest this.

Thanks in advance
Chad

Fletcher Glenn

2006-01-20, 7:09 pm

Chad wrote:
> I think I know where the confusion is coming from.
>
> In the book "Advanced Programming in the Unix Environment", 2nd
> edition, at the end of page 313:
>
> "The only time pause returns is if a signal handler is executed and
> that handler returns. In that case, pause returns -1 with errno set to
> EINTR."
>
> Is the signal handler and handler the same thing? Also, does the
> handler return when it encounters something like SIG_ERR? The reason I
> ask this is because both figure 10.2 *on page 300 and figure 10.7 n
> page 314 seem to suggest this.
>
> Thanks in advance
> Chad
>


Your supposition is correct. EINTR is reserved for system calls
that have been interrupted by a signal. You may want to look into
system calls that will wait for specific signals too. There is
sigpause and sigwait. Try looking at the man pages for these
functions.

--

Fletcher Glenn

Chad

2006-01-21, 3:56 am


Fletcher Glenn wrote:
> Chad wrote:
>
> Your supposition is correct. EINTR is reserved for system calls
> that have been interrupted by a signal. You may want to look into
> system calls that will wait for specific signals too. There is
> sigpause and sigwait. Try looking at the man pages for these
> functions.
>
> --
>
> Fletcher Glenn


Okay, thanks for the clarification.

Chad

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2010 codecomments.com