1 /* This file takes care of those system calls that deal with time.
3 * The entry points into this file are
4 * do_utime: perform the UTIME system call
5 * do_stime: PM informs FS about STIME system call
9 #include <minix/callnr.h>
10 #include <minix/com.h>
15 #include <minix/vfsif.h>
18 /*===========================================================================*
20 *===========================================================================*/
23 /* Perform the utime(name, timep) system call. */
26 struct lookup_req lookup_req
;
27 struct node_details res
;
30 /* Adjust for case of 'timep' being NULL;
31 * utime_strlen then holds the actual size: strlen(name)+1.
33 len
= m_in
.utime_length
;
34 if (len
== 0) len
= m_in
.utime_strlen
;
36 if (fetch_name(m_in
.utime_file
, len
, M1
) != OK
) return(err_code
);
38 /* Fill in lookup request fields */
39 lookup_req
.path
= user_fullpath
;
40 lookup_req
.lastc
= NULL
;
41 lookup_req
.flags
= EAT_PATH
;
44 if ((r
= lookup(&lookup_req
, &res
)) != OK
) return r
;
46 /* Fill in request fields.*/
47 if (m_in
.utime_length
== 0) {
49 req
.modtime
= clock_time();
51 req
.actime
= m_in
.utime_actime
;
52 req
.modtime
= m_in
.utime_modtime
;
55 req
.inode_nr
= res
.inode_nr
;
56 req
.uid
= fp
->fp_effuid
;
57 req
.gid
= fp
->fp_effgid
;
60 return req_utime(&req
);
64 /*===========================================================================*
66 *===========================================================================*/
70 /* Perform the stime(tp) system call. */
71 boottime
= (long) m_in
.pm_stime
;
73 /* Send new time for all FS processes */
74 for (vmp
= &vmnt
[0]; vmp
< &vmnt
[NR_MNTS
]; ++vmp
) {
75 if (vmp
->m_fs_e
) req_stime(vmp
->m_fs_e
, boottime
);