#define VFS_MAPDRIVER_LABELLEN m1_i2 /* size_t */
#define VFS_MAPDRIVER_LABEL m1_p1 /* char * */
-/* Field names for the utimens(2) call. */
-#define VFS_UTIMENS_FD m2_i1 /* int */
-#define VFS_UTIMENS_NAME m2_p1 /* const char * */
-#define VFS_UTIMENS_LEN m2_i1 /* size_t */
-#define VFS_UTIMENS_ATIME m2_l1 /* time_t */
-#define VFS_UTIMENS_ANSEC m2_i2 /* long */
-#define VFS_UTIMENS_MTIME m2_l2 /* time_t */
-#define VFS_UTIMENS_MNSEC m2_i3 /* long */
-#define VFS_UTIMENS_FLAGS m2_s1 /* int */
-
/* Field names for the fsync(2) call. */
#define VFS_FSYNC_FD m1_i1 /* int */
} mess_sigcalls;
_ASSERT_MSG_SIZE(mess_sigcalls);
+typedef struct {
+ time_t atime;
+ time_t mtime;
+ long ansec;
+ long mnsec;
+ size_t len;
+ char *name;
+ int fd;
+ int flags;
+ uint8_t padding[16];
+} mess_vfs_utimens;
+_ASSERT_MSG_SIZE(mess_vfs_utimens);
+
typedef struct {
off_t offset;
dev_t dev;
mess_mmap m_mmap;
mess_notify m_notify;
mess_sigcalls m_sigcalls;
+ mess_vfs_utimens m_vfs_utimens;
mess_vm_vfs_mmap m_vm_vfs_mmap;
mess_vmmcp m_vmmcp;
mess_vmmcp_reply m_vmmcp_reply;
if (tv == NULL) tv = now;
memset(&m, 0, sizeof(m));
- m.VFS_UTIMENS_FD = fd;
- /* For now just truncate to 32bit time_t values. */
- m.VFS_UTIMENS_ATIME = (int32_t)tv[0].tv_sec;
- m.VFS_UTIMENS_MTIME = (int32_t)tv[1].tv_sec;
- m.VFS_UTIMENS_ANSEC = (int32_t)tv[0].tv_nsec;
- m.VFS_UTIMENS_MNSEC = (int32_t)tv[1].tv_nsec;
- m.VFS_UTIMENS_NAME = NULL;
- m.VFS_UTIMENS_FLAGS = 0;
+ m.m_vfs_utimens.fd = fd;
+ m.m_vfs_utimens.atime = tv[0].tv_sec;
+ m.m_vfs_utimens.mtime = tv[1].tv_sec;
+ m.m_vfs_utimens.ansec = tv[0].tv_nsec;
+ m.m_vfs_utimens.mnsec = tv[1].tv_nsec;
+ m.m_vfs_utimens.name = NULL;
+ m.m_vfs_utimens.flags = 0;
return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));
}
message m;
memset(&m, 0, sizeof(m));
- m.VFS_UTIMENS_FD = fd;
+ m.m_vfs_utimens.fd = fd;
if (tv == NULL) {
- m.VFS_UTIMENS_ATIME = m.VFS_UTIMENS_MTIME = 0;
- m.VFS_UTIMENS_ANSEC = m.VFS_UTIMENS_MNSEC = UTIME_NOW;
+ m.m_vfs_utimens.atime = m.m_vfs_utimens.mtime = 0;
+ m.m_vfs_utimens.ansec = m.m_vfs_utimens.mnsec = UTIME_NOW;
}
else {
- m.VFS_UTIMENS_ATIME = (int32_t)tv[0].tv_sec;
- m.VFS_UTIMENS_MTIME = (int32_t)tv[1].tv_sec;
- m.VFS_UTIMENS_ANSEC = (int32_t)tv[0].tv_usec * 1000;
- m.VFS_UTIMENS_MNSEC = (int32_t)tv[1].tv_usec * 1000;
+ m.m_vfs_utimens.atime = tv[0].tv_sec;
+ m.m_vfs_utimens.mtime = tv[1].tv_sec;
+ m.m_vfs_utimens.ansec = tv[0].tv_usec * 1000;
+ m.m_vfs_utimens.mnsec = tv[1].tv_usec * 1000;
}
- m.VFS_UTIMENS_NAME = NULL;
- m.VFS_UTIMENS_FLAGS = 0;
+ m.m_vfs_utimens.name = NULL;
+ m.m_vfs_utimens.flags = 0;
return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));
}
return -1;
}
memset(&m, 0, sizeof(m));
- m.VFS_UTIMENS_FD = strlen(name) + 1;
- m.VFS_UTIMENS_NAME = (char *) __UNCONST(name);
+ m.m_vfs_utimens.len = strlen(name) + 1;
+ m.m_vfs_utimens.name = (char *) __UNCONST(name);
if (tv == NULL) {
- m.VFS_UTIMENS_ATIME = m.VFS_UTIMENS_MTIME = 0;
- m.VFS_UTIMENS_ANSEC = m.VFS_UTIMENS_MNSEC = UTIME_NOW;
+ m.m_vfs_utimens.atime = m.m_vfs_utimens.mtime = 0;
+ m.m_vfs_utimens.ansec = m.m_vfs_utimens.mnsec = UTIME_NOW;
}
else {
- /* For now just truncate time_t values to 32bits. */
- m.VFS_UTIMENS_ATIME = (int32_t)tv[0].tv_sec;
- m.VFS_UTIMENS_MTIME = (int32_t)tv[1].tv_sec;
- m.VFS_UTIMENS_ANSEC = (int32_t)tv[0].tv_usec * 1000;
- m.VFS_UTIMENS_MNSEC = (int32_t)tv[1].tv_usec * 1000;
+ m.m_vfs_utimens.atime = tv[0].tv_sec;
+ m.m_vfs_utimens.mtime = tv[1].tv_sec;
+ m.m_vfs_utimens.ansec = tv[0].tv_usec * 1000;
+ m.m_vfs_utimens.mnsec = tv[1].tv_usec * 1000;
}
- m.VFS_UTIMENS_FLAGS = AT_SYMLINK_NOFOLLOW;
+ m.m_vfs_utimens.flags = AT_SYMLINK_NOFOLLOW;
return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));
}
}
memset(&m, 0, sizeof(m));
- m.VFS_UTIMENS_LEN = strlen(name) + 1;
- m.VFS_UTIMENS_NAME = (char *) __UNCONST(name);
- /* For now just truncate time_t values to 32bits. */
- m.VFS_UTIMENS_ATIME = (int32_t)tv[0].tv_sec;
- m.VFS_UTIMENS_MTIME = (int32_t)tv[1].tv_sec;
- m.VFS_UTIMENS_ANSEC = (int32_t)tv[0].tv_nsec;
- m.VFS_UTIMENS_MNSEC = (int32_t)tv[1].tv_nsec;
- m.VFS_UTIMENS_FLAGS = flags;
+ m.m_vfs_utimens.len = strlen(name) + 1;
+ m.m_vfs_utimens.name = __UNCONST(name);
+ m.m_vfs_utimens.atime = tv[0].tv_sec;
+ m.m_vfs_utimens.mtime = tv[1].tv_sec;
+ m.m_vfs_utimens.ansec = tv[0].tv_nsec;
+ m.m_vfs_utimens.mnsec = tv[1].tv_nsec;
+ m.m_vfs_utimens.flags = flags;
return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));
}
return -1;
}
memset(&m, 0, sizeof(m));
- m.VFS_UTIMENS_LEN = strlen(name) + 1;
- m.VFS_UTIMENS_NAME = (char *) __UNCONST(name);
+ m.m_vfs_utimens.len = strlen(name) + 1;
+ m.m_vfs_utimens.name = __UNCONST(name);
if (tv == NULL) {
- m.VFS_UTIMENS_ATIME = m.VFS_UTIMENS_MTIME = 0;
- m.VFS_UTIMENS_ANSEC = m.VFS_UTIMENS_MNSEC = UTIME_NOW;
+ m.m_vfs_utimens.atime = m.m_vfs_utimens.mtime = 0;
+ m.m_vfs_utimens.ansec = m.m_vfs_utimens.mnsec = UTIME_NOW;
}
else {
- /* For now just truncate time_t values to 32bits. */
- m.VFS_UTIMENS_ATIME = (int32_t)tv[0].tv_sec;
- m.VFS_UTIMENS_MTIME = (int32_t)tv[1].tv_sec;
- m.VFS_UTIMENS_ANSEC = (int32_t)tv[0].tv_usec * 1000;
- m.VFS_UTIMENS_MNSEC = (int32_t)tv[1].tv_usec * 1000;
+ m.m_vfs_utimens.atime = tv[0].tv_sec;
+ m.m_vfs_utimens.mtime = tv[1].tv_sec;
+ m.m_vfs_utimens.ansec = tv[0].tv_usec * 1000;
+ m.m_vfs_utimens.mnsec = tv[1].tv_usec * 1000;
}
- m.VFS_UTIMENS_FLAGS = 0;
+ m.m_vfs_utimens.flags = 0;
return(_syscall(VFS_PROC_NR, VFS_UTIMENS, &m));
}
memset(&now, 0, sizeof(now));
/* The case times==NULL is handled by the caller, replaced with UTIME_NOW */
- actim.tv_sec = job_m_in.VFS_UTIMENS_ATIME;
- actim.tv_nsec = job_m_in.VFS_UTIMENS_ANSEC;
- modtim.tv_sec = job_m_in.VFS_UTIMENS_MTIME;
- modtim.tv_nsec = job_m_in.VFS_UTIMENS_MNSEC;
+ actim.tv_sec = job_m_in.m_vfs_utimens.atime;
+ actim.tv_nsec = job_m_in.m_vfs_utimens.ansec;
+ modtim.tv_sec = job_m_in.m_vfs_utimens.mtime;
+ modtim.tv_nsec = job_m_in.m_vfs_utimens.mnsec;
- if (job_m_in.VFS_UTIMENS_NAME != NULL) {
+ if (job_m_in.m_vfs_utimens.name != NULL) {
kind = UTIMENS_STYLE;
- if (job_m_in.VFS_UTIMENS_FLAGS & ~AT_SYMLINK_NOFOLLOW)
+ if (job_m_in.m_vfs_utimens.flags & ~AT_SYMLINK_NOFOLLOW)
return EINVAL; /* unknown flag */
/* Temporarily open the file */
- vname = (vir_bytes) job_m_in.VFS_UTIMENS_NAME;
- vname_length = (size_t) job_m_in.VFS_UTIMENS_LEN;
- if (job_m_in.VFS_UTIMENS_FLAGS & AT_SYMLINK_NOFOLLOW)
+ vname = (vir_bytes) job_m_in.m_vfs_utimens.name;
+ vname_length = (size_t) job_m_in.m_vfs_utimens.len;
+ if (job_m_in.m_vfs_utimens.flags & AT_SYMLINK_NOFOLLOW)
lookup_flags = PATH_RET_SYMLINK;
else
lookup_flags = PATH_NOFLAGS;
else {
kind = FUTIMENS_STYLE;
/* Change timestamps on already-opened fd. Is it valid? */
- if (job_m_in.VFS_UTIMENS_FLAGS != 0)
+ if (job_m_in.m_vfs_utimens.flags != 0)
return EINVAL; /* unknown flag */
- if ((filp = get_filp(job_m_in.VFS_UTIMENS_FD, VNODE_READ)) == NULL)
+ if ((filp = get_filp(job_m_in.m_vfs_utimens.fd, VNODE_READ)) == NULL)
return err_code;
vp = filp->filp_vno;
}