2 * See i386-fbsd.c for copyright and license terms.
4 * System call arguments come in several flavours:
5 * Hex -- values that should be printed in hex (addresses)
6 * Octal -- Same as above, but octal
7 * Int -- normal integer values (file descriptors, for example)
8 * String -- pointers to sensible data. Note that we treat read() and
9 * write() arguments as such, even though they may *not* be
11 * Ptr -- pointer to some specific structure. Just print as hex for now.
12 * Stat -- a pointer to a stat buffer. Currently unused.
13 * Ioctl -- an ioctl command. Woefully limited.
14 * Quad -- a double-word value. e.g., lseek(int, offset_t, int)
15 * Signal -- a signal number. Prints the signal name (SIGxxx)
16 * Sockaddr -- a pointer to a struct sockaddr. Prints symbolic AF, and IP:Port
17 * StringArray -- a pointer to an array of string pointers.
18 * Timespec -- a pointer to a struct timespec. Prints both elements.
19 * Timeval -- a pointer to a struct timeval. Prints both elements.
20 * Itimerval -- a pointer to a struct itimerval. Prints all elements.
21 * Pollfd -- a pointer to an array of struct pollfd. Prints .fd and .events.
22 * Fd_set -- a pointer to an array of fd_set. Prints the fds that are set.
23 * Sigaction -- a pointer to a struct sigaction. Prints all elements.
25 * In addition, the pointer types (String, Ptr) may have OUT masked in --
26 * this means that the data is set on *return* from the system call -- or
27 * IN (meaning that the data is passed *into* the system call).
33 enum Argtype { None = 1, Hex, Octal, Int, Name, String, Ptr, Stat, Ioctl, Quad,
34 Signal, Sockaddr, StringArray, Timespec, Timeval, Itimerval, Pollfd,
35 Fd_set, Sigaction, Fcntl, Mprot, Mmapflags, Whence, Readlinkres };
48 int ret_type; /* 0, 1, or 2 return values */
49 int nargs; /* actual number of meaningful arguments */
50 /* Hopefully, no syscalls with > 10 args */
51 struct syscall_args args[10];
54 struct syscall *get_syscall(const char*);
55 char *get_string(int, void*, int);
56 char *print_arg(int, struct syscall_args *, unsigned long*, long, struct trussinfo *);
57 void print_syscall(struct trussinfo *, const char *, int, char **);
58 void print_syscall_ret(struct trussinfo *, const char *, int, char **, int,