SIGNAL 관련 sigstack()함수의 사용.
글쓴이: omando / 작성시간: 일, 2003/07/27 - 9:39오후
코드 분석중에 signal 처리 부분에서 sigstack()이란 함수를 사용하여
구현한 부분이 있더군요.
이곳 저곳 자료를 찾아 보았지만 얻지못하고 man page를 보았지만
쉽게 이해가 되지 않는군요.
대충 나름대로 해석하자면, signal 이 발생하여 signal handler를 수행시
일단은 stack에 집어넣고 수행하라는것 같고,
사용하는 이유는 signal handler를 수행중 동일 signal이 발생한다면
stack을 뒤져 중복 실행을 막고자 하는건지???
아무튼 이걸 사용하는 이유에 대해 정확히 이해가 안되는군요.(워낙 초보라)
When a signal occurs and its handler is to run on the signal stack, the
system checks to see if the process is already running on that stack. If
so, the process continues to run on that stack even after the handler
returns. If not, the signal handler runs on the signal stack, and the
original stack is restored when the handler returns.
이부분이 핵심인것 같은데..
여러분의 넓은 아량으로 저좀 도와주세요.
Forums:
스택의 개념인것 같군요...
DESCRIPTION
Sigstack allows users to define an alternate stack on which signals are
to be processed. If ss is non-zero, it specifies a signal stack on which
to deliver signals and tells the system if the process is currently
executing on that stack. When a signal's action indicates its handler
should execute on the signal stack (specified with a sigvec(3b) call),
the system checks to see if the process is currently executing on that
stack. If the process is not currently executing on the signal stack,
the system arranges a switch to the signal stack for the duration of the
signal handler's execution. If oss is non-zero, the current signal stack
state is returned.
http://www.mcsr.olemiss.edu/cgi-bin/man-cgi?sigstack+2
http://www.opengroup.org/onlinepubs/007908799/xsh/sigstack.html
댓글 달기