#define NR_VFS_CALLS 49 /* highest number from base plus one */
-/* Field names for the link(2), symlink(2), and rename(2) call. */
-#define VFS_LINK_NAME1 m1_p1 /* const char * */
-#define VFS_LINK_LEN1 m1_i1 /* size_t */
-#define VFS_LINK_NAME2 m1_p2 /* const char * */
-#define VFS_LINK_LEN2 m1_i2 /* size_t */
-
/* Field names for the readlink(2) call. */
#define VFS_READLINK_NAME m1_p1 /* const char * */
#define VFS_READLINK_NAMELEN m1_i1 /* size_t */
} mess_lc_vfs_ioctl;
_ASSERT_MSG_SIZE(mess_lc_vfs_ioctl);
+typedef struct {
+ vir_bytes name1;
+ vir_bytes name2;
+ size_t len1;
+ size_t len2;
+
+ uint8_t padding[40];
+} mess_lc_vfs_link;
+_ASSERT_MSG_SIZE(mess_lc_vfs_link);
+
typedef struct {
off_t offset;
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_link m_lc_vfs_link;
mess_lc_vfs_lseek m_lc_vfs_lseek;
mess_lc_vfs_mount m_lc_vfs_mount;
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
message m;
memset(&m, 0, sizeof(m));
- m.VFS_LINK_LEN1 = strlen(name) + 1;
- m.VFS_LINK_LEN2 = strlen(name2) + 1;
- m.VFS_LINK_NAME1 = (char *) __UNCONST(name);
- m.VFS_LINK_NAME2 = (char *) __UNCONST(name2);
+ m.m_lc_vfs_link.len1 = strlen(name) + 1;
+ m.m_lc_vfs_link.len2 = strlen(name2) + 1;
+ m.m_lc_vfs_link.name1 = (vir_bytes)name;
+ m.m_lc_vfs_link.name2 = (vir_bytes)name2;
return(_syscall(VFS_PROC_NR, VFS_LINK, &m));
}
message m;
memset(&m, 0, sizeof(m));
- m.VFS_LINK_LEN1 = strlen(name) + 1;
- m.VFS_LINK_LEN2 = strlen(name2) + 1;
- m.VFS_LINK_NAME1 = (char *) __UNCONST(name);
- m.VFS_LINK_NAME2 = (char *) __UNCONST(name2);
+ m.m_lc_vfs_link.len1 = strlen(name) + 1;
+ m.m_lc_vfs_link.len2 = strlen(name2) + 1;
+ m.m_lc_vfs_link.name1 = (vir_bytes)name;
+ m.m_lc_vfs_link.name2 = (vir_bytes)name2;
return(_syscall(VFS_PROC_NR, VFS_RENAME, &m));
}
message m;
memset(&m, 0, sizeof(m));
- m.VFS_LINK_LEN1 = strlen(name) + 1;
- m.VFS_LINK_LEN2 = strlen(name2) + 1;
- m.VFS_LINK_NAME1 = (char *) __UNCONST(name);
- m.VFS_LINK_NAME2 = (char *) __UNCONST(name2);
+ m.m_lc_vfs_link.len1 = strlen(name) + 1;
+ m.m_lc_vfs_link.len2 = strlen(name2) + 1;
+ m.m_lc_vfs_link.name1 = (vir_bytes)name;
+ m.m_lc_vfs_link.name2 = (vir_bytes)name2;
return(_syscall(VFS_PROC_NR, VFS_SYMLINK, &m));
}
vir_bytes vname1, vname2;
size_t vname1_length, vname2_length;
- vname1 = (vir_bytes) job_m_in.VFS_LINK_NAME1;
- vname1_length = job_m_in.VFS_LINK_LEN1;
- vname2 = (vir_bytes) job_m_in.VFS_LINK_NAME2;
- vname2_length = job_m_in.VFS_LINK_LEN2;
+ vname1 = job_m_in.m_lc_vfs_link.name1;
+ vname1_length = job_m_in.m_lc_vfs_link.len1;
+ vname2 = job_m_in.m_lc_vfs_link.name2;
+ vname2_length = job_m_in.m_lc_vfs_link.len2;
lookup_init(&resolve, fullpath, PATH_NOFLAGS, &vmp1, &vp);
resolve.l_vmnt_lock = VMNT_WRITE;
vir_bytes vname1, vname2;
size_t vname1_length, vname2_length;
- vname1 = (vir_bytes) job_m_in.VFS_LINK_NAME1;
- vname1_length = job_m_in.VFS_LINK_LEN1;
- vname2 = (vir_bytes) job_m_in.VFS_LINK_NAME2;
- vname2_length = job_m_in.VFS_LINK_LEN2;
+ vname1 = job_m_in.m_lc_vfs_link.name1;
+ vname1_length = job_m_in.m_lc_vfs_link.len1;
+ vname2 = job_m_in.m_lc_vfs_link.name2;
+ vname2_length = job_m_in.m_lc_vfs_link.len2;
lookup_init(&resolve, fullpath, PATH_RET_SYMLINK, &oldvmp, &old_dirp);
/* Do not yet request exclusive lock on vmnt to prevent deadlocks later on */
resolve.l_vmnt_lock = VMNT_WRITE;
resolve.l_vnode_lock = VNODE_WRITE;
- vname1 = (vir_bytes) job_m_in.VFS_LINK_NAME1;
- vname1_length = job_m_in.VFS_LINK_LEN1;
- vname2 = (vir_bytes) job_m_in.VFS_LINK_NAME2;
- vname2_length = job_m_in.VFS_LINK_LEN2;
+ vname1 = job_m_in.m_lc_vfs_link.name1;
+ vname1_length = job_m_in.m_lc_vfs_link.len1;
+ vname2 = job_m_in.m_lc_vfs_link.name2;
+ vname2_length = job_m_in.m_lc_vfs_link.len2;
if (vname1_length <= 1) return(ENOENT);
if (vname1_length >= _POSIX_SYMLINK_MAX) return(ENAMETOOLONG);