Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/tdfx/tdfx_linux.c
Show First 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | linux_ioctl_tdfx(struct thread *td, struct linux_ioctl_args* args) | ||||
u_long cmd = args->cmd & 0xffff; | u_long cmd = args->cmd & 0xffff; | ||||
/* The structure passed to ioctl has two shorts, one int | /* The structure passed to ioctl has two shorts, one int | ||||
and one void*. */ | and one void*. */ | ||||
char d_pio[2*sizeof(short) + sizeof(int) + sizeof(void*)]; | char d_pio[2*sizeof(short) + sizeof(int) + sizeof(void*)]; | ||||
struct file *fp; | struct file *fp; | ||||
error = fget(td, args->fd, cap_rights_init(&rights, CAP_IOCTL), &fp); | error = fget(td, args->fd, cap_rights_init_one(&rights, CAP_IOCTL), &fp); | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
/* We simply copy the data and send it right to ioctl */ | /* We simply copy the data and send it right to ioctl */ | ||||
copyin((caddr_t)args->arg, &d_pio, sizeof(d_pio)); | copyin((caddr_t)args->arg, &d_pio, sizeof(d_pio)); | ||||
error = fo_ioctl(fp, cmd, (caddr_t)&d_pio, td->td_ucred, td); | error = fo_ioctl(fp, cmd, (caddr_t)&d_pio, td->td_ucred, td); | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return error; | return error; | ||||
} | } | ||||
Show All 24 Lines |