From ffdf5076dde6b6388a248ad3fba6c6a4739e089e Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 1 Dec 2015 12:05:15 +0100 Subject: [PATCH] PX4 tasks: Add px4_prctl API --- src/platforms/px4_tasks.h | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/platforms/px4_tasks.h b/src/platforms/px4_tasks.h index 04585aaced..bf8c5eeeff 100644 --- a/src/platforms/px4_tasks.h +++ b/src/platforms/px4_tasks.h @@ -80,10 +80,13 @@ typedef int px4_task_t; #error "No target OS defined" #endif -#if defined (__PX4_LINUX) || defined(__PX4_NUTTX) +#if defined (__PX4_NUTTX) +#include +#define px4_prctl prctl +#elif defined (__PX4_LINUX) #include #else -#define prctl(_action, _string, _pid) +#define PR_SET_NAME 1 #endif typedef int px4_task_t; @@ -126,5 +129,10 @@ __EXPORT void px4_show_tasks(void); /** See if a task is running **/ __EXPORT bool px4_task_is_running(const char *taskname); +#ifdef __PX4_POSIX +/** set process (and thread) options */ +__EXPORT int px4_prctl(int option, const char* arg2, unsigned pid); +#endif + __END_DECLS