Skip to content

gh-125434: Fix building on OpenBSD #132393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Python/traceback.c
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,17 @@ _Py_DumpTraceback(int fd, PyThreadState *tstate)
dump_traceback(fd, tstate, 1);
}

#if defined(HAVE_PTHREAD_GETNAME_NP) || defined(HAVE_PTHREAD_GET_NAME_NP)
# if defined(__OpenBSD__)
/* pthread_*_np functions, especially pthread_{get,set}_name_np().
pthread_np.h exists on both OpenBSD and FreeBSD but the latter declares
pthread_getname_np() and pthread_setname_np() in pthread.h as long as
__BSD_VISIBLE remains set.
*/
# include <pthread_np.h>
# endif
#endif

/* Write the thread identifier into the file 'fd': "Current thread 0xHHHH:\" if
is_current is true, "Thread 0xHHHH:\n" otherwise.

Expand Down
Loading