1 // Copyright (c) 2015-2016 Nuxi, https://nuxi.nl/
3 // SPDX-License-Identifier: BSD-2-Clause
10 #include "stat_impl.h"
12 int futimens(int fd
, const struct timespec
*times
) {
13 // Convert timestamps and extract NOW/OMIT flags.
14 __wasi_timestamp_t st_atim
;
15 __wasi_timestamp_t st_mtim
;
16 __wasi_fstflags_t flags
;
17 if (!utimens_get_timestamps(times
, &st_atim
, &st_mtim
, &flags
)) {
22 // Perform system call.
23 __wasi_errno_t error
= __wasi_fd_filestat_set_times(fd
, st_atim
, st_mtim
, flags
);