PX4 tasks: Add px4_prctl API

This commit is contained in:
Lorenz Meier
2015-12-01 12:05:15 +01:00
parent b170467a1d
commit ffdf5076dd
+10 -2
View File
@@ -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 <sys/prctl.h>
#define px4_prctl prctl
#elif defined (__PX4_LINUX)
#include <sys/prctl.h>
#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