1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-10-19 02:29:40 +00:00

Decode the "wence" arg to lseek and linux_lseek.

This commit is contained in:
Alfred Perlstein 2004-07-10 09:23:53 +00:00
parent 9c8fd487a5
commit fde3a7d1e9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131893
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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;