diff options
author | mdodd <mdodd@FreeBSD.org> | 2002-08-04 02:24:21 +0000 |
---|---|---|
committer | mdodd <mdodd@FreeBSD.org> | 2002-08-04 02:24:21 +0000 |
commit | c3ab10b17915ac6015c29576e0e4ecdf3d0d4f2b (patch) | |
tree | b89cede034e8feee79adf2c013453474e0153c62 /usr.bin/truss/main.c | |
parent | b4aa304f721d9d64f5cb0a5b89efeccd3125d70f (diff) | |
download | FreeBSD-src-c3ab10b17915ac6015c29576e0e4ecdf3d0d4f2b.zip FreeBSD-src-c3ab10b17915ac6015c29576e0e4ecdf3d0d4f2b.tar.gz |
Add options to print the argument and environment string parameters to
execve().
This could be done in a more general manner but it still wouldn't
be very pretty.
MFC after: 3 weeks
Diffstat (limited to 'usr.bin/truss/main.c')
-rw-r--r-- | usr.bin/truss/main.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index f8b54fe..e100c16 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -67,8 +67,8 @@ static __inline void usage(void) { fprintf(stderr, "%s\n%s\n", - "usage: truss [-fdDS] [-o file] -p pid", - " truss [-fdDS] [-o file] command [args]"); + "usage: truss [-faedDS] [-o file] -p pid", + " truss [-faedDS] [-o file] command [args]"); exit(1); } @@ -146,7 +146,7 @@ main(int ac, char **av) { bzero(trussinfo, sizeof(struct trussinfo)); trussinfo->outfile = stderr; - while ((c = getopt(ac, av, "p:o:fdDS")) != -1) { + while ((c = getopt(ac, av, "p:o:faedDS")) != -1) { switch (c) { case 'p': /* specified pid */ trussinfo->pid = atoi(optarg); @@ -154,6 +154,12 @@ main(int ac, char **av) { case 'f': /* Follow fork()'s */ trussinfo->flags |= FOLLOWFORKS; break; + case 'a': /* Print execve() argument strings. */ + trussinfo->flags |= EXECVEARGS; + break; + case 'e': /* Print execve() environment strings. */ + trussinfo->flags |= EXECVEENVS; + break; case 'd': /* Absolute timestamps */ trussinfo->flags |= ABSOLUTETIMESTAMPS; break; |