某組織

近々fork(2)するわけだが、僕がどうなるのか全く情報がない。0が返るのか子プロセスのPIDが返るのか(はたまた-1が返るのか)全く分からない。どうなることやら。

man 2 forkより

RETURN VALUES
    Upon successful completion, fork() returns a value of 0 to the child pro-
    cess and returns the process ID of the child process to the parent pro-
    cess.  Otherwise, a value of -1 is returned to the parent process, no
    child process is created, and the global variable errno is set to indi-
    cate the error.