From: Lionel Sambuc Date: Mon, 12 May 2014 14:42:43 +0000 (+0200) Subject: Message type for VFS_CREAT X-Git-Tag: v3.3.0~303 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/named.html?a=commitdiff_plain;h=c8695462268ed30c9fd7eaa9b86e2964089bef87;p=minix.git Message type for VFS_CREAT Change-Id: Ica111f1b2005a6ff42dc3bb59ac3158a2e12678c --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 565a4ed23..06330767e 100644 --- a/include/minix/callnr.h +++ b/include/minix/callnr.h @@ -232,12 +232,6 @@ #define NR_VFS_CALLS 49 /* highest number from base plus one */ -/* Field names for the creat(2) call. */ -#define VFS_CREAT_NAME m1_p1 /* const char * */ -#define VFS_CREAT_LEN m1_i1 /* size_t */ -#define VFS_CREAT_FLAGS m1_i2 /* int */ -#define VFS_CREAT_MODE m1_i3 /* mode_t */ - /* Field names for the chown(2) and fchown(2) calls. */ #define VFS_CHOWN_NAME m1_p1 /* const char * */ #define VFS_CHOWN_LEN m1_i1 /* size_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 0f5dffe24..03225e066 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -145,6 +145,16 @@ typedef struct { } mess_sigcalls; _ASSERT_MSG_SIZE(mess_sigcalls); +typedef struct { + vir_bytes name; + size_t len; + int flags; + mode_t mode; + + uint8_t padding[40]; +} mess_lc_vfs_creat; +_ASSERT_MSG_SIZE(mess_lc_vfs_creat); + typedef struct { int fd; int cmd; @@ -806,6 +816,7 @@ typedef struct { mess_fs_vfs_readsuper m_fs_vfs_readsuper; mess_fs_vfs_readwrite m_fs_vfs_readwrite; + mess_lc_vfs_creat m_lc_vfs_creat; mess_lc_vfs_fcntl m_lc_vfs_fcntl; mess_lc_vfs_fstat m_lc_vfs_fstat; mess_lc_vfs_fsync m_lc_vfs_fsync; diff --git a/lib/libc/sys-minix/open.c b/lib/libc/sys-minix/open.c index 7f5a6dd7e..baafbd606 100644 --- a/lib/libc/sys-minix/open.c +++ b/lib/libc/sys-minix/open.c @@ -18,10 +18,10 @@ int open(const char *name, int flags, ...) * and therefore a different call number as well. */ if (flags & O_CREAT) { - m.VFS_CREAT_LEN = strlen(name) + 1; - m.VFS_CREAT_FLAGS = flags; - m.VFS_CREAT_MODE = va_arg(argp, int); - m.VFS_CREAT_NAME = (char *) __UNCONST(name); + m.m_lc_vfs_creat.len = strlen(name) + 1; + m.m_lc_vfs_creat.flags = flags; + m.m_lc_vfs_creat.mode = va_arg(argp, mode_t); + m.m_lc_vfs_creat.name = (vir_bytes)name; call = VFS_CREAT; } else { _loadname(name, &m); diff --git a/servers/vfs/open.c b/servers/vfs/open.c index e60608d7c..205de3c27 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -64,10 +64,10 @@ int do_creat(void) vir_bytes vname; size_t vname_length; - vname = (vir_bytes) job_m_in.VFS_CREAT_NAME; - vname_length = (size_t) job_m_in.VFS_CREAT_LEN; - open_flags = job_m_in.VFS_CREAT_FLAGS; - create_mode = job_m_in.VFS_CREAT_MODE; + vname = job_m_in.m_lc_vfs_creat.name; + vname_length = job_m_in.m_lc_vfs_creat.len; + open_flags = job_m_in.m_lc_vfs_creat.flags; + create_mode = job_m_in.m_lc_vfs_creat.mode; if (!(open_flags & O_CREAT)) return(EINVAL);