Message type for path related calls.

- Updated system calls VFS_ACCESS, VFS_CHDIR, VFS_CHMOD, VFS_CHROOT,
                        VFS_MKDIR, VFS_OPEN, VFS_RMDIR, VSF_UNLINK

 - Removed M3_STRING and M3_LONG_STRING, which are tied to a specific
   "generic" message, and replaced where needed with M_PATH_STRING_MAX,
   which is tied to the mess_lc_vfs_path message.

Change-Id: If287c74f5ece937b9431e5d95b5b58a3c83ebff1
This commit is contained in:
2014-05-12 16:30:43 +02:00
parent 96b3577b2c
commit cef3ce969a
12 changed files with 29 additions and 29 deletions

View File

@@ -12,7 +12,7 @@ int mode;
message m;
memset(&m, 0, sizeof(m));
m.VFS_PATH_MODE = mode;
m.m_lc_vfs_path.mode = mode;
_loadname(name, &m);
return(_syscall(VFS_PROC_NR, VFS_ACCESS, &m));
}

View File

@@ -10,7 +10,7 @@ int chmod(const char *name, mode_t mode)
message m;
memset(&m, 0, sizeof(m));
m.VFS_PATH_MODE = mode;
m.m_lc_vfs_path.mode = mode;
_loadname(name, &m);
return(_syscall(VFS_PROC_NR, VFS_CHMOD, &m));
}

View File

@@ -13,7 +13,7 @@ void _loadname(const char *name, message *msgptr)
register size_t k;
k = strlen(name) + 1;
msgptr->VFS_PATH_LEN = k;
msgptr->VFS_PATH_NAME = (char *) __UNCONST(name);
if (k <= M3_STRING) strcpy(msgptr->VFS_PATH_BUF, name);
msgptr->m_lc_vfs_path.len = k;
msgptr->m_lc_vfs_path.name = (vir_bytes)name;
if (k <= M_PATH_STRING_MAX) strcpy(msgptr->m_lc_vfs_path.buf, name);
}

View File

@@ -10,7 +10,7 @@ int mkdir(const char *name, mode_t mode)
message m;
memset(&m, 0, sizeof(m));
m.VFS_PATH_MODE = mode;
m.m_lc_vfs_path.mode = mode;
_loadname(name, &m);
return(_syscall(VFS_PROC_NR, VFS_MKDIR, &m));
}

View File

@@ -25,7 +25,7 @@ int open(const char *name, int flags, ...)
call = VFS_CREAT;
} else {
_loadname(name, &m);
m.VFS_PATH_FLAGS = flags;
m.m_lc_vfs_path.flags = flags;
call = VFS_OPEN;
}
va_end(argp);

View File

@@ -132,7 +132,7 @@ int usb_init(char *name)
msg.m_type = USB_RQ_INIT;
strncpy(msg.USB_RB_INIT_NAME, name, M3_LONG_STRING);
strncpy(msg.USB_RB_INIT_NAME, name, M_PATH_STRING_MAX);
res = ipc_sendrec(hcd_ep, &msg);