[libc-commits] [libc] [libc] Implement futimens (PR #222251)
Anirudh Mathur via libc-commits
libc-commits at lists.llvm.org
Thu Sep 10 00:07:56 PDT 2026
================
@@ -0,0 +1,136 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+///
+/// \file
+/// Unittests for futimens.
+///
+//===----------------------------------------------------------------------===//
+
+#include "hdr/fcntl_macros.h"
+#include "hdr/sys_stat_macros.h"
+#include "hdr/types/struct_timespec.h"
+#include "src/fcntl/open.h"
+#include "src/stdio/remove.h"
+#include "src/sys/stat/futimens.h"
+#include "src/sys/stat/stat.h"
+#include "src/unistd/close.h"
+
+#include "test/UnitTest/ErrnoCheckingTest.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
+#include "test/UnitTest/Test.h"
+
+using LlvmLibcFutimensTest = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
+// SUCCESS: Takes an open file descriptor and successfully updates
+// its last access and modified times.
+TEST_F(LlvmLibcFutimensTest, ChangeTimesSpecific) {
+ using LIBC_NAMESPACE::testing::ErrnoSetterMatcher::Succeeds;
----------------
AnirudhMathur12 wrote:
Done.
https://github.com/llvm/llvm-project/pull/222251
More information about the libc-commits
mailing list