summaryrefslogtreecommitdiff
path: root/sal/osl/unx/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'sal/osl/unx/thread.c')
-rw-r--r--sal/osl/unx/thread.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 689b78dc748a..cf3d13e4b244 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -37,6 +37,10 @@
#include <rtl/textenc.h>
#include <sal/macros.h>
+#if defined LINUX
+#include <sys/prctl.h>
+#endif
+
/****************************************************************************
* @@@ TODO @@@
*
@@ -590,6 +594,18 @@ void SAL_CALL osl_yieldThread()
sched_yield();
}
+void SAL_CALL osl_setThreadName(char const * name) {
+#if defined LINUX
+ if (prctl(PR_SET_NAME, (unsigned long) name, 0, 0, 0) != 0) {
+ OSL_TRACE(
+ "%s prctl(PR_SET_NAME) failed with errno %d", OSL_LOG_PREFIX,
+ errno);
+ }
+#else
+ (void) name;
+#endif
+}
+
/*****************************************************************************/
/* osl_getThreadIdentifier @@@ see TODO @@@ */
/*****************************************************************************/