MCPcopy Create free account
hub / github.com/F-Stack/f-stack / pre_execve

Function pre_execve

freebsd/kern/kern_exec.c:294–313  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294int
295pre_execve(struct thread *td, struct vmspace **oldvmspace)
296{
297 struct proc *p;
298 int error;
299
300 KASSERT(td == curthread, ("non-current thread %p", td));
301 error = 0;
302 p = td->td_proc;
303 if ((p->p_flag & P_HADTHREADS) != 0) {
304 PROC_LOCK(p);
305 if (thread_single(p, SINGLE_BOUNDARY) != 0)
306 error = ERESTART;
307 PROC_UNLOCK(p);
308 }
309 KASSERT(error != 0 || (td->td_pflags & TDP_EXECVMSPC) == 0,
310 ("nested execve"));
311 *oldvmspace = p->p_vmspace;
312 return (error);
313}
314
315void
316post_execve(struct thread *td, int error, struct vmspace *oldvmspace)

Callers 3

sys_execveFunction · 0.85
sys_fexecveFunction · 0.85
sys___mac_execveFunction · 0.85

Calls 1

thread_singleFunction · 0.85

Tested by

no test coverage detected