[libc-commits] [libc] [libc][POSIX][pthreads] implement pthread_condattr_t functions (PR #88987)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Tue Apr 16 15:03:34 PDT 2024


================
@@ -0,0 +1,18 @@
+//===-- Definition of pthread_condattr_t type -----------------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
+#ifndef LLVM_LIBC_TYPES_PTHREAD_CONDATTR_T_H
+#define LLVM_LIBC_TYPES_PTHREAD_CONDATTR_T_H
+
+#include "clockid_t.h"
+
+typedef struct {
+  clockid_t clock;
+  int pshared;
+} pthread_condattr_t;
----------------
nickdesaulniers wrote:

For a publicly consumable header (anything under include/) we cannot use C++ only language features such as `enum class` or C23 enum with underlying type.

> if it's necessary/useful.

Looking at how complex ADT/BitFields.h, I don't feel that it's useful enough here to justify porting that to llvm-libc.

I don't think optimizing `pthread_condattr_t` for size is really all that important TBH.

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


More information about the libc-commits mailing list