[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

fork1 man page



Hi,

The arguments of fork1 (kern_fork.c) differ from those described in the
manual page (fork1.9).

kern_fork.c:
int
fork1(struct proc *p1, int exitsig, int flags, void *stack, size_t
      stacksize, void (*func)(void *), void *arg, register_t *retval)

fork1.9:

int
fork1(struct proc *p1, int flags, void *stack, size_t stacksize,
      register_t *retval);


This patch should fix the manual page, but I suggest that someone who
has a deeper understanding of cpu_fork() should have a look at it and
fill it with more informations.

Sven

PS: I hope the list management software accepts attachments...

--
You are not expected to understand this.
        - Dennis Ritchie (Unix 6th Edition)
--- /usr/src/share/man/man9/fork1.9	Fri Jun  6 22:56:32 2003
+++ /home/svedeh/kernel-hacking/fork1.9	Thu Mar 11 17:00:52 2004
@@ -46,7 +46,7 @@
 .Fd #include <sys/types.h>
 .Fd #include <sys/proc.h>
 .Ft int
-.Fn "fork1" "struct proc *p1" "int flags" "void *stack" "size_t stacksize" "register_t *retval"
+.Fn "fork1" "struct proc *p1" "int exitsig" "int flags" "void *stack" "size_t stacksize" "void (*func)(void *)" "void *arg" "register_t *retval"
 .Sh DESCRIPTION
 .Fn fork1
 creates a new process out of
@@ -128,6 +128,17 @@
 In the parent process, this will contain the value 0.
 In the child process, this will contain 1.
 .El
+.Pp
+The signal
+.Fa exitsig
+is send to the parent 
+.Fa p1 
+on exit of the new process.
+.Pp
+.Fa func
+and 
+.Fa arg 
+are passed to uvm_fork(9) and from there to the machine dependent cpu_fork().
 .Sh RETURN VALUES
 Upon successful completion of the fork operation,
 .Fn fork1
@@ -149,7 +160,8 @@
 .Xr vfork 2 ,
 .Xr kthread_create 9 ,
 .Xr pfind 9 ,
-.Xr psignal 9
+.Xr psignal 9 ,
+.Xr uvm_fork 9
 .Sh CAVEATS
 The
 .Nm