[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 08:52:21 PDT 2025


================
@@ -0,0 +1,30 @@
+//===---------- Linux implementation of the POSIX clock_settime function --===//
+//
+// 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 "src/time/clock_settime.h"
+#include "src/__support/common.h"
+#include "src/__support/libc_errno.h"
+#include "src/__support/macros/config.h"
+#include "src/__support/time/clock_settime.h"
+
+namespace LIBC_NAMESPACE_DECL {
+
+LLVM_LIBC_FUNCTION(int, clock_settime,
+                   (clockid_t clockid, const struct timespec *ts)) {
----------------
amemov wrote:

I mean technically you're right - I wrote it like that to be consistent with other implementation files in that folder, since all of them in parameters say `struct` keyword

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


More information about the libc-commits mailing list