kern_fork.c (11bda9b8d508c791f275607d9277372cbb1fef36) | kern_fork.c (faef53711b12833053c3a430f78b4aa03684cf22) |
---|---|
1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 265 unchanged lines hidden (view full) --- 274 */ 275 } 276 277 /* Allocate new proc. */ 278 newproc = uma_zalloc(proc_zone, M_WAITOK); 279#ifdef MAC 280 mac_init_proc(newproc); 281#endif | 1/*- 2 * Copyright (c) 1982, 1986, 1989, 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * (c) UNIX System Laboratories, Inc. 5 * All or some portions of this file are derived from material licensed 6 * to the University of California by American Telephone and Telegraph 7 * Co. or Unix System Laboratories, Inc. and are reproduced herein with 8 * the permission of UNIX System Laboratories, Inc. --- 265 unchanged lines hidden (view full) --- 274 */ 275 } 276 277 /* Allocate new proc. */ 278 newproc = uma_zalloc(proc_zone, M_WAITOK); 279#ifdef MAC 280 mac_init_proc(newproc); 281#endif |
282#ifdef AUDIT 283 audit_proc_alloc(newproc); 284#endif | |
285 knlist_init(&newproc->p_klist, &newproc->p_mtx, NULL, NULL, NULL); 286 STAILQ_INIT(&newproc->p_ktr); 287 288 /* We have to lock the process tree while we look for a pid. */ 289 sx_slock(&proctree_lock); 290 291 /* 292 * Although process entries are dynamically created, we still keep --- 212 unchanged lines hidden (view full) --- 505 */ 506 p2->p_flag = 0; 507 if (p1->p_flag & P_PROFIL) 508 startprofclock(p2); 509 PROC_SLOCK(p2); 510 p2->p_sflag = PS_INMEM; 511 PROC_SUNLOCK(p2); 512 td2->td_ucred = crhold(p2->p_ucred); | 282 knlist_init(&newproc->p_klist, &newproc->p_mtx, NULL, NULL, NULL); 283 STAILQ_INIT(&newproc->p_ktr); 284 285 /* We have to lock the process tree while we look for a pid. */ 286 sx_slock(&proctree_lock); 287 288 /* 289 * Although process entries are dynamically created, we still keep --- 212 unchanged lines hidden (view full) --- 502 */ 503 p2->p_flag = 0; 504 if (p1->p_flag & P_PROFIL) 505 startprofclock(p2); 506 PROC_SLOCK(p2); 507 p2->p_sflag = PS_INMEM; 508 PROC_SUNLOCK(p2); 509 td2->td_ucred = crhold(p2->p_ucred); |
513#ifdef AUDIT 514 audit_proc_fork(p1, p2); 515#endif | |
516 pargs_hold(p2->p_args); 517 518 if (flags & RFSIGSHARE) { 519 p2->p_sigacts = sigacts_hold(p1->p_sigacts); 520 } else { 521 sigacts_copy(newsigacts, p1->p_sigacts); 522 p2->p_sigacts = newsigacts; 523 } --- 224 unchanged lines hidden (view full) --- 748 sx_sunlock(&proctree_lock); 749 if (ppsratecheck(&lastfail, &curfail, 1)) 750 printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n", 751 td->td_ucred->cr_ruid); 752 sx_xunlock(&allproc_lock); 753#ifdef MAC 754 mac_destroy_proc(newproc); 755#endif | 510 pargs_hold(p2->p_args); 511 512 if (flags & RFSIGSHARE) { 513 p2->p_sigacts = sigacts_hold(p1->p_sigacts); 514 } else { 515 sigacts_copy(newsigacts, p1->p_sigacts); 516 p2->p_sigacts = newsigacts; 517 } --- 224 unchanged lines hidden (view full) --- 742 sx_sunlock(&proctree_lock); 743 if (ppsratecheck(&lastfail, &curfail, 1)) 744 printf("maxproc limit exceeded by uid %i, please see tuning(7) and login.conf(5).\n", 745 td->td_ucred->cr_ruid); 746 sx_xunlock(&allproc_lock); 747#ifdef MAC 748 mac_destroy_proc(newproc); 749#endif |
756#ifdef AUDIT 757 audit_proc_free(newproc); 758#endif | |
759 uma_zfree(proc_zone, newproc); 760 if (p1->p_flag & P_HADTHREADS) { 761 PROC_LOCK(p1); 762 thread_single_end(); 763 PROC_UNLOCK(p1); 764 } 765 pause("fork", hz / 2); 766 return (error); --- 64 unchanged lines hidden --- | 750 uma_zfree(proc_zone, newproc); 751 if (p1->p_flag & P_HADTHREADS) { 752 PROC_LOCK(p1); 753 thread_single_end(); 754 PROC_UNLOCK(p1); 755 } 756 pause("fork", hz / 2); 757 return (error); --- 64 unchanged lines hidden --- |