#include "defs.h"
#include "native_defs.h"
#include "nsig.h"
+#include "number_set.h"
#include <sys/param.h>
/* for struct iovec */
tcp->currpers = personality;
# undef PERSONALITY_NAMES
-# if defined POWERPC64
-# define PERSONALITY_NAMES {"64 bit", "32 bit"}
-# elif defined X86_64
+# if defined X86_64
# define PERSONALITY_NAMES {"64 bit", "32 bit", "x32"}
# elif defined X32
# define PERSONALITY_NAMES {"x32", "32 bit"}
-# elif defined AARCH64
+# elif SUPPORTED_PERSONALITIES == 2
# define PERSONALITY_NAMES {"64 bit", "32 bit"}
-# elif defined TILE
-# define PERSONALITY_NAMES {"64-bit", "32-bit"}
# endif
# ifdef PERSONALITY_NAMES
if (!qflag) {
if (fd < 0)
return;
- if (is_number_in_set(fd, &read_set)) {
+ if (is_number_in_set(fd, read_set)) {
switch (tcp->s_ent->sen) {
case SEN_read:
case SEN_pread:
return;
}
}
- if (is_number_in_set(fd, &write_set)) {
+ if (is_number_in_set(fd, write_set)) {
switch (tcp->s_ent->sen) {
case SEN_write:
case SEN_pwrite:
opts->first = opts->step;
- if (opts->signo > 0)
- *signo = opts->signo;
- if (opts->rval != INJECT_OPTS_RVAL_DEFAULT && !arch_set_scno(tcp, -1))
+ if (opts->data.flags & INJECT_F_SIGNAL)
+ *signo = opts->data.signo;
+ if (opts->data.flags & INJECT_F_RETVAL && !arch_set_scno(tcp, -1))
tcp->flags |= TCB_TAMPERED;
return 0;
if (!opts)
return 0;
- if (opts->rval >= 0) {
+ if (opts->data.rval >= 0) {
kernel_long_t u_rval = tcp->u_rval;
- tcp->u_rval = opts->rval;
+ tcp->u_rval = opts->data.rval;
if (arch_set_success(tcp)) {
tcp->u_rval = u_rval;
} else {
tcp->u_error = 0;
}
} else {
- unsigned long new_error = -opts->rval;
+ unsigned long new_error = -opts->data.rval;
if (new_error != tcp->u_error && new_error <= MAX_ERRNO_VALUE) {
unsigned long u_error = tcp->u_error;
break;
}
- if (!(tcp->qual_flg & QUAL_TRACE)
- || (tracing_paths && !pathtrace_match(tcp))
- ) {
+ if (!traced(tcp) || (tracing_paths && !pathtrace_match(tcp))) {
tcp->flags |= TCB_FILTERED;
return 0;
}
return 0;
}
- if (tcp->qual_flg & QUAL_INJECT)
+ if (inject(tcp))
tamper_with_syscall_entering(tcp, sig);
if (cflag == CFLAG_ONLY_STATS) {
printleader(tcp);
tprintf("%s(", tcp->s_ent->sys_name);
- int res = (tcp->qual_flg & QUAL_RAW)
- ? printargs(tcp) : tcp->s_ent->sys_func(tcp);
+ int res = raw(tcp) ? printargs(tcp) : tcp->s_ent->sys_func(tcp);
fflush(tcp->outf);
return res;
}
tcp->s_prev_ent = tcp->s_ent;
int sys_res = 0;
- if (tcp->qual_flg & QUAL_RAW) {
+ if (raw(tcp)) {
/* sys_res = printargs(tcp); - but it's nop on sysexit */
} else {
/* FIXME: not_failing_only (IOW, option -z) is broken:
tabto();
unsigned long u_error = tcp->u_error;
- if (tcp->qual_flg & QUAL_RAW) {
+ if (raw(tcp)) {
if (u_error) {
tprintf("= -1 (errno %lu)", u_error);
} else {