fix packman sort col, and make sort case-insensitive
[minix3.git] / servers / vfs / time.c
blob806fee9a24e6b99c5106b75376934272c4b6a19c
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
6 */
8 #include "fs.h"
9 #include <minix/callnr.h>
10 #include <minix/com.h>
11 #include "file.h"
12 #include "fproc.h"
13 #include "param.h"
15 #include <minix/vfsif.h>
16 #include "vmnt.h"
18 /*===========================================================================*
19 * do_utime *
20 *===========================================================================*/
21 PUBLIC int do_utime()
23 /* Perform the utime(name, timep) system call. */
24 register int len;
25 struct utime_req req;
26 struct lookup_req lookup_req;
27 struct node_details res;
28 int r;
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;
43 /* Request lookup */
44 if ((r = lookup(&lookup_req, &res)) != OK) return r;
46 /* Fill in request fields.*/
47 if (m_in.utime_length == 0) {
48 req.actime = 0;
49 req.modtime = clock_time();
50 } else {
51 req.actime = m_in.utime_actime;
52 req.modtime = m_in.utime_modtime;
54 req.fs_e = res.fs_e;
55 req.inode_nr = res.inode_nr;
56 req.uid = fp->fp_effuid;
57 req.gid = fp->fp_effgid;
59 /* Issue request */
60 return req_utime(&req);
64 /*===========================================================================*
65 * do_stime *
66 *===========================================================================*/
67 PUBLIC int do_stime()
69 struct vmnt *vmp;
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);
78 return OK;