Computers/Linux System Programming

ch9. process relationship

emzei 2013. 5. 20. 10:36

[프로세스 그룹]

◆ getpgrp : 현재 프로세스의 프로세스 그룹 ID 값을 돌려줌

#include<unistd.h>

 pid_t getpgid(void);

(ret)  success :  호출한 프로세스의 프로세스 그룹 ID

   

 

◆ getpgid : 프로세스 id를 인자로 받아 그 플세스가 속해이는 프로세스의 그룹 id를 돌려줌

#include<unistd.h>

 pid_t getpgid(pid_t pid);

(ret)  success : 성공시 프로세스 그룹 id

   failed : -1

 

◆ setpgid : 프로세스가 자신의 기존의 프로세스 그룹에 속하게 하거나 새 프로세스 그룹을 생성

#include<unistd.h>

 int setpgid(pid_t pid);

(ret)  success : 0

   failed : -1

 

[세션]

◆ setsid : 한 프로세스가 새로운 세션을 만들 때

#include<unistd.h>

 pid_t setsid(void);

(ret)  success : 프로세스 그룹 id

   failed : -1

 

◆ setsid : 세션리더의 프로세스 그룹 id 얻을 때

#include<unistd.h>

 pid_t getsid(pid_t pid);

(ret)  success : 세션리더의 프로세스 그룹 pid

   failed : -1

 

[terminal controller] 

◆ tcgetpgrp : 전경 프로세스 그룹의 프로세스 그룹 id 얻을 때

#include<unistd.h>

 pid_t tcgetpgrp(int filedes);

(ret)  success : 전경 프로세스 그룹의 프로세스 그룹 id

   failed : -1

 

◆ tcsetgrp : 전경 프로세스 그룹의 프로세스 그룹 id를 설정할 때

#include<unistd.h>

 int tcsetgrp(int filedes, pid_t pgrpid);

(ret)  success : 0

   failed : -1

 

◆ tcgetsid : 제어 터미널과 연관된 세션 리더의 프로세스 그룹 id를 얻을 때

#include<termios.h>

 pid_t tcgetsid(int filedes);

(ret)  success : 세션 리더의 프로세스 그룹 id

   failed : -1

 

 


'Computers > Linux System Programming' 카테고리의 다른 글

ch10. signal  (0) 2013.05.20
+ ch9. ( addition) process relationship  (0) 2013.05.20
ch8. process control  (0) 2013.04.28
ch7. process environment  (0) 2013.04.28
ch6. system data file and system information  (0) 2013.04.28