A라는 프로세스가 리눅스 상에서 돌아갑니다.
이때.. B 라는 프로세스를 이용하여.. A프로세스를 죽이거나 작동을 멈추게 하고 싶습니다.
어케 하면 될까여??
원도에선 쓰레드라는걸 쓰는거 같은데... 리눅스에선 어떤걸 해야 할지 모르겠습니다.
답변 부탁드립니다.
man 2 kill
집에나 갈까?
sigaction()함수로 구현가능합니다.
남으로 창을 내겠소. 밭이 한참갈이 괭이로 파고 호미론 김을 메지요. 구름이 꼬인다 갈리있소. 새들의 노래는 공으로 들으랴오. 강냉이가 익거든 와자셔도 좋소. 왜 사냐건 웃지요.
shell에서 테스트해보면 다음과 같습니다.
가정 ) 현재 수행중인 프로세스의 pid = 9999 $ kill -STOP 9999 <===== 일시 정지 $ kill -CONT 9999 <===== 다시 계속 수행
리눅스의 경우 /usr/include/bits/signum.h 파일을 보면,
#define SIGCONT 18 #define SIGSTOP 19
테스트가 끝났으면, signal()함수를 이용해서 구현하면 되겠지요?
물론, 죽이려면, 죽이는 시그널(9번)을 보내면되고요.
텍스트 포맷에 대한 자세한 정보
<code>
<blockcode>
<apache>
<applescript>
<autoconf>
<awk>
<bash>
<c>
<cpp>
<css>
<diff>
<drupal5>
<drupal6>
<gdb>
<html>
<html5>
<java>
<javascript>
<ldif>
<lua>
<make>
<mysql>
<perl>
<perl6>
<php>
<pgsql>
<proftpd>
<python>
<reg>
<spec>
<ruby>
<foo>
[foo]
man 2 kill
man 2 kill
집에나 갈까?
sigaction()함수로 구현가능합니다.
sigaction()함수로 구현가능합니다.
남으로 창을 내겠소.
밭이 한참갈이 괭이로 파고 호미론 김을 메지요.
구름이 꼬인다 갈리있소. 새들의 노래는 공으로 들으랴오.
강냉이가 익거든 와자셔도 좋소.
왜 사냐건 웃지요.
shell에서 테스트해보면 다음과 같습니다.[code:1]가정 &
shell에서 테스트해보면 다음과 같습니다.
리눅스의 경우
/usr/include/bits/signum.h 파일을 보면,
이렇게 정의되어 있습니다.
테스트가 끝났으면, signal()함수를 이용해서 구현하면 되겠지요?
물론, 죽이려면, 죽이는 시그널(9번)을 보내면되고요.
물론, 죽이려면, 죽이는 시그널(9번)을 보내면되고요.
댓글 달기