mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-29 07:20:35 +08:00
PX4 tasks: Add px4_prctl API
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user