mirror of
https://github.com/drasko/codezero.git
synced 2026-01-30 11:43:13 +01:00
A file can be created.
Now up to sys_write() in pager, which needs to be filled in.
This commit is contained in:
@@ -113,8 +113,10 @@ int sys_open(l4id_t sender, const char *pathname, int flags, unsigned int mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Creating new node, file or directory */
|
||||
/* Creating new file */
|
||||
if (flags & O_CREAT) {
|
||||
/* Make sure mode identifies a file */
|
||||
mode |= S_IFREG;
|
||||
if (IS_ERR(v = vfs_create(task, pdata, mode))) {
|
||||
retval = (int)v;
|
||||
goto out;
|
||||
@@ -182,6 +184,9 @@ int sys_mkdir(l4id_t sender, const char *pathname, unsigned int mode)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Make sure we create a directory */
|
||||
mode |= S_IFDIR;
|
||||
|
||||
/* Create the directory or fail */
|
||||
if (IS_ERR(v = vfs_create(task, pdata, mode)))
|
||||
l4_ipc_return((int)v);
|
||||
|
||||
Reference in New Issue
Block a user