#include <mach/task.h> /* for task_resume() */
#include <kern/sched_prim.h> /* for thread_exception_return() */
#include <mach/task.h> /* for task_resume() */
#include <kern/sched_prim.h> /* for thread_exception_return() */
KERNEL_DEBUG_CONSTANT(BSDDBG_CODE(DBG_BSD_PROC, BSD_PROC_FRCEXIT) | DBG_FUNC_NONE,
p->p_pid, W_EXITCODE(ENOTSUP, 0), 4, 0, 0);
exit1(p, W_EXITCODE(ENOTSUP, 0), retval);
KERNEL_DEBUG_CONSTANT(BSDDBG_CODE(DBG_BSD_PROC, BSD_PROC_FRCEXIT) | DBG_FUNC_NONE,
p->p_pid, W_EXITCODE(ENOTSUP, 0), 4, 0, 0);
exit1(p, W_EXITCODE(ENOTSUP, 0), retval);
- proc_reparentlocked(t, pp ? pp : initproc, 1, 0);
- if (pp != PROC_NULL)
+ if (pp != PROC_NULL) {
+ proc_reparentlocked(t, pp, 1, 0);
+ } else {
+ /* original parent exited while traced */
+ proc_list_lock();
+ t->p_listflag |= P_LIST_DEADPARENT;
+ proc_list_unlock();
+ proc_reparentlocked(t, initproc, 1, 0);
+ }
-#if defined(ppc)
-#define ALIGNED(addr,size) (((unsigned)(addr)&((size)-1))==0)
- if (!ALIGNED((int)uap->addr, sizeof(int)))
- return (ERESTART);
-#undef ALIGNED
-#endif
- thread_setentrypoint(th_act, uap->addr);
+ error = ENOTSUP;
+ goto out;