summaryrefslogtreecommitdiff
path: root/libtrivfs/times.c
diff options
context:
space:
mode:
authorMichael I. Bushnell <mib@gnu.org>1994-07-11 18:53:23 +0000
committerMichael I. Bushnell <mib@gnu.org>1994-07-11 18:53:23 +0000
commitbba1a160f9cf5f5eaaf78987f1d8f40ef5e5fef9 (patch)
tree1335be17020547a48ba38b0ec80ec77c3b78de98 /libtrivfs/times.c
parentfdb00095f0ee4865f096ed5e067574047d580da9 (diff)
Initial revision
Diffstat (limited to 'libtrivfs/times.c')
-rw-r--r--libtrivfs/times.c49
1 files changed, 49 insertions, 0 deletions
diff --git a/libtrivfs/times.c b/libtrivfs/times.c
new file mode 100644
index 00000000..cab0e28c
--- /dev/null
+++ b/libtrivfs/times.c
@@ -0,0 +1,49 @@
+/*
+ Copyright (C) 1994 Free Software Foundation
+
+ This program is free software; you can redistribute it and/or
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 2, or (at
+ your option) any later version.
+
+ This program is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+void
+trivfs_set_atime (struct trivfs_control *cntl)
+{
+ struct stat st;
+ time_value_t atime;
+ time_value_t mtime;
+
+ io_stat (cntl->realnode, &st);
+ mtime.seconds = st.st_mtime;
+ mtime.microseconds = st.st_mtime_usec;
+ host_get_time (mach_host_self (), &atime);
+ file_utimes (cntl->realnode, atime, mtime);
+}
+
+void
+trivfs_set_mtime (struct trivfs_control *cntl)
+{
+ struct stat st;
+ time_value_t atime;
+ time_value_t mtime;
+
+ io_stat (cntl->realnode, &st);
+ atime.seconds = st.st_atime;
+ atime.microseconds = st.st_atime_usec;
+ host_get_time (mach_host_self (), &mtime);
+ file_utimes (cntl->realnode, atime, mtime);
+}
+
+
+
+