Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/aacraid/aacraid_linux.c
Show All 30 Lines | |||||
#include <sys/cdefs.h> | #include <sys/cdefs.h> | ||||
__FBSDID("$FreeBSD$"); | __FBSDID("$FreeBSD$"); | ||||
/* | /* | ||||
* Linux ioctl handler for the aac device driver | * Linux ioctl handler for the aac device driver | ||||
*/ | */ | ||||
#include <sys/param.h> | #include <sys/param.h> | ||||
#if __FreeBSD_version >= 900000 | |||||
#include <sys/capsicum.h> | #include <sys/capsicum.h> | ||||
#endif | |||||
#include <sys/systm.h> | #include <sys/systm.h> | ||||
#include <sys/conf.h> | #include <sys/conf.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/file.h> | #include <sys/file.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#ifdef __amd64__ | #ifdef __amd64__ | ||||
#include <machine/../linux32/linux.h> | #include <machine/../linux32/linux.h> | ||||
Show All 27 Lines | |||||
DEV_MODULE(aacraid_linux, aacraid_linux_modevent, NULL); | DEV_MODULE(aacraid_linux, aacraid_linux_modevent, NULL); | ||||
MODULE_DEPEND(aacraid_linux, linux, 1, 1, 1); | MODULE_DEPEND(aacraid_linux, linux, 1, 1, 1); | ||||
static int | static int | ||||
aacraid_linux_ioctl(struct thread *td, struct linux_ioctl_args *args) | aacraid_linux_ioctl(struct thread *td, struct linux_ioctl_args *args) | ||||
{ | { | ||||
struct file *fp; | struct file *fp; | ||||
#if __FreeBSD_version >= 900000 | |||||
cap_rights_t rights; | cap_rights_t rights; | ||||
#endif | |||||
u_long cmd; | u_long cmd; | ||||
int error; | int error; | ||||
if ((error = fget(td, args->fd, | if ((error = fget(td, args->fd, | ||||
#if __FreeBSD_version >= 900000 | |||||
cap_rights_init(&rights, CAP_IOCTL), | cap_rights_init(&rights, CAP_IOCTL), | ||||
#endif | |||||
&fp)) != 0) { | &fp)) != 0) { | ||||
return (error); | return (error); | ||||
} | } | ||||
cmd = args->cmd; | cmd = args->cmd; | ||||
/* | /* | ||||
* Pass the ioctl off to our standard handler. | * Pass the ioctl off to our standard handler. | ||||
*/ | */ | ||||
error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); | error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td)); | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return (error); | return (error); | ||||
} | } |