-
-int
-sys_ioctl(struct tcb *tcp)
-{
- const struct_ioctlent *iop;
-
- if (entering(tcp)) {
- printfd(tcp, tcp->u_arg[0]);
- tprints(", ");
- iop = ioctl_lookup(tcp->u_arg[1]);
- if (iop) {
- tprints(iop->symbol);
- while ((iop = ioctl_next_match(iop)))
- tprintf(" or %s", iop->symbol);
- } else
- tprintf("%#lx", tcp->u_arg[1]);
- ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- }
- else {
- int ret = ioctl_decode(tcp, tcp->u_arg[1], tcp->u_arg[2]);
- if (!ret)
- tprintf(", %#lx", tcp->u_arg[2]);
- else
- return ret - 1;
- }
- return 0;
-}