Deleted Added
full compact
aac_linux.c (165393) aac_linux.c (224778)
1/*-
2 * Copyright (c) 2002 Scott Long
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2002 Scott Long
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 11 unchanged lines hidden (view full) ---

20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/sys/dev/aac/aac_linux.c 165393 2006-12-20 17:10:53Z delphij $");
28__FBSDID("$FreeBSD: head/sys/dev/aac/aac_linux.c 224778 2011-08-11 12:30:23Z rwatson $");
29
30/*
31 * Linux ioctl handler for the aac device driver
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
29
30/*
31 * Linux ioctl handler for the aac device driver
32 */
33
34#include <sys/param.h>
35#include <sys/systm.h>
36#include <sys/capability.h>
36#include <sys/conf.h>
37#include <sys/kernel.h>
38#include <sys/module.h>
39#include <sys/file.h>
40#include <sys/proc.h>
41#ifdef __amd64__
42#include <machine/../linux32/linux.h>
43#include <machine/../linux32/linux32_proto.h>

--- 29 unchanged lines hidden (view full) ---

73
74static int
75aac_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
76{
77 struct file *fp;
78 u_long cmd;
79 int error;
80
37#include <sys/conf.h>
38#include <sys/kernel.h>
39#include <sys/module.h>
40#include <sys/file.h>
41#include <sys/proc.h>
42#ifdef __amd64__
43#include <machine/../linux32/linux.h>
44#include <machine/../linux32/linux32_proto.h>

--- 29 unchanged lines hidden (view full) ---

74
75static int
76aac_linux_ioctl(struct thread *td, struct linux_ioctl_args *args)
77{
78 struct file *fp;
79 u_long cmd;
80 int error;
81
81 if ((error = fget(td, args->fd, &fp)) != 0)
82 if ((error = fget(td, args->fd, CAP_IOCTL, &fp)) != 0)
82 return (error);
83 cmd = args->cmd;
84
85 /*
86 * Pass the ioctl off to our standard handler.
87 */
88 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
89 fdrop(fp, td);
90 return (error);
91}
83 return (error);
84 cmd = args->cmd;
85
86 /*
87 * Pass the ioctl off to our standard handler.
88 */
89 error = (fo_ioctl(fp, cmd, (caddr_t)args->arg, td->td_ucred, td));
90 fdrop(fp, td);
91 return (error);
92}