forked from Stichting-MINIX-Research-Foundation/minix
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmisc.c
More file actions
28 lines (23 loc) · 988 Bytes
/
Copy pathmisc.c
File metadata and controls
28 lines (23 loc) · 988 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include "fs.h"
#include "inode.h"
/*===========================================================================*
* fs_sync *
*===========================================================================*/
int fs_sync(message *fs_m_in, message *fs_m_out)
{
/* Perform the sync() system call. No-op on this FS. */
return(OK); /* sync() can't fail */
}
/*===========================================================================*
* fs_chmod *
*===========================================================================*/
int fs_chmod(message *fs_m_in, message *fs_m_out)
{
struct inode *rip; /* target inode */
mode_t mode = fs_m_in->m_vfs_fs_chmod.mode;
if( (rip = find_inode(fs_m_in->m_vfs_fs_chmod.inode)) == NULL) return(EINVAL);
get_inode(rip->i_dev, rip->i_num); /* mark inode in use */
rip->i_mode = (rip->i_mode & ~ALL_MODES) | (mode & ALL_MODES);
put_inode(rip); /* release the inode */
return OK;
}