[libc-commits] [libc] [libc] Implement getitimer and setitimer, add proxy headers for itimerval (PR #134773)
Michael Jones via libc-commits
libc-commits at lists.llvm.org
Wed Apr 9 13:27:54 PDT 2025
================
@@ -0,0 +1,32 @@
+//===-- Unittests for getitimer -------------------------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+
+#include "hdr/types/struct_itimerval.h"
+#include "src/sys/time/getitimer.h"
+#include "test/UnitTest/ErrnoSetterMatcher.h"
+#include "test/UnitTest/Test.h"
+#include <sys/time.h>
+
+using namespace LIBC_NAMESPACE::testing::ErrnoSetterMatcher;
+
+TEST(LlvmLibcSysTimeGetitimerTest, SmokeTest) {
----------------
michaelrj-google wrote:
We're moving tests that rely on errno to a new framework, which you can see an example of in the [`epoll_pwait_test.cpp`](https://github.com/llvm/llvm-project/blob/main/libc/test/src/sys/epoll/linux/epoll_pwait_test.cpp#L22). You should just need to add the `using` and change to `TEST_F` for both tests.
https://github.com/llvm/llvm-project/pull/134773
More information about the libc-commits
mailing list