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

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Apr 16 14:38:53 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;
----------------
michaelrj-google wrote:

For bitfields we usually use enums (e.g. https://github.com/llvm/llvm-project/blob/main/libc/src/stdio/printf_core/core_structs.h#L34)
As for `ADT/BitFields.h` we could potentially create a version in `__support` if it's necessary/useful.

For the public API, I don't have a strong opinion on whether it's opaque or not.

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


More information about the libc-commits mailing list