|
|
| version 1.21, 2004/03/30 19:14:11 | version 1.22, 2004/04/12 17:47:39 |
|---|---|
| Line 175 SYSCTL_PROC(_kern, OID_AUTO, randompid, | Line 175 SYSCTL_PROC(_kern, OID_AUTO, randompid, |
| 0, 0, sysctl_kern_randompid, "I", "Random PID modulus"); | 0, 0, sysctl_kern_randompid, "I", "Random PID modulus"); |
| int | int |
| fork1(p1, flags, procp) | fork1(struct proc *p1, int flags, struct proc **procp) |
| struct proc *p1; | |
| int flags; | |
| struct proc **procp; | |
| { | { |
| struct proc *p2, *pptr; | struct proc *p2, *pptr; |
| uid_t uid; | uid_t uid; |
| Line 270 fork1(p1, flags, procp) | Line 267 fork1(p1, flags, procp) |
| /* | /* |
| * Setup linkage for kernel based threading | * Setup linkage for kernel based threading |
| */ | */ |
| if((flags & RFTHREAD) != 0) { | if ((flags & RFTHREAD) != 0) { |
| newproc->p_peers = p1->p_peers; | newproc->p_peers = p1->p_peers; |
| p1->p_peers = newproc; | p1->p_peers = newproc; |
| newproc->p_leader = p1->p_leader; | newproc->p_leader = p1->p_leader; |
| Line 452 again: | Line 449 again: |
| * (If PL_SHAREMOD is clear, the structure is shared | * (If PL_SHAREMOD is clear, the structure is shared |
| * copy-on-write.) | * copy-on-write.) |
| */ | */ |
| if (p1->p_limit->p_lflags & PL_SHAREMOD) | if (p1->p_limit->p_lflags & PL_SHAREMOD) { |
| p2->p_limit = limcopy(p1->p_limit); | p2->p_limit = limcopy(p1->p_limit); |
| else { | } else { |
| p2->p_limit = p1->p_limit; | p2->p_limit = p1->p_limit; |
| p2->p_limit->p_refcnt++; | p2->p_limit->p_refcnt++; |
| } | } |
| Line 573 again: | Line 570 again: |
| * However first make sure that it's not already there. | * However first make sure that it's not already there. |
| * Returns 0 on success or a standard error number. | * Returns 0 on success or a standard error number. |
| */ | */ |
| int | int |
| at_fork(function) | at_fork(forklist_fn function) |
| forklist_fn function; | |
| { | { |
| struct forklist *ep; | struct forklist *ep; |
| #ifdef INVARIANTS | #ifdef INVARIANTS |
| /* let the programmer know if he's been stupid */ | /* let the programmer know if he's been stupid */ |
| if (rm_at_fork(function)) | if (rm_at_fork(function)) { |
| printf("WARNING: fork callout entry (%p) already present\n", | printf("WARNING: fork callout entry (%p) already present\n", |
| function); | function); |
| } | |
| #endif | #endif |
| ep = malloc(sizeof(*ep), M_ATFORK, M_NOWAIT); | ep = malloc(sizeof(*ep), M_ATFORK, M_NOWAIT); |
| if (ep == NULL) | if (ep == NULL) |
| Line 598 at_fork(function) | Line 594 at_fork(function) |
| * Scan the exit callout list for the given item and remove it.. | * Scan the exit callout list for the given item and remove it.. |
| * Returns the number of items removed (0 or 1) | * Returns the number of items removed (0 or 1) |
| */ | */ |
| int | int |
| rm_at_fork(function) | rm_at_fork(forklist_fn function) |
| forklist_fn function; | |
| { | { |
| struct forklist *ep; | struct forklist *ep; |
| Line 619 rm_at_fork(function) | Line 613 rm_at_fork(function) |
| * Add a forked process to the run queue after any remaining setup, such | * Add a forked process to the run queue after any remaining setup, such |
| * as setting the fork handler, has been completed. | * as setting the fork handler, has been completed. |
| */ | */ |
| void | void |
| start_forked_proc(struct proc *p1, struct proc *p2) | start_forked_proc(struct proc *p1, struct proc *p2) |
| { | { |