Lines Matching refs:trap
2 /* $OpenBSD: trap.c,v 1.23 2010/05/19 17:36:08 jasper Exp $ */
39 Trap sigtraps[NSIG + 1];
1166 Trap *
1170 Trap *p;
1191 * trap signal handler
1196 Trap *p = &sigtraps[i];
1199 trap = p->set = 1;
1202 if ((p->flags & TF_FATAL) && !p->trap) {
1230 Trap *p;
1242 * occurred for which a trap has been set or for which the TF_DFL_INTR flag
1249 Trap *p;
1252 if (p->set && ((p->trap && p->trap[0]) ||
1253 ((p->flags & (TF_DFL_INTR|TF_FATAL)) && !p->trap)))
1266 Trap *p;
1274 * XXX: this means the alarm will have no effect if a trap
1279 trap = 0;
1287 ((p->flags & flag) && p->trap == NULL)))
1294 runtrap(Trap *p, bool is_last)
1303 trapstr = p->trap;
1326 p->trap = NULL;
1332 * no problem with afree(p->trap) in settrap() while still in use.
1340 p->trap = trapstr;
1345 /* we're the last trap of a sequence executed */
1352 /* clear pending traps and reset user's trap handlers; used after fork(2) */
1357 Trap *p;
1359 trap = 0;
1364 if ((p->flags & TF_USER_SET) && (p->trap && p->trap[0]))
1374 Trap *p;
1383 settrap(Trap *p, const char *s)
1387 if (p->trap)
1388 afree(p->trap, APERM);
1390 strdupx(p->trap, s, APERM);
1426 Trap *p = &sigtraps[SIGPIPE];
1453 setsig(Trap *p, sig_t f, int flags)
1509 setexecsig(Trap *p, int restore)