| 292 | } |
| 293 | |
| 294 | int |
| 295 | pre_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 | |
| 315 | void |
| 316 | post_execve(struct thread *td, int error, struct vmspace *oldvmspace) |
no test coverage detected