#include <time.h>
-#ifdef _BSD_SOURCE
typedef unsigned long suseconds_t;
suseconds_t tv_usec;
};
+extern int utimes(const char *filename, const struct timeval times[2]);
+
+#ifdef _BSD_SOURCE
+
extern int gettimeofday(struct timeval *tv, struct timezone *tz);
extern int settimeofday(struct timeval *tv, const struct timezone *tz);
SRC_C += strcasecmp.c strdup.c stricmp.c strlcpy.c strncasecmp.c
SRC_C += strnicmp.c strsep.c
SRC_C += strtod.c strtol.c system.c time.c tmpnam.c ttyname.c
-SRC_C += tzset.c ungetc.c utent.c utsname.c
+SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
SRC_C += gethostname.c sysconf.c confstr.c memccpy.c getpass.c
# tty layer
--- /dev/null
+/*
+ * Fake utimes with utime. Our fs resolution is 1 second so its fine
+ */
+
+#include <sys/time.h>
+#include <utime.h>
+
+int utimes(const char *filename, const struct timeval times[2])
+{
+ struct utimbuf u;
+ if (times == NULL)
+ return utime(filename, NULL);
+ u.actime = times[0].tv_sec;
+ u.modtime = times[0].tv_usec;
+ return utime(filename, &u);
+}
\ No newline at end of file