#define NR_VFS_CALLS 49 /* highest number from base plus one */
-/* 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 * */
-#define VFS_TRUNCATE_LEN m2_i1 /* size_t */
-#define VFS_TRUNCATE_OFF m2_ll1 /* off_t */
-
/* Field names for the pipe2(2) call. */
#define VFS_PIPE2_FD0 m1_i1 /* int */
#define VFS_PIPE2_FD1 m1_i2 /* int */
} mess_lc_vfs_statvfs1;
_ASSERT_MSG_SIZE(mess_lc_vfs_statvfs1);
+typedef struct {
+ off_t offset;
+
+ int fd;
+ vir_bytes name;
+ size_t len;
+
+ uint8_t padding[36];
+} mess_lc_vfs_truncate;
+_ASSERT_MSG_SIZE(mess_lc_vfs_truncate);
+
typedef struct {
vir_bytes name;
size_t namelen;
mess_lc_vfs_mount m_lc_vfs_mount;
mess_lc_vfs_select m_lc_vfs_select;
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
+ mess_lc_vfs_truncate m_lc_vfs_truncate;
mess_lc_vfs_umount m_lc_vfs_umount;
mess_lsys_vfs_checkperms m_lsys_vfs_checkperms;
message m;
memset(&m, 0, sizeof(m));
- m.VFS_TRUNCATE_OFF = _length;
- m.VFS_TRUNCATE_FD = _fd;
+ m.m_lc_vfs_truncate.offset = _length;
+ m.m_lc_vfs_truncate.fd = _fd;
return(_syscall(VFS_PROC_NR, VFS_FTRUNCATE, &m));
}
message m;
memset(&m, 0, sizeof(m));
- m.VFS_TRUNCATE_NAME = (char *) __UNCONST(_path);
- m.VFS_TRUNCATE_LEN = strlen(_path)+1;
- m.VFS_TRUNCATE_OFF = _length;
+ m.m_lc_vfs_truncate.name = (vir_bytes)_path;
+ m.m_lc_vfs_truncate.len = strlen(_path)+1;
+ m.m_lc_vfs_truncate.offset = _length;
return(_syscall(VFS_PROC_NR, VFS_TRUNCATE, &m));
}
vir_bytes vname;
size_t vname_length;
- vname = (vir_bytes) job_m_in.VFS_TRUNCATE_NAME;
- vname_length = job_m_in.VFS_TRUNCATE_LEN;
+ vname = job_m_in.m_lc_vfs_truncate.name;
+ vname_length = job_m_in.m_lc_vfs_truncate.len;
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp, &vp);
resolve.l_vmnt_lock = VMNT_READ;
resolve.l_vnode_lock = VNODE_WRITE;
- length = (off_t) job_m_in.VFS_TRUNCATE_OFF;
+ length = job_m_in.m_lc_vfs_truncate.offset;
if (length < 0) return(EINVAL);
/* Temporarily open file */
int r;
off_t length;
- scratch(fp).file.fd_nr = job_m_in.VFS_TRUNCATE_FD;
+ scratch(fp).file.fd_nr = job_m_in.m_lc_vfs_truncate.fd;
- length = (off_t) job_m_in.VFS_TRUNCATE_OFF;
+ length = job_m_in.m_lc_vfs_truncate.offset;
if (length < 0) return(EINVAL);
/* File is already opened; get a vnode pointer from filp */