[libc-commits] [libc] [libc][POSIX] Add clock_settime() function for Linux (PR #161729)

Anton Shepelev via libc-commits libc-commits at lists.llvm.org
Fri Oct 3 13:31:24 PDT 2025


================
@@ -0,0 +1,31 @@
+//===-- Unittests for clock_settime ---------------------------------------===//
+//
+// 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/time_macros.h"
+#include "hdr/types/struct_timespec.h"
+#include "src/time/clock_settime.h"
+#include "test/UnitTest/ErrnoCheckingTest.h"
+#include "test/UnitTest/Test.h"
+
+using LlvmLibcClockSetTime = LIBC_NAMESPACE::testing::ErrnoCheckingTest;
+
----------------
amemov wrote:

Yes, but the problem with that is that it would require the user the user to run the test as privileged user (through `sudo` or as `root`). 

That's the question that I mentioned above, and I'm not exactly sure how to ensure that when some unprivileged user runs it, they would be able to run the test successfully. 

https://github.com/llvm/llvm-project/pull/161729


More information about the libc-commits mailing list