port: only enable userspace callstack context on Linux
[lttng-tools.git] / src / common / compat / pthread.h
... / ...
CommitLineData
1/*
2 * Copyright (C) 2020 Michael Jeanson <mjeanson@efficios.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 */
7
8#ifndef _COMPAT_PTHREAD_H
9#define _COMPAT_PTHREAD_H
10
11#include <pthread.h>
12#include <common/compat/errno.h>
13
14#if defined(HAVE_PTHREAD_SETNAME_NP_WITH_TID)
15static inline
16int lttng_pthread_setname_np(const char *name)
17{
18 return pthread_setname_np(pthread_self(), name);
19}
20#elif defined(HAVE_PTHREAD_SETNAME_NP_WITHOUT_TID)
21static inline
22int lttng_pthread_setname_np(const char *name)
23{
24 return pthread_setname_np(name);
25}
26#else
27/*
28 * For platforms without thread name support, do nothing.
29 */
30static inline
31int lttng_pthread_setname_np(const char *name)
32{
33 return -ENOSYS;
34}
35#endif
36
37#endif /* _COMPAT_PTHREAD_H */
This page took 0.022316 seconds and 4 git commands to generate.