Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/truss/syscalls.c
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Lines | |||||
#include <sys/event.h> | #include <sys/event.h> | ||||
#include <sys/ioccom.h> | #include <sys/ioccom.h> | ||||
#include <sys/mount.h> | #include <sys/mount.h> | ||||
#include <sys/ptrace.h> | #include <sys/ptrace.h> | ||||
#include <sys/resource.h> | #include <sys/resource.h> | ||||
#include <sys/socket.h> | #include <sys/socket.h> | ||||
#define _WANT_FREEBSD11_STAT | #define _WANT_FREEBSD11_STAT | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <sys/time.h> | |||||
#include <sys/un.h> | #include <sys/un.h> | ||||
#include <sys/wait.h> | #include <sys/wait.h> | ||||
#include <netinet/in.h> | #include <netinet/in.h> | ||||
#include <netinet/sctp.h> | #include <netinet/sctp.h> | ||||
#include <arpa/inet.h> | #include <arpa/inet.h> | ||||
#include <assert.h> | #include <assert.h> | ||||
#include <ctype.h> | #include <ctype.h> | ||||
▲ Show 20 Lines • Show All 2,571 Lines • ▼ Show 20 Lines | print_syscall_ret(struct trussinfo *trussinfo, int errorp, long *retval) | ||||
struct timespec timediff; | struct timespec timediff; | ||||
struct threadinfo *t; | struct threadinfo *t; | ||||
struct syscall *sc; | struct syscall *sc; | ||||
int error; | int error; | ||||
t = trussinfo->curthread; | t = trussinfo->curthread; | ||||
sc = t->cs.sc; | sc = t->cs.sc; | ||||
if (trussinfo->flags & COUNTONLY) { | if (trussinfo->flags & COUNTONLY) { | ||||
timespecsubt(&t->after, &t->before, &timediff); | timespecsub(&t->after, &t->before, &timediff); | ||||
timespecadd(&sc->time, &timediff, &sc->time); | timespecadd(&sc->time, &timediff, &sc->time); | ||||
sc->ncalls++; | sc->ncalls++; | ||||
if (errorp) | if (errorp) | ||||
sc->nerror++; | sc->nerror++; | ||||
return; | return; | ||||
} | } | ||||
print_syscall(trussinfo); | print_syscall(trussinfo); | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |