From bba1a160f9cf5f5eaaf78987f1d8f40ef5e5fef9 Mon Sep 17 00:00:00 2001 From: "Michael I. Bushnell" Date: Mon, 11 Jul 1994 18:53:23 +0000 Subject: Initial revision --- libtrivfs/times.c | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 libtrivfs/times.c (limited to 'libtrivfs') 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); +} + + + + -- cgit v1.2.3