diff options
author | alfred <alfred@FreeBSD.org> | 2004-07-10 09:23:53 +0000 |
---|---|---|
committer | alfred <alfred@FreeBSD.org> | 2004-07-10 09:23:53 +0000 |
commit | 008c1be05d9eb305b7a930a3f1791d1b9b82d5c8 (patch) | |
tree | 7cb62c0b43a102a0b3faf4dae55d05f22bc78539 /usr.bin | |
parent | 3f97d8af9c10e372b6e3a35fca1011071fbafb7e (diff) | |
download | FreeBSD-src-008c1be05d9eb305b7a930a3f1791d1b9b82d5c8.zip FreeBSD-src-008c1be05d9eb305b7a930a3f1791d1b9b82d5c8.tar.gz |
Decode the "wence" arg to lseek and linux_lseek.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/truss/syscall.h | 2 | ||||
-rw-r--r-- | usr.bin/truss/syscalls.c | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/usr.bin/truss/syscall.h b/usr.bin/truss/syscall.h index a6cdbec..ff57f72 100644 --- a/usr.bin/truss/syscall.h +++ b/usr.bin/truss/syscall.h @@ -32,7 +32,7 @@ enum Argtype { None = 1, Hex, Octal, Int, String, Ptr, Stat, Ioctl, Quad, Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd, - Fd_set, Sigaction, Fcntl, Mprot, Mmapflags }; + Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence }; #define ARG_MASK 0xff #define OUT 0x100 diff --git a/usr.bin/truss/syscalls.c b/usr.bin/truss/syscalls.c index 83ad2aa..fff0555 100644 --- a/usr.bin/truss/syscalls.c +++ b/usr.bin/truss/syscalls.c @@ -73,7 +73,9 @@ struct syscall syscalls[] = { { "readlink", 1, 3, { { String, 0 } , { String | OUT, 1 }, { Int, 2 }}}, { "lseek", 2, 3, - { { Int, 0 }, {Quad, 2 }, { Int, 4 }}}, + { { Int, 0 }, {Quad, 2 }, { Whence, 4 }}}, + { "linux_lseek", 2, 3, + { { Int, 0 }, {Int, 1 }, { Whence, 2 }}}, { "mmap", 2, 6, { { Ptr, 0 }, {Int, 1}, {Mprot, 2}, {Mmapflags, 3}, {Int, 4}, {Quad, 6}}}, { "mprotect", 1, 3, @@ -524,6 +526,18 @@ print_arg(int fd, struct syscall_args *sc, unsigned long *args) { } break; + case Whence: + { + switch (args[sc->offset]) { +#define S(a) case a: tmp = strdup(#a); break; + S(SEEK_SET); + S(SEEK_CUR); + S(SEEK_END); +#undef S + default: asprintf(&tmp, "0x%lx", args[sc->offset]); break; + } + } + break; case Sockaddr: { struct sockaddr_storage ss; |