Changeset View
Changeset View
Standalone View
Standalone View
head/sys/compat/freebsd32/freebsd32_ioctl.c
Show First 20 Lines • Show All 53 Lines • ▼ Show 20 Lines | |||||
#include <compat/freebsd32/freebsd32.h> | #include <compat/freebsd32/freebsd32.h> | ||||
#include <compat/freebsd32/freebsd32_ioctl.h> | #include <compat/freebsd32/freebsd32_ioctl.h> | ||||
#include <compat/freebsd32/freebsd32_misc.h> | #include <compat/freebsd32/freebsd32_misc.h> | ||||
#include <compat/freebsd32/freebsd32_proto.h> | #include <compat/freebsd32/freebsd32_proto.h> | ||||
CTASSERT(sizeof(struct mem_range_op32) == 12); | CTASSERT(sizeof(struct mem_range_op32) == 12); | ||||
static int | static int | ||||
freebsd32_ioctl_fiodgname(struct thread *td, | |||||
struct freebsd32_ioctl_args *uap, struct file *fp) | |||||
{ | |||||
struct fiodgname_arg fgn; | |||||
struct fiodgname_arg32 fgn32; | |||||
int error; | |||||
if ((error = copyin(uap->data, &fgn32, sizeof fgn32)) != 0) | |||||
return (error); | |||||
CP(fgn32, fgn, len); | |||||
PTRIN_CP(fgn32, fgn, buf); | |||||
error = fo_ioctl(fp, FIODGNAME, (caddr_t)&fgn, td->td_ucred, td); | |||||
return (error); | |||||
} | |||||
static int | |||||
freebsd32_ioctl_memrange(struct thread *td, | freebsd32_ioctl_memrange(struct thread *td, | ||||
struct freebsd32_ioctl_args *uap, struct file *fp) | struct freebsd32_ioctl_args *uap, struct file *fp) | ||||
{ | { | ||||
struct mem_range_op mro; | struct mem_range_op mro; | ||||
struct mem_range_op32 mro32; | struct mem_range_op32 mro32; | ||||
int error; | int error; | ||||
u_long com; | u_long com; | ||||
▲ Show 20 Lines • Show All 146 Lines • ▼ Show 20 Lines | freebsd32_ioctl(struct thread *td, struct freebsd32_ioctl_args *uap) | ||||
if (error != 0) | if (error != 0) | ||||
return (error); | return (error); | ||||
if ((fp->f_flag & (FREAD | FWRITE)) == 0) { | if ((fp->f_flag & (FREAD | FWRITE)) == 0) { | ||||
fdrop(fp, td); | fdrop(fp, td); | ||||
return (EBADF); | return (EBADF); | ||||
} | } | ||||
switch (uap->com) { | switch (uap->com) { | ||||
case FIODGNAME_32: | |||||
error = freebsd32_ioctl_fiodgname(td, uap, fp); | |||||
break; | |||||
case MEMRANGE_GET32: /* FALLTHROUGH */ | case MEMRANGE_GET32: /* FALLTHROUGH */ | ||||
case MEMRANGE_SET32: | case MEMRANGE_SET32: | ||||
error = freebsd32_ioctl_memrange(td, uap, fp); | error = freebsd32_ioctl_memrange(td, uap, fp); | ||||
break; | break; | ||||
case SG_IO_32: | case SG_IO_32: | ||||
error = freebsd32_ioctl_sg(td, uap, fp); | error = freebsd32_ioctl_sg(td, uap, fp); | ||||
break; | break; | ||||
Show All 16 Lines |