From: Lionel Sambuc Date: Mon, 12 May 2014 10:58:56 +0000 (+0200) Subject: Message type for VFS_COPYFD X-Git-Tag: v3.3.0~317 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=6fb0c605fde715561fd26a0df298bbb4ff60af24;p=minix.git Message type for VFS_COPYFD Change-Id: I7aff1b9551d3a60b2191de1bac3b695ea06b73ce --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index a27dd589c..3af6514e5 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 copyfd(2) call. */ -#define VFS_COPYFD_ENDPT m1_i1 /* endpoint_t */ -#define VFS_COPYFD_FD m1_i2 /* int */ -#define VFS_COPYFD_WHAT m1_i3 /* int */ - /* Field names for the mapdriver(2) call. */ #define VFS_MAPDRIVER_MAJOR m1_i1 /* devmajor_t */ #define VFS_MAPDRIVER_LABELLEN m1_i2 /* size_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index a515a4996..e97e06889 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -220,6 +220,15 @@ typedef struct { } mess_lsys_vfs_checkperms; _ASSERT_MSG_SIZE(mess_lsys_vfs_checkperms); +typedef struct { + endpoint_t endpt; + int fd; + int what; + + uint8_t padding[44]; +} mess_lsys_vfs_copyfd; +_ASSERT_MSG_SIZE(mess_lsys_vfs_copyfd); + typedef struct { dev_t device; off_t seek_pos; @@ -679,6 +688,7 @@ typedef struct { mess_lc_vfs_umount m_lc_vfs_umount; mess_lsys_vfs_checkperms m_lsys_vfs_checkperms; + mess_lsys_vfs_copyfd m_lsys_vfs_copyfd; mess_vfs_fs_breadwrite m_vfs_fs_breadwrite; mess_vfs_fs_chmod m_vfs_fs_chmod; diff --git a/lib/libsys/copyfd.c b/lib/libsys/copyfd.c index 16960adf0..fb1ff87c2 100644 --- a/lib/libsys/copyfd.c +++ b/lib/libsys/copyfd.c @@ -8,9 +8,9 @@ copyfd(endpoint_t endpt, int fd, int what) message m; memset(&m, 0, sizeof(m)); - m.VFS_COPYFD_ENDPT = endpt; - m.VFS_COPYFD_FD = fd; - m.VFS_COPYFD_WHAT = what; + m.m_lsys_vfs_copyfd.endpt = endpt; + m.m_lsys_vfs_copyfd.fd = fd; + m.m_lsys_vfs_copyfd.what = what; return _taskcall(VFS_PROC_NR, VFS_COPYFD, &m); } diff --git a/servers/vfs/filedes.c b/servers/vfs/filedes.c index 0141de922..9e74ac637 100644 --- a/servers/vfs/filedes.c +++ b/servers/vfs/filedes.c @@ -428,9 +428,9 @@ int do_copyfd(void) /* This should be replaced with an ACL check. */ if (!super_user) return(EPERM); - endpt = (endpoint_t) job_m_in.VFS_COPYFD_ENDPT; - fd = job_m_in.VFS_COPYFD_FD; - what = job_m_in.VFS_COPYFD_WHAT; + endpt = job_m_in.m_lsys_vfs_copyfd.endpt; + fd = job_m_in.m_lsys_vfs_copyfd.fd; + what = job_m_in.m_lsys_vfs_copyfd.what; if (isokendpt(endpt, &slot) != OK) return(EINVAL); rfp = &fproc[slot];