setsid

SETSID(2)                        System calls                        SETSID(2)



åå
       setsid - ã»ãã·ã§ã³(session)ãä½æããããã»ã¹ã»ã°ã«ã¼ãID ãè¨å®ãã

æ¸å¼
       #include <unistd.h>

       pid_t setsid(void);

説æ
       setsid() ã¯å¼ã³åºããããã»ã¹ãããã»ã¹ã»ã°ã«ã¼ãã»ãªã¼ãã¼ (process group
       leader)ã§ãªããã°æ°ããã»ãã·ã§ã³ãä½æããã å¼ã³åºãããã‐
       ã»ã¹ã¯æ°ããã»ãã·ã§ã³ã®ãªã¼ãã¼ãæ°ããããã»ã¹ã»ã°ã«ã¼ãã® ãã‐
       ã»ã¹ã»ã°ã«ã¼ãã»ãªã¼ãã¼ã¨ãªãã tty ã®å¶å¾¡ãæããªãã å¼ã³åºããããã»ã¹ã®ãã‐
       ã»ã¹ã»ã°ã«ã¼ãID 㨠ã»ãã·ã§ã³ID 㯠å¼ã³åºããããã»ã¹ã® PID ãè¨‐
       å®ããããå¼ã³åºããããã»ã¹ã¯ãã® æ°ãããã‐
       ã»ã¹ã»ã°ã«ã¼ãããã®æ°ããã»ãã·ã§ã³ã®å¯ä¸ã®ããã»ã¹ã¨ãªãã

è¿ãå¤
       å¼ã³åºããããã»ã¹ã®ã»ãã·ã§ã³ID

ã¨ã©ã¼
       ã¨ã©ã¼ã®å ´åã -1 ãè¿ããããèµ·ããããã¨ã©ã¼ã¯ EPERM ã®ã¿ã§ããã å¼ã³åºãããã‐
       ã»ã¹ã® PID ã¨çããããã»ã¹ã»ã°ã«ã¼ãID ãæã¤ããã»ã¹ã å‐
       å¨ããå ´åã«è¿ããããããã¯ãå¼ã³åºããããã»ã¹ãæ¢ã« ããã»ã¹ã»ãªã¼ãã¼ã®å ´åã«ã¯
       setsid ã¯å¤±æãããã¨ãæå³ããã

注æ
       ããã»ã¹ã»ã°ã«ã¼ãã»ãªã¼ãã¼ã¨ã¯ãã®ããã»ã¹ã®ããã»ã¹ã»ã°ã«ã¼ãID ã ãã® PID ã«ç‐
       ããããã»ã¹ã§ããã setsid ã確å®ã«æåãããããã«ã¯ã fork ã㦠exit ããåããã»ã¹ã§
       setsid() ãè¡ãªãã°è¯ãã


æºæ
       POSIX, SVr4.

é¢é£é ç®
       setpgid(2), setpgrp(2)



                                 Aug 27, 1994                        SETSID(2)