From: Lionel Sambuc Date: Mon, 12 May 2014 12:05:17 +0000 (+0200) Subject: Message type for VFS_READLINK X-Git-Tag: v3.3.0~309 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/zlib_tech.html?a=commitdiff_plain;h=c5b1fc6f0d7caa1937bba7b21535b2503dbc4c7b;p=minix.git Message type for VFS_READLINK Change-Id: I5da187cd22147448daa5a82568f0bd8bdcc2906f --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index 500465c46..395ea7979 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 readlink(2) call. */ -#define VFS_READLINK_NAME m1_p1 /* const char * */ -#define VFS_READLINK_NAMELEN m1_i1 /* size_t */ -#define VFS_READLINK_BUF m1_p2 /* char * */ -#define VFS_READLINK_BUFSIZE m1_i2 /* size_t */ - /* Field names for the stat(2) and lstat(2) calls. */ #define VFS_STAT_NAME m1_p1 /* const char * */ #define VFS_STAT_LEN m1_i1 /* size_t */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 55bdf2396..c7cf01e98 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -222,6 +222,16 @@ typedef struct { } mess_lc_vfs_pipe2; _ASSERT_MSG_SIZE(mess_lc_vfs_pipe2); +typedef struct { + vir_bytes name; /* const char * */ + size_t namelen; + vir_bytes buf; + size_t bufsize; + + uint8_t padding[40]; +} mess_lc_vfs_readlink; +_ASSERT_MSG_SIZE(mess_lc_vfs_readlink); + typedef struct { uint32_t nfds; fd_set *readfds; @@ -757,6 +767,7 @@ typedef struct { mess_lc_vfs_lseek m_lc_vfs_lseek; mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_pipe2 m_lc_vfs_pipe2; + mess_lc_vfs_readlink m_lc_vfs_readlink; mess_lc_vfs_select m_lc_vfs_select; mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; mess_lc_vfs_truncate m_lc_vfs_truncate; diff --git a/lib/libc/sys-minix/readlink.c b/lib/libc/sys-minix/readlink.c index 41f423f33..a7b80cea1 100644 --- a/lib/libc/sys-minix/readlink.c +++ b/lib/libc/sys-minix/readlink.c @@ -14,10 +14,10 @@ ssize_t readlink(const char *name, char *buffer, size_t bufsiz) message m; memset(&m, 0, sizeof(m)); - m.VFS_READLINK_NAMELEN = strlen(name) + 1; - m.VFS_READLINK_BUFSIZE = bufsiz; - m.VFS_READLINK_NAME = (char *) __UNCONST(name); - m.VFS_READLINK_BUF = (char *) buffer; + m.m_lc_vfs_readlink.namelen = strlen(name) + 1; + m.m_lc_vfs_readlink.bufsize = bufsiz; + m.m_lc_vfs_readlink.name = (vir_bytes)name; + m.m_lc_vfs_readlink.buf = (vir_bytes)buffer; return(_syscall(VFS_PROC_NR, VFS_READLINK, &m)); } diff --git a/servers/vfs/link.c b/servers/vfs/link.c index 63f6a9b99..d4aed5128 100644 --- a/servers/vfs/link.c +++ b/servers/vfs/link.c @@ -480,10 +480,10 @@ int do_rdlink(void) size_t vname_length, buf_size; vir_bytes buf; - vname = (vir_bytes) job_m_in.VFS_READLINK_NAME; - vname_length = job_m_in.VFS_READLINK_NAMELEN; - buf = (vir_bytes) job_m_in.VFS_READLINK_BUF; - buf_size = (size_t) job_m_in.VFS_READLINK_BUFSIZE; + vname = job_m_in.m_lc_vfs_readlink.name; + vname_length = job_m_in.m_lc_vfs_readlink.namelen; + buf = job_m_in.m_lc_vfs_readlink.buf; + buf_size = job_m_in.m_lc_vfs_readlink.bufsize; if (buf_size > SSIZE_MAX) return(EINVAL); lookup_init(&resolve, fullpath, PATH_RET_SYMLINK, &vmp, &vp);