trap
if (p->trap == NULL)
print_value_quoted(p->trap);
if (p->trap == NULL && p->name)
if (trap) {
if (trap)
if (trap)
if (trap)
&& sigtraps[SIGEXIT_].trap))
char *trap; /* trap command */
EXTERN int volatile trap; /* traps pending? */
trap = p->set = 1;
if ((p->flags & TF_FATAL) && !p->trap) {
if (p->set && ((p->trap && p->trap[0])
&& !p->trap)))
trap = 0;
|| ((p->flags & flag) && p->trap == (char *) 0)))
char *trapstr = p->trap;
p->trap = (char *) 0;
p->trap = trapstr;
trap = 0;
if ((p->flags & TF_USER_SET) && (p->trap && p->trap[0]))
if (p->trap)
afree(p->trap, APERM);
p->trap = str_save(s, APERM);
p->trap = NULL;
if (trap[signo] == NULL)
ckfree(trap[signo]);
trap[signo] = NULL;
if (trap[signo] == NULL) {
if (trap[signo] != NULL && trap[signo][0] == '\0') {
if (trap[signo] != NULL && trap[signo][0] != '\0') {
print_quoted(trap[signo]);
if (trap[signo] != NULL)
out1fmt("%s\n", trap[signo]);
if (trap[signo] == NULL)
print_quoted(trap[signo]);
trap[signo] ? "'" : "", trap[signo] ? trap[signo] : "-",
trap[signo] ? "'" : "", action ? "'" : "",
if (trap[signo])
ckfree(trap[signo]);
trap[signo] = action;
for (tp = &trap[1] ; tp < &trap[NSIG] ; tp++) {
setsignal(tp - trap, vforked == 1);
for (tp = trap ; tp < &trap[NSIG] ; tp++)
for (tp = trap ; tp < &trap[NSIG] ; tp++)
if (traps_invalid || (t = trap[signo]) == NULL)
p = trap[SIGCHLD];
if (!vforking && signo == SIGINT && (invalid || trap[SIGINT] == NULL)) {
if (!invalid && trap[signo] != NULL && trap[signo][0] != '\0') {
tr = trap[i];
if (!traps_invalid && (p = trap[0]) != NULL && *p != '\0') {
trap[0] = NULL;
static char * volatile trap[NSIG]; /* trap handler commands */
struct trap *ntrap;
extern struct trap *ftrap;
#define newtrap() ((struct trap *) alloc(sizeof(struct trap)))
void deltrap(struct trap *);
struct trap *t_at(int, int);
struct trap *maketrap(int, int, int);
void dotrap(struct trap *);
struct trap *ftrap = 0;
struct trap *ttmp = t_at(dpx, dpy);
struct trap *ttmp = t_at(u.ux, u.uy);
struct trap *ttmp;
struct trap *trap = NULL;
if (!u.uswallow && (trap = t_at(u.ux + u.dx, u.uy + u.dy)) && trap->tseen)
struct trap *ttmp;
if (trap)
dotrap(trap); /* fall into pit, arrow trap, etc. */
struct trap *trap;
if ((info[i] & ALLOW_TRAPS) && (trap = t_at(nx, ny))) {
if (!trap->tseen && rn2(40))
deltrap(struct trap *trap)
struct trap *ttmp;
if (trap == ftrap)
for (ttmp = ftrap; ttmp->ntrap != trap; ttmp = ttmp->ntrap);
ttmp->ntrap = trap->ntrap;
free(trap);
struct trap *
struct trap *trap = ftrap;
while (trap) {
if (trap->tx == x && trap->ty == y)
return (trap);
trap = trap->ntrap;
savetrapchn(int fd, struct trap *trap)
struct trap *trap2;
while (trap) {
trap2 = trap->ntrap;
bwrite(fd, trap, sizeof(struct trap));
free(trap);
trap = trap2;
bwrite(fd, nul, sizeof(struct trap));
struct trap *trap;
trap = newtrap();
mread(fd, trap, sizeof(struct trap));
while (trap->tx) {
trap->ntrap = ftrap;
ftrap = trap;
trap = newtrap();
mread(fd, trap, sizeof(struct trap));
free(trap);
static void savetrapchn(int, struct trap *);
struct trap *ttmp;
struct trap *ttmp;
struct trap *ttmp = t_at(nx, ny);
struct trap *ttmp;
struct trap *ttmp;
struct trap *trap;
for (trap = ftrap; trap; trap = trap->ntrap)
if (trap->tx == x && trap->ty == y &&
!trap->tseen && !rn2(8)) {
pline("You find a%s.", traps[trap->ttyp]);
if (trap->ttyp == PIERC) {
deltrap(trap);
trap->tseen = 1;
struct trap *trap;
for (trap = ftrap; trap; trap = trap->ntrap)
if (trap->tx == x && trap->ty == y && trap->tseen) {
if ((u.dz < 0) != (!xdnstair && trap->ttyp == TRAPDOOR))
pline("That is a%s.", traps[trap->ttyp]);
struct trap *ttmp;
dotrap(struct trap *trap)
int ttype = trap->ttyp;
if (trap->tseen && !rn2(5) && ttype != PIT)
trap->tseen = 1;
deltrap(trap);
if (trap->once) {
deltrap(trap);
impossible("You hit a trap of type %u", trap->ttyp);
struct trap *trap = t_at(mtmp->mx, mtmp->my);
if (!trap) {
int tt = trap->ttyp;
struct trap *trap;
if ((trap = t_at(u.ux, u.uy)) != NULL)
switch (trap->ttyp) {
dotrap(trap);
struct trap *
struct trap *ttmp;
extern trap traps[];
r_write(fp, traps, (MAX_TRAPS * sizeof(trap)));
r_read(fp, traps, (MAX_TRAPS * sizeof(trap)));
trap traps[MAX_TRAPS];
#define SYSTRAP(x) movl IMMEDIATE SYS_ ## x ## ,%d0; trap IMMEDIATE 0
#define SYSTRAP(x) movl #SYS_/**/x,%d0; trap #0
struct lwp *l, int signo, int code, void *addr, int trap)
ksi.ksi_trap = trap;
#define do_trapsignal(l, signo, code, addr, trap) \
do_trapsignal1(__func__, __LINE__, tf, l, signo, code, addr, trap)
#define do_trapsignal(l, signo, code, addr, trap) \
do_trapsignal1(l, signo, code, addr, trap)
struct lwp *l, int signo, int code, void *addr, int trap);
void trap(unsigned long, unsigned long, unsigned long, unsigned long,
void trap(struct trapframe *);
void trap(struct smallframe *);
int trap(struct trapframe *);
void trap(int, struct trapframe *);
void trap(struct trapframe *);
trap(&tf);
void trap(int, struct trapframe *);
void trap(int, unsigned int, unsigned int, struct frame);
TRACE_VEC equ $2024 trace trap
if (strcmp(___STRING(_C_LABEL(trap)), name) == 0) {
void trap(struct frame *, int, u_int, u_int);
void trap(uint32_t, uint32_t, vaddr_t, vaddr_t, struct trapframe *);
Name(trap),
void trap(uint32_t, uint32_t, vaddr_t, vaddr_t, struct trapframe *);
int trap(struct trapframe *);
vm_signal(int error, int trap, vaddr_t addr, ksiginfo_t *ksi)
ksi->ksi_trap = trap;
void trap(enum ppc_booke_exceptions, struct trapframe *);
void trap(struct trapframe *); /* Called from locore / trap_subr */
const uint32_t trap = 0x7d821008; /* twge %r2, %r2 */
if ((rv = ppc_istore(l, va[i], trap)) != 0) {
if (insn != trap) {
void trap(struct trapframe *); /* Called from locore / trap_subr */
extern uint8_t trap[], trap_end[];
memcpy(exc, trap, trap_end - trap);
*ip = 0x48000002 | (uint32_t)trap;
void (*trap)(int, int, int);
ci->msg.u.xpmsg_func.trap,
xcall(xcall_func_t func, xcall_trap_t trap, int arg0, int arg1, int arg2,
fasttrap = trap != NULL ? 1 : 0;
p->trap = trap;
cpu_number(), fasttrap ? trap : func,
void trap(unsigned, int, int, struct trapframe *);
void trap(struct trapframe64 *, unsigned int, vaddr_t, long);
void trap (struct trapframe *);
trap IMM 15