From: Lionel Sambuc Date: Mon, 12 May 2014 11:16:40 +0000 (+0200) Subject: Message type for VFS_LSEEK X-Git-Tag: v3.3.0~314 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/style.css?a=commitdiff_plain;h=268d670a85b2cb7f6d9d216e715a237c4a372dd9;p=minix.git Message type for VFS_LSEEK Change-Id: I592284078572e4abf2b181d3b4e8281c9baf8a7b --- diff --git a/include/minix/callnr.h b/include/minix/callnr.h index e54953c4a..04f1de2b2 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 lseek(2) call. */ -#define VFS_LSEEK_FD m2_i1 /* int */ -#define VFS_LSEEK_OFF m2_ll1 /* off_t */ -#define VFS_LSEEK_WHENCE m2_i2 /* int */ - /* Field names for the truncate(2) and ftruncate(2) calls. */ #define VFS_TRUNCATE_FD m2_i1 /* int */ #define VFS_TRUNCATE_NAME m2_p1 /* const char * */ diff --git a/include/minix/ipc.h b/include/minix/ipc.h index 6914f894c..032e86fab 100644 --- a/include/minix/ipc.h +++ b/include/minix/ipc.h @@ -171,6 +171,23 @@ typedef struct { } mess_lc_vfs_ioctl; _ASSERT_MSG_SIZE(mess_lc_vfs_ioctl); +typedef struct { + off_t offset; + + int fd; + int whence; + + uint8_t padding[40]; +} mess_lc_vfs_lseek; +_ASSERT_MSG_SIZE(mess_lc_vfs_lseek); + +typedef struct { + off_t offset; + + uint8_t padding[48]; +} mess_vfs_lc_lseek; +_ASSERT_MSG_SIZE(mess_vfs_lc_lseek); + typedef struct { int flags; size_t devlen; @@ -699,6 +716,7 @@ typedef struct { mess_lc_vfs_fsync m_lc_vfs_fsync; mess_lc_vfs_getvfsstat m_lc_vfs_getvfsstat; mess_lc_vfs_ioctl m_lc_vfs_ioctl; + mess_lc_vfs_lseek m_lc_vfs_lseek; mess_lc_vfs_mount m_lc_vfs_mount; mess_lc_vfs_select m_lc_vfs_select; mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1; @@ -734,6 +752,8 @@ typedef struct { mess_vfs_fs_unlink m_vfs_fs_unlink; mess_vfs_fs_utime m_vfs_fs_utime; + mess_vfs_lc_lseek m_vfs_lc_lseek; + mess_vfs_utimens m_vfs_utimens; mess_vm_vfs_mmap m_vm_vfs_mmap; mess_vmmcp m_vmmcp; diff --git a/lib/libc/sys-minix/lseek.c b/lib/libc/sys-minix/lseek.c index 947232b60..14a8d66ef 100644 --- a/lib/libc/sys-minix/lseek.c +++ b/lib/libc/sys-minix/lseek.c @@ -16,9 +16,9 @@ lseek(int fd, off_t offset, int whence) message m; memset(&m, 0, sizeof(m)); - m.VFS_LSEEK_FD = fd; - m.VFS_LSEEK_OFF = offset; - m.VFS_LSEEK_WHENCE = whence; + m.m_lc_vfs_lseek.fd = fd; + m.m_lc_vfs_lseek.offset = offset; + m.m_lc_vfs_lseek.whence = whence; if (_syscall(VFS_PROC_NR, VFS_LSEEK, &m) < 0) return( (off_t) -1); - return( (off_t) m.VFS_LSEEK_OFF); + return(m.m_vfs_lc_lseek.offset); } diff --git a/servers/vfs/open.c b/servers/vfs/open.c index 32deb9fa7..2b5a35f73 100644 --- a/servers/vfs/open.c +++ b/servers/vfs/open.c @@ -646,13 +646,13 @@ int do_lseek(void) off_t newpos; int r; - if ((r = actual_lseek(fp, job_m_in.VFS_LSEEK_FD, - job_m_in.VFS_LSEEK_WHENCE, job_m_in.VFS_LSEEK_OFF, + if ((r = actual_lseek(fp, job_m_in.m_lc_vfs_lseek.fd, + job_m_in.m_lc_vfs_lseek.whence, job_m_in.m_lc_vfs_lseek.offset, &newpos)) != OK) return r; /* insert the new position into the output message */ - job_m_out.VFS_LSEEK_OFF = newpos; + job_m_out.m_vfs_lc_lseek.offset = newpos; return OK; }