* signal.c: Whitespace, comment, and style fixes, no code changes.
* file.c: Ditto. * time.c: Ditto. * process.c: Ditto. * resource.c: Ditto.
This commit is contained in:
parent
132c52a5cc
commit
1d632468c0
@ -1,3 +1,11 @@
|
||||
2009-04-14 Denys Vlasenko <dvlasenk@redhat.com>
|
||||
|
||||
* signal.c: Whitespace, comment, and style fixes, no code changes.
|
||||
* file.c: Ditto.
|
||||
* time.c: Ditto.
|
||||
* process.c: Ditto.
|
||||
* resource.c: Ditto.
|
||||
|
||||
2009-03-23 Denys Vlasenko <dvlasenk@redhat.com>
|
||||
|
||||
* system.c (sram_alloc_flag): Add L2_SRAM constant.
|
||||
|
261
process.c
261
process.c
@ -1226,8 +1226,7 @@ struct tcb *tcp;
|
||||
}
|
||||
|
||||
int
|
||||
sys_getresuid(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getresuid(struct tcb *tcp)
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
__kernel_uid_t uid;
|
||||
@ -3489,85 +3488,79 @@ static const struct xlat futexwakecmps[] = {
|
||||
};
|
||||
|
||||
int
|
||||
sys_futex(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_futex(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
long int cmd = tcp->u_arg[1] & 127;
|
||||
tprintf("%p, ", (void *) tcp->u_arg[0]);
|
||||
printxval(futexops, tcp->u_arg[1], "FUTEX_???");
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
if (cmd == FUTEX_WAKE_BITSET)
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
else if (cmd == FUTEX_WAIT) {
|
||||
tprintf(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
} else if (cmd == FUTEX_WAIT_BITSET) {
|
||||
tprintf(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
} else if (cmd == FUTEX_REQUEUE)
|
||||
tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]);
|
||||
else if (cmd == FUTEX_CMP_REQUEUE)
|
||||
tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]);
|
||||
else if (cmd == FUTEX_WAKE_OP) {
|
||||
tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
|
||||
if ((tcp->u_arg[5] >> 28) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
|
||||
tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
|
||||
if ((tcp->u_arg[5] >> 24) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
|
||||
tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
|
||||
if (entering(tcp)) {
|
||||
long int cmd = tcp->u_arg[1] & 127;
|
||||
tprintf("%p, ", (void *) tcp->u_arg[0]);
|
||||
printxval(futexops, tcp->u_arg[1], "FUTEX_???");
|
||||
tprintf(", %ld", tcp->u_arg[2]);
|
||||
if (cmd == FUTEX_WAKE_BITSET)
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
else if (cmd == FUTEX_WAIT) {
|
||||
tprintf(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
} else if (cmd == FUTEX_WAIT_BITSET) {
|
||||
tprintf(", ");
|
||||
printtv(tcp, tcp->u_arg[3]);
|
||||
tprintf(", %lx", tcp->u_arg[5]);
|
||||
} else if (cmd == FUTEX_REQUEUE)
|
||||
tprintf(", %ld, %p", tcp->u_arg[3], (void *) tcp->u_arg[4]);
|
||||
else if (cmd == FUTEX_CMP_REQUEUE)
|
||||
tprintf(", %ld, %p, %ld", tcp->u_arg[3], (void *) tcp->u_arg[4], tcp->u_arg[5]);
|
||||
else if (cmd == FUTEX_WAKE_OP) {
|
||||
tprintf(", %ld, %p, {", tcp->u_arg[3], (void *) tcp->u_arg[4]);
|
||||
if ((tcp->u_arg[5] >> 28) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakeops, (tcp->u_arg[5] >> 28) & 0x7, "FUTEX_OP_???");
|
||||
tprintf(", %ld, ", (tcp->u_arg[5] >> 12) & 0xfff);
|
||||
if ((tcp->u_arg[5] >> 24) & 8)
|
||||
tprintf("FUTEX_OP_OPARG_SHIFT|");
|
||||
printxval(futexwakecmps, (tcp->u_arg[5] >> 24) & 0x7, "FUTEX_OP_CMP_???");
|
||||
tprintf(", %ld}", tcp->u_arg[5] & 0xfff);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
print_affinitylist(tcp, list, len)
|
||||
struct tcb *tcp;
|
||||
long list;
|
||||
unsigned int len;
|
||||
print_affinitylist(struct tcb *tcp, long list, unsigned int len)
|
||||
{
|
||||
int first = 1;
|
||||
tprintf(" {");
|
||||
while (len >= sizeof (unsigned long)) {
|
||||
unsigned long w;
|
||||
umove(tcp, list, &w);
|
||||
tprintf("%s %lx", first ? "" : ",", w);
|
||||
first = 0;
|
||||
len -= sizeof (unsigned long);
|
||||
list += sizeof(unsigned long);
|
||||
}
|
||||
tprintf(" }");
|
||||
int first = 1;
|
||||
tprintf(" {");
|
||||
while (len >= sizeof (unsigned long)) {
|
||||
unsigned long w;
|
||||
umove(tcp, list, &w);
|
||||
tprintf("%s %lx", first ? "" : ",", w);
|
||||
first = 0;
|
||||
len -= sizeof (unsigned long);
|
||||
list += sizeof(unsigned long);
|
||||
}
|
||||
tprintf(" }");
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_setaffinity(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_setaffinity(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
print_affinitylist(tcp, tcp->u_arg[2], tcp->u_arg[1]);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_getaffinity(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_getaffinity(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
} else {
|
||||
if (tcp->u_rval == -1)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
tprintf("%ld, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
} else {
|
||||
if (tcp->u_rval == -1)
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
print_affinitylist(tcp, tcp->u_arg[2], tcp->u_rval);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct xlat schedulers[] = {
|
||||
@ -3578,73 +3571,68 @@ static const struct xlat schedulers[] = {
|
||||
};
|
||||
|
||||
int
|
||||
sys_sched_getscheduler(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_getscheduler(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d", (int) tcp->u_arg[0]);
|
||||
} else if (! syserror(tcp)) {
|
||||
tcp->auxstr = xlookup (schedulers, tcp->u_rval);
|
||||
if (tcp->auxstr != NULL)
|
||||
return RVAL_STR;
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d", (int) tcp->u_arg[0]);
|
||||
} else if (! syserror(tcp)) {
|
||||
tcp->auxstr = xlookup (schedulers, tcp->u_rval);
|
||||
if (tcp->auxstr != NULL)
|
||||
return RVAL_STR;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_setscheduler(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_setscheduler(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
struct sched_param p;
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
printxval(schedulers, tcp->u_arg[1], "SCHED_???");
|
||||
if (umove(tcp, tcp->u_arg[2], &p) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[2]);
|
||||
else
|
||||
tprintf(", { %d }", p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
struct sched_param p;
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
printxval(schedulers, tcp->u_arg[1], "SCHED_???");
|
||||
if (umove(tcp, tcp->u_arg[2], &p) < 0)
|
||||
tprintf(", %#lx", tcp->u_arg[2]);
|
||||
else
|
||||
tprintf(", { %d }", p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_getparam(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_getparam(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
} else {
|
||||
struct sched_param p;
|
||||
if (umove(tcp, tcp->u_arg[1], &p) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else
|
||||
tprintf("{ %d }", p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
tprintf("%d, ", (int) tcp->u_arg[0]);
|
||||
} else {
|
||||
struct sched_param p;
|
||||
if (umove(tcp, tcp->u_arg[1], &p) < 0)
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else
|
||||
tprintf("{ %d }", p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_setparam(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_setparam(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
struct sched_param p;
|
||||
if (umove(tcp, tcp->u_arg[1], &p) < 0)
|
||||
tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
|
||||
else
|
||||
tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
struct sched_param p;
|
||||
if (umove(tcp, tcp->u_arg[1], &p) < 0)
|
||||
tprintf("%d, %#lx", (int) tcp->u_arg[0], tcp->u_arg[1]);
|
||||
else
|
||||
tprintf("%d, { %d }", (int) tcp->u_arg[0], p.__sched_priority);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_sched_get_priority_min(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sched_get_priority_min(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(schedulers, tcp->u_arg[0], "SCHED_???");
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
printxval(schedulers, tcp->u_arg[0], "SCHED_???");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
# ifdef X86_64
|
||||
@ -3659,32 +3647,33 @@ static const struct xlat archvals[] = {
|
||||
};
|
||||
|
||||
int
|
||||
sys_arch_prctl(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_arch_prctl(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(archvals, tcp->u_arg[0], "ARCH_???");
|
||||
if (tcp->u_arg[0] == ARCH_SET_GS
|
||||
|| tcp->u_arg[0] == ARCH_SET_FS)
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
} else {
|
||||
if (tcp->u_arg[0] == ARCH_GET_GS
|
||||
|| tcp->u_arg[0] == ARCH_GET_FS) {
|
||||
long int v;
|
||||
if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1)
|
||||
tprintf(", [%#lx]", v);
|
||||
else
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
if (entering(tcp)) {
|
||||
printxval(archvals, tcp->u_arg[0], "ARCH_???");
|
||||
if (tcp->u_arg[0] == ARCH_SET_GS
|
||||
|| tcp->u_arg[0] == ARCH_SET_FS
|
||||
) {
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
} else {
|
||||
if (tcp->u_arg[0] == ARCH_GET_GS
|
||||
|| tcp->u_arg[0] == ARCH_GET_FS
|
||||
) {
|
||||
long int v;
|
||||
if (!syserror(tcp) && umove(tcp, tcp->u_arg[1], &v) != -1)
|
||||
tprintf(", [%#lx]", v);
|
||||
else
|
||||
tprintf(", %#lx", tcp->u_arg[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
# endif /* X86_64 */
|
||||
|
||||
|
||||
int
|
||||
sys_getcpu(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getcpu(struct tcb *tcp)
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
unsigned u;
|
||||
|
149
resource.c
149
resource.c
@ -109,8 +109,7 @@ static const struct xlat resources[] = {
|
||||
|
||||
#if !HAVE_LONG_LONG_RLIM_T
|
||||
static char *
|
||||
sprintrlim(lim)
|
||||
long lim;
|
||||
sprintrlim(long lim)
|
||||
{
|
||||
static char buf[32];
|
||||
|
||||
@ -124,8 +123,7 @@ long lim;
|
||||
}
|
||||
|
||||
int
|
||||
sys_getrlimit(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getrlimit(struct tcb *tcp)
|
||||
{
|
||||
struct rlimit rlim;
|
||||
|
||||
@ -147,8 +145,7 @@ struct tcb *tcp;
|
||||
}
|
||||
|
||||
int
|
||||
sys_setrlimit(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_setrlimit(struct tcb *tcp)
|
||||
{
|
||||
struct rlimit rlim;
|
||||
|
||||
@ -170,8 +167,7 @@ struct tcb *tcp;
|
||||
|
||||
#if _LFS64_LARGEFILE || HAVE_LONG_LONG_RLIM_T
|
||||
static char *
|
||||
sprintrlim64(lim)
|
||||
rlim64_t lim;
|
||||
sprintrlim64(rlim64_t lim)
|
||||
{
|
||||
static char buf[64];
|
||||
|
||||
@ -185,8 +181,7 @@ rlim64_t lim;
|
||||
}
|
||||
|
||||
int
|
||||
sys_getrlimit64(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getrlimit64(struct tcb *tcp)
|
||||
{
|
||||
struct rlimit64 rlim;
|
||||
|
||||
@ -208,8 +203,7 @@ struct tcb *tcp;
|
||||
}
|
||||
|
||||
int
|
||||
sys_setrlimit64(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_setrlimit64(struct tcb *tcp)
|
||||
{
|
||||
struct rlimit64 rlim;
|
||||
|
||||
@ -242,70 +236,64 @@ static const struct xlat usagewho[] = {
|
||||
|
||||
#ifdef ALPHA
|
||||
void
|
||||
printrusage32(tcp, addr)
|
||||
struct tcb *tcp;
|
||||
long addr;
|
||||
printrusage32(struct tcb *tcp, long addr)
|
||||
{
|
||||
struct timeval32
|
||||
{
|
||||
unsigned tv_sec;
|
||||
unsigned tv_usec;
|
||||
};
|
||||
struct rusage32
|
||||
{
|
||||
struct timeval32 ru_utime; /* user time used */
|
||||
struct timeval32 ru_stime; /* system time used */
|
||||
long ru_maxrss; /* maximum resident set size */
|
||||
long ru_ixrss; /* integral shared memory size */
|
||||
long ru_idrss; /* integral unshared data size */
|
||||
long ru_isrss; /* integral unshared stack size */
|
||||
long ru_minflt; /* page reclaims */
|
||||
long ru_majflt; /* page faults */
|
||||
long ru_nswap; /* swaps */
|
||||
long ru_inblock; /* block input operations */
|
||||
long ru_oublock; /* block output operations */
|
||||
long ru_msgsnd; /* messages sent */
|
||||
long ru_msgrcv; /* messages received */
|
||||
long ru_nsignals; /* signals received */
|
||||
long ru_nvcsw; /* voluntary context switches */
|
||||
long ru_nivcsw; /* involuntary " */
|
||||
} ru;
|
||||
struct timeval32 {
|
||||
unsigned tv_sec;
|
||||
unsigned tv_usec;
|
||||
};
|
||||
struct rusage32 {
|
||||
struct timeval32 ru_utime; /* user time used */
|
||||
struct timeval32 ru_stime; /* system time used */
|
||||
long ru_maxrss; /* maximum resident set size */
|
||||
long ru_ixrss; /* integral shared memory size */
|
||||
long ru_idrss; /* integral unshared data size */
|
||||
long ru_isrss; /* integral unshared stack size */
|
||||
long ru_minflt; /* page reclaims */
|
||||
long ru_majflt; /* page faults */
|
||||
long ru_nswap; /* swaps */
|
||||
long ru_inblock; /* block input operations */
|
||||
long ru_oublock; /* block output operations */
|
||||
long ru_msgsnd; /* messages sent */
|
||||
long ru_msgrcv; /* messages received */
|
||||
long ru_nsignals; /* signals received */
|
||||
long ru_nvcsw; /* voluntary context switches */
|
||||
long ru_nivcsw; /* involuntary " */
|
||||
} ru;
|
||||
|
||||
if (!addr)
|
||||
tprintf("NULL");
|
||||
else if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &ru) < 0)
|
||||
tprintf("{...}");
|
||||
else if (!abbrev(tcp)) {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
(long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
|
||||
tprintf("ru_maxrss=%lu, ru_ixrss=%lu, ",
|
||||
ru.ru_maxrss, ru.ru_ixrss);
|
||||
tprintf("ru_idrss=%lu, ru_isrss=%lu, ",
|
||||
ru.ru_idrss, ru.ru_isrss);
|
||||
tprintf("ru_minflt=%lu, ru_majflt=%lu, ru_nswap=%lu, ",
|
||||
ru.ru_minflt, ru.ru_majflt, ru.ru_nswap);
|
||||
tprintf("ru_inblock=%lu, ru_oublock=%lu, ",
|
||||
ru.ru_inblock, ru.ru_oublock);
|
||||
tprintf("ru_msgsnd=%lu, ru_msgrcv=%lu, ",
|
||||
ru.ru_msgsnd, ru.ru_msgrcv);
|
||||
tprintf("ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}",
|
||||
ru.ru_nsignals, ru.ru_nvcsw, ru.ru_nivcsw);
|
||||
}
|
||||
else {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ...}",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
(long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
|
||||
}
|
||||
if (!addr)
|
||||
tprintf("NULL");
|
||||
else if (syserror(tcp) || !verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else if (umove(tcp, addr, &ru) < 0)
|
||||
tprintf("{...}");
|
||||
else if (!abbrev(tcp)) {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
(long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
|
||||
tprintf("ru_maxrss=%lu, ru_ixrss=%lu, ",
|
||||
ru.ru_maxrss, ru.ru_ixrss);
|
||||
tprintf("ru_idrss=%lu, ru_isrss=%lu, ",
|
||||
ru.ru_idrss, ru.ru_isrss);
|
||||
tprintf("ru_minflt=%lu, ru_majflt=%lu, ru_nswap=%lu, ",
|
||||
ru.ru_minflt, ru.ru_majflt, ru.ru_nswap);
|
||||
tprintf("ru_inblock=%lu, ru_oublock=%lu, ",
|
||||
ru.ru_inblock, ru.ru_oublock);
|
||||
tprintf("ru_msgsnd=%lu, ru_msgrcv=%lu, ",
|
||||
ru.ru_msgsnd, ru.ru_msgrcv);
|
||||
tprintf("ru_nsignals=%lu, ru_nvcsw=%lu, ru_nivcsw=%lu}",
|
||||
ru.ru_nsignals, ru.ru_nvcsw, ru.ru_nivcsw);
|
||||
}
|
||||
else {
|
||||
tprintf("{ru_utime={%lu, %lu}, ru_stime={%lu, %lu}, ...}",
|
||||
(long) ru.ru_utime.tv_sec, (long) ru.ru_utime.tv_usec,
|
||||
(long) ru.ru_stime.tv_sec, (long) ru.ru_stime.tv_usec);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void
|
||||
printrusage(tcp, addr)
|
||||
struct tcb *tcp;
|
||||
long addr;
|
||||
printrusage(struct tcb *tcp, long addr)
|
||||
{
|
||||
struct rusage ru;
|
||||
|
||||
@ -340,8 +328,7 @@ long addr;
|
||||
}
|
||||
|
||||
int
|
||||
sys_getrusage(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getrusage(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
|
||||
@ -354,8 +341,7 @@ struct tcb *tcp;
|
||||
|
||||
#ifdef ALPHA
|
||||
int
|
||||
sys_osf_getrusage(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_osf_getrusage(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(usagewho, tcp->u_arg[0], "RUSAGE_???");
|
||||
@ -372,8 +358,7 @@ struct tcb *tcp;
|
||||
#ifdef LINUX
|
||||
|
||||
int
|
||||
sys_sysinfo(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_sysinfo(struct tcb *tcp)
|
||||
{
|
||||
struct sysinfo si;
|
||||
|
||||
@ -407,8 +392,7 @@ static const struct xlat priorities[] = {
|
||||
};
|
||||
|
||||
int
|
||||
sys_getpriority(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_getpriority(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(priorities, tcp->u_arg[0], "PRIO_???");
|
||||
@ -418,8 +402,7 @@ struct tcb *tcp;
|
||||
}
|
||||
|
||||
int
|
||||
sys_setpriority(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_setpriority(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(priorities, tcp->u_arg[0], "PRIO_???");
|
||||
@ -429,8 +412,7 @@ struct tcb *tcp;
|
||||
}
|
||||
|
||||
int
|
||||
sys_nice(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_nice(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp))
|
||||
tprintf("%ld", tcp->u_arg[0]);
|
||||
@ -440,8 +422,7 @@ struct tcb *tcp;
|
||||
#ifndef SUNOS4
|
||||
|
||||
int
|
||||
sys_times(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_times(struct tcb *tcp)
|
||||
{
|
||||
struct tms tbuf;
|
||||
|
||||
|
26
signal.c
26
signal.c
@ -1873,8 +1873,7 @@ struct new_sigaction
|
||||
|
||||
|
||||
int
|
||||
sys_rt_sigaction(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_rt_sigaction(struct tcb *tcp)
|
||||
{
|
||||
struct new_sigaction sa;
|
||||
sigset_t sigset;
|
||||
@ -1934,9 +1933,8 @@ sys_rt_sigaction(tcp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
sys_rt_sigpending(tcp)
|
||||
struct tcb *tcp;
|
||||
int
|
||||
sys_rt_sigpending(struct tcb *tcp)
|
||||
{
|
||||
sigset_t sigset;
|
||||
|
||||
@ -1951,9 +1949,9 @@ sys_rt_sigpending(tcp)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int
|
||||
sys_rt_sigsuspend(tcp)
|
||||
struct tcb *tcp;
|
||||
|
||||
int
|
||||
sys_rt_sigsuspend(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
sigset_t sigm;
|
||||
@ -1964,9 +1962,9 @@ sys_rt_sigsuspend(tcp)
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
int
|
||||
sys_rt_sigqueueinfo(tcp)
|
||||
struct tcb *tcp;
|
||||
|
||||
int
|
||||
sys_rt_sigqueueinfo(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
siginfo_t si;
|
||||
@ -1981,8 +1979,7 @@ sys_rt_sigqueueinfo(tcp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int sys_rt_sigtimedwait(tcp)
|
||||
struct tcb *tcp;
|
||||
int sys_rt_sigtimedwait(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
sigset_t sigset;
|
||||
@ -2012,8 +2009,7 @@ int sys_rt_sigtimedwait(tcp)
|
||||
};
|
||||
|
||||
int
|
||||
sys_restart_syscall(tcp)
|
||||
struct tcb *tcp;
|
||||
sys_restart_syscall(struct tcb *tcp)
|
||||
{
|
||||
if (entering(tcp))
|
||||
tprintf("<... resuming interrupted call ...>");
|
||||
|
146
time.c
146
time.c
@ -70,9 +70,8 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
tprintf("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else
|
||||
{
|
||||
int rc;
|
||||
else {
|
||||
int rc;
|
||||
|
||||
if (bitness == BITNESS_32
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
@ -92,8 +91,7 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
else
|
||||
tprint_timeval32(tcp, &tv);
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
struct timeval tv;
|
||||
|
||||
if ((rc = umove(tcp, addr, &tv)) >= 0) {
|
||||
@ -107,7 +105,6 @@ printtv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness, int special)
|
||||
tprint_timeval(tcp, &tv);
|
||||
}
|
||||
}
|
||||
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
}
|
||||
@ -120,9 +117,8 @@ sprinttv(struct tcb *tcp, long addr, enum bitness_t bitness, char *buf)
|
||||
strcpy(buf, "NULL");
|
||||
else if (!verbose(tcp))
|
||||
sprintf(buf, "%#lx", addr);
|
||||
else
|
||||
{
|
||||
int rc;
|
||||
else {
|
||||
int rc;
|
||||
|
||||
if (bitness == BITNESS_32
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
@ -135,8 +131,7 @@ sprinttv(struct tcb *tcp, long addr, enum bitness_t bitness, char *buf)
|
||||
if ((rc = umove(tcp, addr, &tv)) >= 0)
|
||||
sprintf(buf, "{%u, %u}",
|
||||
tv.tv_sec, tv.tv_usec);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
struct timeval tv;
|
||||
|
||||
if ((rc = umove(tcp, addr, &tv)) >= 0)
|
||||
@ -144,77 +139,68 @@ sprinttv(struct tcb *tcp, long addr, enum bitness_t bitness, char *buf)
|
||||
(unsigned long) tv.tv_sec,
|
||||
(unsigned long) tv.tv_usec);
|
||||
}
|
||||
|
||||
if (rc < 0)
|
||||
strcpy(buf, "{...}");
|
||||
}
|
||||
}
|
||||
|
||||
void print_timespec (struct tcb *tcp, long addr)
|
||||
void print_timespec(struct tcb *tcp, long addr)
|
||||
{
|
||||
if (addr == 0)
|
||||
tprintf("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else {
|
||||
int rc;
|
||||
int rc;
|
||||
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
if (personality_wordsize[current_personality] == 4)
|
||||
{
|
||||
if (personality_wordsize[current_personality] == 4) {
|
||||
struct timeval32 tv;
|
||||
|
||||
if ((rc = umove(tcp, addr, &tv)) >= 0)
|
||||
tprintf("{%u, %u}",
|
||||
tv.tv_sec, tv.tv_usec);
|
||||
} else
|
||||
{
|
||||
#endif
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
if ((rc = umove(tcp, addr, &ts)) >= 0)
|
||||
tprintf("{%lu, %lu}",
|
||||
(unsigned long) ts.tv_sec,
|
||||
(unsigned long) ts.tv_nsec);
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
}
|
||||
}
|
||||
|
||||
void sprint_timespec (char *buf, struct tcb *tcp, long addr)
|
||||
void sprint_timespec(char *buf, struct tcb *tcp, long addr)
|
||||
{
|
||||
if (addr == 0)
|
||||
strcpy(buf, "NULL");
|
||||
else if (!verbose(tcp))
|
||||
sprintf(buf, "%#lx", addr);
|
||||
else {
|
||||
int rc;
|
||||
int rc;
|
||||
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
if (personality_wordsize[current_personality] == 4)
|
||||
{
|
||||
if (personality_wordsize[current_personality] == 4) {
|
||||
struct timeval32 tv;
|
||||
|
||||
if ((rc = umove(tcp, addr, &tv)) >= 0)
|
||||
sprintf(buf, "{%u, %u}",
|
||||
tv.tv_sec, tv.tv_usec);
|
||||
} else
|
||||
{
|
||||
#endif
|
||||
{
|
||||
struct timespec ts;
|
||||
|
||||
if ((rc = umove(tcp, addr, &ts)) >= 0)
|
||||
sprintf(buf, "{%lu, %lu}",
|
||||
(unsigned long) ts.tv_sec,
|
||||
(unsigned long) ts.tv_nsec);
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
}
|
||||
#endif
|
||||
|
||||
if (rc < 0)
|
||||
strcpy(buf, "{...}");
|
||||
}
|
||||
@ -267,19 +253,18 @@ int
|
||||
sys_osf_gettimeofday(tcp)
|
||||
struct tcb *tcp;
|
||||
{
|
||||
if (exiting(tcp)) {
|
||||
if (syserror(tcp)) {
|
||||
tprintf("%#lx, %#lx",
|
||||
tcp->u_arg[0], tcp->u_arg[1]);
|
||||
return 0;
|
||||
}
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
if (exiting(tcp)) {
|
||||
if (syserror(tcp)) {
|
||||
tprintf("%#lx, %#lx", tcp->u_arg[0], tcp->u_arg[1]);
|
||||
return 0;
|
||||
}
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
tprintf(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -302,14 +287,14 @@ int
|
||||
sys_osf_settimeofday(tcp)
|
||||
struct tcb *tcp;
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
if (entering(tcp)) {
|
||||
printtv_bitness(tcp, tcp->u_arg[0], BITNESS_32, 0);
|
||||
#ifndef SVR4
|
||||
tprintf(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
tprintf(", ");
|
||||
printtv_bitness(tcp, tcp->u_arg[1], BITNESS_32, 0);
|
||||
#endif /* !SVR4 */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -358,9 +343,8 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
tprintf("NULL");
|
||||
else if (!verbose(tcp))
|
||||
tprintf("%#lx", addr);
|
||||
else
|
||||
{
|
||||
int rc;
|
||||
else {
|
||||
int rc;
|
||||
|
||||
if (bitness == BITNESS_32
|
||||
#if defined(LINUX) && SUPPORTED_PERSONALITIES > 1
|
||||
@ -368,8 +352,7 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
#endif
|
||||
)
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
struct timeval32 it_interval, it_value;
|
||||
} itv;
|
||||
|
||||
@ -380,8 +363,7 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
tprint_timeval32(tcp, &itv.it_value);
|
||||
tprintf("}");
|
||||
}
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
struct itimerval itv;
|
||||
|
||||
if ((rc = umove(tcp, addr, &itv)) >= 0) {
|
||||
@ -392,7 +374,6 @@ printitv_bitness(struct tcb *tcp, long addr, enum bitness_t bitness)
|
||||
tprintf("}");
|
||||
}
|
||||
}
|
||||
|
||||
if (rc < 0)
|
||||
tprintf("{...}");
|
||||
}
|
||||
@ -423,16 +404,16 @@ int
|
||||
sys_osf_getitimer(tcp)
|
||||
struct tcb *tcp;
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else
|
||||
printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[1]);
|
||||
else
|
||||
printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -459,18 +440,18 @@ int
|
||||
sys_osf_setitimer(tcp)
|
||||
struct tcb *tcp;
|
||||
{
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
|
||||
tprintf(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32);
|
||||
}
|
||||
return 0;
|
||||
if (entering(tcp)) {
|
||||
printxval(which, tcp->u_arg[0], "ITIMER_???");
|
||||
tprintf(", ");
|
||||
printitv_bitness(tcp, tcp->u_arg[1], BITNESS_32);
|
||||
tprintf(", ");
|
||||
} else {
|
||||
if (syserror(tcp))
|
||||
tprintf("%#lx", tcp->u_arg[2]);
|
||||
else
|
||||
printitv_bitness(tcp, tcp->u_arg[2], BITNESS_32);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -574,8 +555,7 @@ static const struct xlat adjtimex_state[] = {
|
||||
static int
|
||||
tprint_timex32(struct tcb *tcp, long addr)
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
unsigned int modes;
|
||||
int offset;
|
||||
int freq;
|
||||
@ -761,17 +741,14 @@ static const struct xlat sigev_value[] = {
|
||||
static void
|
||||
printsigevent32(struct tcb *tcp, long arg)
|
||||
{
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
int sigev_value;
|
||||
int sigev_signo;
|
||||
int sigev_notify;
|
||||
|
||||
union
|
||||
{
|
||||
union {
|
||||
int tid;
|
||||
struct
|
||||
{
|
||||
struct {
|
||||
int function, attribute;
|
||||
} thread;
|
||||
} un;
|
||||
@ -779,8 +756,7 @@ printsigevent32(struct tcb *tcp, long arg)
|
||||
|
||||
if (umove(tcp, arg, &sev) < 0)
|
||||
tprintf("{...}");
|
||||
else
|
||||
{
|
||||
else {
|
||||
tprintf("{%#x, ", sev.sigev_value);
|
||||
if (sev.sigev_notify == SIGEV_SIGNAL)
|
||||
tprintf("%s, ", signame(sev.sigev_signo));
|
||||
|
Loading…
x
Reference in New Issue
Block a user