Changeset View
Changeset View
Standalone View
Standalone View
usr.bin/truss/main.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#include <sysdecode.h> | #include <sysdecode.h> | ||||
#include <time.h> | #include <time.h> | ||||
#include <unistd.h> | #include <unistd.h> | ||||
#include "truss.h" | #include "truss.h" | ||||
#include "extern.h" | #include "extern.h" | ||||
#include "syscall.h" | #include "syscall.h" | ||||
static void | static __dead2 void | ||||
usage(void) | usage(void) | ||||
{ | { | ||||
fprintf(stderr, "%s\n%s\n", | fprintf(stderr, "%s\n%s\n", | ||||
"usage: truss [-cfaedDHS] [-o file] [-s strsize] -p pid", | "usage: truss [-cfaedDHS] [-o file] [-s strsize] -p pid", | ||||
" truss [-cfaedDHS] [-o file] [-s strsize] command [args]"); | " truss [-cfaedDHS] [-o file] [-s strsize] command [args]"); | ||||
exit(1); | exit(1); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 46 Lines • ▼ Show 20 Lines | case 'd': /* Absolute timestamps */ | ||||
break; | break; | ||||
case 'D': /* Relative timestamps */ | case 'D': /* Relative timestamps */ | ||||
trussinfo->flags |= RELATIVETIMESTAMPS; | trussinfo->flags |= RELATIVETIMESTAMPS; | ||||
break; | break; | ||||
case 'o': /* Specified output file */ | case 'o': /* Specified output file */ | ||||
fname = optarg; | fname = optarg; | ||||
break; | break; | ||||
case 's': /* Specified string size */ | case 's': /* Specified string size */ | ||||
trussinfo->strsize = strtonum(optarg, 0, INT_MAX, &errstr); | trussinfo->strsize = (int)strtonum(optarg, 0, INT_MAX, | ||||
&errstr); | |||||
if (errstr) | if (errstr) | ||||
errx(1, "maximum string size is %s: %s", errstr, optarg); | errx(1, "maximum string size is %s: %s", errstr, optarg); | ||||
break; | break; | ||||
case 'S': /* Don't trace signals */ | case 'S': /* Don't trace signals */ | ||||
trussinfo->flags |= NOSIGS; | trussinfo->flags |= NOSIGS; | ||||
break; | break; | ||||
case 'H': | case 'H': | ||||
trussinfo->flags |= DISPLAYTIDS; | trussinfo->flags |= DISPLAYTIDS; | ||||
▲ Show 20 Lines • Show All 79 Lines • Show Last 20 Lines |