#define NR_VFS_CALLS 49 /* highest number from base plus one */
-/* Field names for the readlink(2) call. */
-#define VFS_READLINK_NAME m1_p1 /* const char * */
-#define VFS_READLINK_NAMELEN m1_i1 /* size_t */
-#define VFS_READLINK_BUF m1_p2 /* char * */
-#define VFS_READLINK_BUFSIZE m1_i2 /* size_t */
-
/* Field names for the stat(2) and lstat(2) calls. */
#define VFS_STAT_NAME m1_p1 /* const char * */
#define VFS_STAT_LEN m1_i1 /* size_t */
} mess_lc_vfs_pipe2;
_ASSERT_MSG_SIZE(mess_lc_vfs_pipe2);
+typedef struct {
+ vir_bytes name; /* const char * */
+ size_t namelen;
+ vir_bytes buf;
+ size_t bufsize;
+
+ uint8_t padding[40];
+} mess_lc_vfs_readlink;
+_ASSERT_MSG_SIZE(mess_lc_vfs_readlink);
+
typedef struct {
uint32_t nfds;
fd_set *readfds;
mess_lc_vfs_lseek m_lc_vfs_lseek;
mess_lc_vfs_mount m_lc_vfs_mount;
mess_lc_vfs_pipe2 m_lc_vfs_pipe2;
+ mess_lc_vfs_readlink m_lc_vfs_readlink;
mess_lc_vfs_select m_lc_vfs_select;
mess_lc_vfs_statvfs1 m_lc_vfs_statvfs1;
mess_lc_vfs_truncate m_lc_vfs_truncate;
message m;
memset(&m, 0, sizeof(m));
- m.VFS_READLINK_NAMELEN = strlen(name) + 1;
- m.VFS_READLINK_BUFSIZE = bufsiz;
- m.VFS_READLINK_NAME = (char *) __UNCONST(name);
- m.VFS_READLINK_BUF = (char *) buffer;
+ m.m_lc_vfs_readlink.namelen = strlen(name) + 1;
+ m.m_lc_vfs_readlink.bufsize = bufsiz;
+ m.m_lc_vfs_readlink.name = (vir_bytes)name;
+ m.m_lc_vfs_readlink.buf = (vir_bytes)buffer;
return(_syscall(VFS_PROC_NR, VFS_READLINK, &m));
}
size_t vname_length, buf_size;
vir_bytes buf;
- vname = (vir_bytes) job_m_in.VFS_READLINK_NAME;
- vname_length = job_m_in.VFS_READLINK_NAMELEN;
- buf = (vir_bytes) job_m_in.VFS_READLINK_BUF;
- buf_size = (size_t) job_m_in.VFS_READLINK_BUFSIZE;
+ vname = job_m_in.m_lc_vfs_readlink.name;
+ vname_length = job_m_in.m_lc_vfs_readlink.namelen;
+ buf = job_m_in.m_lc_vfs_readlink.buf;
+ buf_size = job_m_in.m_lc_vfs_readlink.bufsize;
if (buf_size > SSIZE_MAX) return(EINVAL);
lookup_init(&resolve, fullpath, PATH_RET_SYMLINK, &vmp, &vp);