summaryrefslogtreecommitdiff
path: root/nuttx/include/pthread.h
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-26 15:00:35 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2012-04-26 15:00:35 +0000
commitb1236cf9e33dc521db487911b38d5441a220d7ba (patch)
treeb23f5485d292150d73b40bd01730a22b1677a574 /nuttx/include/pthread.h
parent5145ba33ec23c19f84c0d56dc182ea90f7a437d6 (diff)
downloadpx4-nuttx-b1236cf9e33dc521db487911b38d5441a220d7ba.tar.gz
px4-nuttx-b1236cf9e33dc521db487911b38d5441a220d7ba.tar.bz2
px4-nuttx-b1236cf9e33dc521db487911b38d5441a220d7ba.zip
Add interfaces to support getting/setting of thread/task names
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4658 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include/pthread.h')
-rw-r--r--nuttx/include/pthread.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/nuttx/include/pthread.h b/nuttx/include/pthread.h
index 092cfad93..5a08f13b6 100644
--- a/nuttx/include/pthread.h
+++ b/nuttx/include/pthread.h
@@ -136,6 +136,18 @@
#define PTHREAD_BARRIER_SERIAL_THREAD 0x1000
+/* Definitions to map some non-standard, BSD thread management interfaces to
+ * the non-standard Linux-like prctl() interface. Since these are simple
+ * mappings to prctl, they will return 0 sucess and -1 on failure with the
+ * err number in errno. This is an inconsistency with out pthread interfaces.
+ */
+
+#define pthread_setname_np(thread, name) \
+ prctl((int)PR_SET_NAME, (char*)name, (int)thread)
+
+#define pthread_getname_np(thread, name) \
+ prctl((int)PR_GET_NAME, (char*)name, (int)thread)
+
/********************************************************************************
* Global Type Declarations
********************************************************************************/