Skip site navigation (1)Skip section navigation (2)


| raw e-mail | index | archive | help
RETURN VALUES
     Upon successful completion, rfork() returns a value of 0 to the child
     process and returns the process ID of the child process to the parent
     process.  Otherwise, a value of -1 is returned to the parent process, =
no
     child process is created, and the global variable errno is set to
     indicate the error.



I don't understand this wording:

> RFTHREAD     If set, the new process shares file descriptor to process le=
aders table with its parent=20

Since `man -K 'process leader'` gives no result, I've read the FreeBSD sour=
ce
code and wrote about p_leader myself:
https://www.1a-insec.net/frag/35-freebsd-fd-race/. I hope I understand this
correctly.

For some reason, there are both `proc->p_fdtol->fdl_leader` and
`proc->p_leader`.


In sys/kern/kern_descrip.c, I see:

                        error =3D VOP_ADVLOCK(vp, (caddr_t)p->p_leader, F_S=
ETLK,
                            flp, flg);

                                (void) VOP_ADVLOCK(vp,
                                    (caddr_t)fdtol->fdl_leader, F_UNLCK, &l=
f,
                                    F_POSIX);

What is happening here?

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?>