From: Lionel Sambuc Date: Mon, 12 May 2014 10:46:59 +0000 (+0200) Subject: Message type for VFS_IOCTL X-Git-Tag: v3.3.0~319 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/Bv9ARM.ch13.html?a=commitdiff_plain;h=a57fc8f6837256194555121583d8d114a67b248a;p=minix.git Message type for VFS_IOCTL Change-Id: Ibea0fd2f443c1332bf1c9d138840d838bfc81d81 --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 5c91e70e4..2204baba6 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,11 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the ioctl(2) call. */ -#define VFS_IOCTL_FD m2_i1 /* int */ -#define VFS_IOCTL_REQ m2_i3 /* unsigned long */ -#define VFS_IOCTL_ARG m2_p1 /* void * */ - /* Field names for the checkperms(2) call. */ #define VFS_CHECKPERMS_ENDPT m2_i1 /* endpoint_t */ #define VFS_CHECKPERMS_GRANT m2_i2 /* cp_grant_id_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 5d56726ee..1cdded91f 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -155,6 +155,15 @@ typedef struct { } mess_lc_vfs_getvfsstat; _ASSERT_MSG_SIZE(mess_lc_vfs_getvfsstat); +typedef struct { + int fd; + unsigned long req; + void *arg; + + uint8_t padding[44]; +} mess_lc_vfs_ioctl; +_ASSERT_MSG_SIZE(mess_lc_vfs_ioctl); + typedef struct { int flags; size_t devlen; @@ -654,6 +663,7 @@ typedef struct { mess_fs_vfs_readwrite m_fs_vfs_readwrite; mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat; + mess_lc_vfs_ioctl m_lc_vfs_ioctl; mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_select m_lc_vfs_select; mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; diff --git a/lib/libc/sys-minix/ioctl.c b/lib/libc/sys-minix/ioctl.c index 12cea4b6d..09b3c04ea 100644 --- a/lib/libc/sys-minix/ioctl.c +++ b/lib/libc/sys-minix/ioctl.c @@ -76,9 +76,9 @@ int ioctl(int fd, unsigned long request, ...) } memset(&m, 0, sizeof(m)); - m.VFS_IOCTL_FD = fd; - m.VFS_IOCTL_REQ = request; - m.VFS_IOCTL_ARG = (char *) addr; + m.m_lc_vfs_ioctl.fd = fd; + m.m_lc_vfs_ioctl.req = request; + m.m_lc_vfs_ioctl.arg = addr; r = _syscall(VFS_PROC_NR, VFS_IOCTL, &m); diff --git a/servers/vfs/device.c b/servers/vfs/device.c index b5178bcbd..388286134 100644 --- a/servers/vfs/device.c +++ b/servers/vfs/device.c @@ -492,9 +492,9 @@ int do_ioctl(void) dev_t dev; void *argx; - scratch(fp).file.fd_nr = job_m_in.VFS_IOCTL_FD; - ioctlrequest = job_m_in.VFS_IOCTL_REQ; - argx = job_m_in.VFS_IOCTL_ARG; + scratch(fp).file.fd_nr = job_m_in.m_lc_vfs_ioctl.fd; + ioctlrequest = job_m_in.m_lc_vfs_ioctl.req; + argx = job_m_in.m_lc_vfs_ioctl.arg; if ((f = get_filp(scratch(fp).file.fd_nr, VNODE_READ)) == NULL) return(err_code);