5 #include <minix/callnr.h>
9 #include <minix/vfsif.h>
12 /*===========================================================================*
14 *===========================================================================*/
17 register struct inode
*rip
;
20 caller_uid
= fs_m_in
.REQ_UID
;
21 caller_gid
= fs_m_in
.REQ_GID
;
23 /* Temporarily open the file. */
24 if ( (rip
= get_inode(fs_dev
, fs_m_in
.REQ_INODE_NR
)) == NIL_INODE
) {
25 printf("MFS(%d) get_inode by fs_utime() failed\n", SELF_E
);
29 /* Only the owner of a file or the super_user can change its time. */
31 if (rip
->i_uid
!= caller_uid
&& caller_uid
!= SU_UID
) r
= EPERM
;
32 if (fs_m_in
.REQ_ACTIME
== 0 && r
!= OK
) r
= forbidden(rip
, W_BIT
);
33 if (read_only(rip
) != OK
) r
= EROFS
; /* not even su can touch if R/O */
35 if (fs_m_in
.REQ_ACTIME
== 0) {
36 rip
->i_atime
= fs_m_in
.REQ_MODTIME
;
37 rip
->i_mtime
= rip
->i_atime
;
39 rip
->i_atime
= fs_m_in
.REQ_ACTIME
;
40 rip
->i_mtime
= fs_m_in
.REQ_MODTIME
;
42 rip
->i_update
= CTIME
; /* discard any stale ATIME and MTIME flags */
52 boottime
= fs_m_in
.REQ_BOOTTIME
;
53 printf("MFS(%d) boottime: %d\n", SELF_E
, boottime
);