Skip to content

Instantly share code, notes, and snippets.

@indutny

indutny/1.c Secret

Created August 22, 2012 17:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save indutny/2b7d513c2d406228acee to your computer and use it in GitHub Desktop.
Save indutny/2b7d513c2d406228acee to your computer and use it in GitHub Desktop.
/*
* If we're being traced (possibly because someone attached us
* while we were stopped), check for a signal from the debugger.
*/
if (sig_proc->p_stat == SSTOP) {
if ((sig_proc->p_lflag & P_LTRACED) != 0 && sig_proc->p_xstat != 0)
uth->uu_siglist |= sigmask(sig_proc->p_xstat);
if ((flavor & PSIG_VFORK) != 0) {
sig_proc->p_stat = SRUN;
}
proc_unlock(sig_proc);
} else {
/*
* setrunnable(p) in BSD and
* Wake up the thread if it is interruptible.
*/
sig_proc->p_stat = SRUN;
proc_unlock(sig_proc);
if ((flavor & PSIG_VFORK) == 0)
thread_abort_safely(sig_thread);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment