static int i_str(u_int fd, struct file *fp, struct inode *ip, void *data, struct pt_regs *regs) { int cmd; /* * Unpack the ioctl data and forward as a normal * ioctl. Timeouts are not handled (yet?). */ struct strioctl { int cmd, timeout, len; char *data; } it, *uap = data; if (copy_from_user(&it, uap, sizeof(struct strioctl))) return -EFAULT; cmd = it.cmd >> 8; abi_trace(ABI_TRACE_STREAMS, "STREAMS I_STR ioctl(%d, 0x%08x, %p)\n", fd, it.cmd, it.data); #ifdef CONFIG_ABI_XTI if (cmd == 'T') return timod_ioctl(regs, fd, cmd, it.data, it.len, &uap->len); #endif return __svr4_ioctl(regs, fd, it.cmd, it.data); }
int svr4_ioctl(struct pt_regs * regs) { u_int num; int fd; caddr_t data; fd = (int)get_syscall_parameter(regs, 0); num = (u_int)get_syscall_parameter(regs, 1); data = (caddr_t)get_syscall_parameter(regs, 2); return __svr4_ioctl(regs, fd, num, data); }