Re: Porting vfork()

Linus Torvalds (torvalds@transmeta.com)
Fri, 8 Jan 1999 10:08:41 -0800 (PST)


On Thu, 7 Jan 1999, Perry Harrington wrote:
>
> For the time being I added another wait queue to struct task, and I do
> a sleep_on in the parent. When the child exits, in do_exit, just after
> notify_parent, it does a wake_up on current->p_pptr->vfork_sleep.

Careful. I think you need to use current->p_opptr->vfork_sleep.

The difference between "p_pptr" and "p_opptr" is that the first one is the
"current father", while the second one is the "original father". They only
differ if somebody attached to the process, but we want to avoid even that
remote possibility.

> Just to be clear, I'd need to do a SYS_190() to call it, right? If not,
> how do you make direct syscalls?

Just add the __NR_xxx #define to asm/unistd.h, and then do something like

#include "your-current-tree/linux/include/asm/unistd.h"

_syscall0(int, vfork)

and you'll have a vfork() (look at the header if the above doesn't work,
there may be some details).

Linus

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/