diff options
author | Michael I. Bushnell <mib@gnu.org> | 1994-01-31 20:12:13 +0000 |
---|---|---|
committer | Michael I. Bushnell <mib@gnu.org> | 1994-01-31 20:12:13 +0000 |
commit | 95e006ea62fc4848cf5a0f6b3f46d347807a2c70 (patch) | |
tree | 3290b4020e984923640c6e93880039fdba39a07c /libdiskfs | |
parent | df4395dd4a7103b44d3f72dcde78f668afba700c (diff) |
Formerly file-utimes.c.~2~
Diffstat (limited to 'libdiskfs')
-rw-r--r-- | libdiskfs/file-utimes.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/libdiskfs/file-utimes.c b/libdiskfs/file-utimes.c new file mode 100644 index 00000000..3952a266 --- /dev/null +++ b/libdiskfs/file-utimes.c @@ -0,0 +1,35 @@ +/* libdiskfs implementation of fs.defs: file_utimes + Copyright (C) 1992, 1993, 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. */ + +#include "priv.h" + +/* Implement file_utimes as described in <hurd/fs.defs>. */ +error_t +diskfs_S_file_utimes (struct protid *cred, + time_value_t atime, + time_value_t mtime) +{ + CHANGE_NODE_FIELD (cred, + ({ + if (!(err = isowner (np, cred))) + { + np->dn_stat.st_atime = atime.seconds; + np->dn_stat.st_mtime = mtime.seconds; + np->dn_stat.st_ctime = wallclock->seconds; + } + })); +} |