@@ -388,7 +388,6 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path,
const struct timespec *buf)
{
int ret;
-#ifdef CONFIG_UTIMENSAT
int fd;
struct handle_data *data = (struct handle_data *)ctx->private;
@@ -396,12 +395,8 @@ static int handle_utimensat(FsContext *ctx, V9fsPath *fs_path,
if (fd < 0) {
return fd;
}
- ret = futimens(fd, buf);
+ ret = qemu_futimens(fd, buf);
close(fd);
-#else
- ret = -1;
- errno = ENOSYS;
-#endif
return ret;
}
@@ -57,6 +57,7 @@ typedef struct timeval qemu_timeval;
#endif
typedef struct timespec qemu_timespec;
int qemu_utimens(const char *path, const qemu_timespec *times);
+int qemu_futimens(int fd, const qemu_timespec *times);
bool is_daemonized(void);
@@ -187,6 +187,16 @@ int qemu_pipe(int pipefd[2])
return ret;
}
+int qemu_futimens(int fd, const struct timespec *times)
+{
+#ifdef CONFIG_UTIMENSAT
+ return futimens(fd, times);
+#else
+ errno = ENOSYS;
+ return -1;
+#endif
+}
+
int qemu_utimens(const char *path, const struct timespec *times)
{
struct timeval tv[2], tv_now;
Signed-off-by: Greg Kurz <groug@kaod.org> --- hw/9pfs/9p-handle.c | 7 +------ include/sysemu/os-posix.h | 1 + util/oslib-posix.c | 10 ++++++++++ 3 files changed, 12 insertions(+), 6 deletions(-)