A include/npe/utime.h => include/npe/utime.h +13 -0
@@ 0,0 1,13 @@
+#ifndef _npe_utime_h_
+#define _npe_utime_h_
+
+#include <time.h>
+
+struct utimbuf{
+ time_t actime;
+ time_t modtime;
+};
+
+int utime(const char *path, const struct utimbuf *times);
+
+#endif
M libnpe/mkfile => libnpe/mkfile +1 -0
@@ 50,6 50,7 @@ OFILES=\
trunc.$O\
unlink.$O\
usleep.$O\
+ utime.$O\
UPDATE=\
mkfile\
A libnpe/utime.c => libnpe/utime.c +16 -0
@@ 0,0 1,16 @@
+#include <utime.h>
+
+int
+utime(const char *path, const struct utimbuf *times)
+{
+ Dir d;
+
+ nulldir(&d);
+ if(times == nil)
+ d.atime = d.mtime = time(nil);
+ else{
+ d.atime = times->actime;
+ d.mtime = times->modtime;
+ }
+ return dirwstat(path, &d);
+}