From 420efc92b7a96f4299524dd7bb7735a0bdee3c39 Mon Sep 17 00:00:00 2001 From: Brian Callahan Date: Sat, 30 Oct 2021 09:03:53 -0400 Subject: [PATCH] Fix Issue 22454 - OpenBSD: Add prototypes for pthread_np.h --- mak/COPY | 1 + mak/SRCS | 1 + src/core/sys/openbsd/pthread_np.d | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/core/sys/openbsd/pthread_np.d diff --git a/mak/COPY b/mak/COPY index ce675bf454e0..de13c4aecd37 100644 --- a/mak/COPY +++ b/mak/COPY @@ -257,6 +257,7 @@ COPY=\ \ $(IMPDIR)\core\sys\openbsd\dlfcn.d \ $(IMPDIR)\core\sys\openbsd\err.d \ + $(IMPDIR)\core\sys\openbsd\pthread_np.d \ $(IMPDIR)\core\sys\openbsd\stdlib.d \ $(IMPDIR)\core\sys\openbsd\string.d \ $(IMPDIR)\core\sys\openbsd\time.d \ diff --git a/mak/SRCS b/mak/SRCS index 955119dcd611..e3d1d20c6d94 100644 --- a/mak/SRCS +++ b/mak/SRCS @@ -257,6 +257,7 @@ SRCS=\ \ src\core\sys\openbsd\dlfcn.d \ src\core\sys\openbsd\err.d \ + src\core\sys\openbsd\pthread_np.d \ src\core\sys\openbsd\stdlib.d \ src\core\sys\openbsd\string.d \ src\core\sys\openbsd\time.d \ diff --git a/src/core/sys/openbsd/pthread_np.d b/src/core/sys/openbsd/pthread_np.d new file mode 100644 index 000000000000..8344df239500 --- /dev/null +++ b/src/core/sys/openbsd/pthread_np.d @@ -0,0 +1,23 @@ +/** + * D header file for OpenBSD pthread_np.h. + * + * Copyright: Copyright © 2021, The D Language Foundation + * License: Boost License 1.0. + * Authors: Brian Callahan + */ +module core.sys.openbsd.pthread_np; + +version (OpenBSD): +extern (C): +nothrow: +@nogc: + +public import core.sys.posix.sys.types; +import core.sys.posix.signal : stack_t; + +int pthread_mutexattr_getkind_np(pthread_mutexattr_t); +int pthread_mutexattr_setkind_np(pthread_mutexattr_t*, int); +void pthread_get_name_np(pthread_t, char*, size_t); +void pthread_set_name_np(pthread_t, const(char)*); +int pthread_stackseg_np(pthread_t, stack_t*); +int pthread_main_np();