#define NR_VFS_CALLS 49 /* highest number from base plus one */
-/* Field names for the select(2) call. */
-#define VFS_SELECT_NFDS m8_i1 /* int */
-#define VFS_SELECT_READFDS m8_p1 /* fd_set * */
-#define VFS_SELECT_WRITEFDS m8_p2 /* fd_set * */
-#define VFS_SELECT_ERRORFDS m8_p3 /* fd_set * */
-#define VFS_SELECT_TIMEOUT m8_p4 /* struct timeval * */
-
/* Field names for the getvfsstat(2) call. */
#define VFS_GETVFSSTAT_BUF m1_p1 /* struct statvfs * */
#define VFS_GETVFSSTAT_LEN m1_i1 /* size_t */
} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ uint32_t nfds;
+ fd_set *readfds;
+ fd_set *writefds;
+ fd_set *errorfds;
+ vir_bytes timeout; /* user-provided 'struct timeval *' */
+
+ uint8_t padding[36];
+} mess_lc_vfs_select;
+_ASSERT_MSG_SIZE(mess_lc_vfs_select);
+
typedef struct {
dev_t device;
off_t seek_pos;
mess_fs_vfs_readsuper m_fs_vfs_readsuper;
mess_fs_vfs_readwrite m_fs_vfs_readwrite;
+ mess_lc_vfs_select m_lc_vfs_select;
+
mess_vfs_fs_breadwrite m_vfs_fs_breadwrite;
mess_vfs_fs_chmod m_vfs_fs_chmod;
mess_vfs_fs_chown m_vfs_fs_chown;
message m;
memset(&m, 0, sizeof(m));
- m.VFS_SELECT_NFDS = nfds;
- m.VFS_SELECT_READFDS = (char *) readfds;
- m.VFS_SELECT_WRITEFDS = (char *) writefds;
- m.VFS_SELECT_ERRORFDS = (char *) errorfds;
- m.VFS_SELECT_TIMEOUT = (char *) timeout;
+ m.m_lc_vfs_select.nfds = nfds;
+ m.m_lc_vfs_select.readfds = readfds;
+ m.m_lc_vfs_select.writefds = writefds;
+ m.m_lc_vfs_select.errorfds = errorfds;
+ m.m_lc_vfs_select.timeout = (vir_bytes)timeout;
return (_syscall(VFS_PROC_NR, VFS_SELECT, &m));
}
struct selectentry *se;
vir_bytes vtimeout;
- nfds = job_m_in.VFS_SELECT_NFDS;
- vtimeout = (vir_bytes) job_m_in.VFS_SELECT_TIMEOUT;
+ nfds = job_m_in.m_lc_vfs_select.nfds;
+ vtimeout = job_m_in.m_lc_vfs_select.timeout;
/* Sane amount of file descriptors? */
if (nfds < 0 || nfds > OPEN_MAX) return(EINVAL);
wipe_select(se); /* Clear results of previous usage */
se->requestor = fp;
se->req_endpt = who_e;
- se->vir_readfds = (fd_set *) job_m_in.VFS_SELECT_READFDS;
- se->vir_writefds = (fd_set *) job_m_in.VFS_SELECT_WRITEFDS;
- se->vir_errorfds = (fd_set *) job_m_in.VFS_SELECT_ERRORFDS;
+ se->vir_readfds = job_m_in.m_lc_vfs_select.readfds;
+ se->vir_writefds = job_m_in.m_lc_vfs_select.writefds;
+ se->vir_errorfds = job_m_in.m_lc_vfs_select.errorfds;
/* Copy fdsets from the process */
if ((r = copy_fdsets(se, nfds, FROM_PROC)) != OK) {
/* Did the process set a timeout value? If so, retrieve it. */
if (vtimeout != 0) {
do_timeout = 1;
- r = sys_datacopy_wrapper(who_e, (vir_bytes) vtimeout, SELF,
- (vir_bytes) &timeout, sizeof(timeout));
+ r = sys_datacopy_wrapper(who_e, vtimeout, SELF, (vir_bytes) &timeout,
+ sizeof(timeout));
if (r != OK) {
se->requestor = NULL;
return(r);