getprogname: re-enable on NuttX & move to px4_tasks.h

This commit is contained in:
Beat Küng
2016-06-08 12:58:23 +02:00
parent b9e9f62bee
commit 9f5adb2356
4 changed files with 15 additions and 13 deletions
-11
View File
@@ -62,17 +62,6 @@ extern int lib_lowvprintf(const char *fmt, va_list ap);
// XXX not used anymore
#if 0
const char *
getprogname(void)
{
#if CONFIG_TASK_NAME_SIZE > 0
FAR struct tcb_s *thisproc = sched_self();
return thisproc->name;
#else
return "app";
#endif
}
static void
warnerr_core(int errcode, const char *fmt, va_list args)
-2
View File
@@ -74,8 +74,6 @@
__BEGIN_DECLS
__EXPORT const char *getprogname(void);
#ifdef __PX4_NUTTX
#define EXIT(eval) exit(eval)
@@ -38,6 +38,7 @@
*/
#include <px4_config.h>
#include <px4_tasks.h>
#include <unistd.h>
#include <stdio.h>
#include <fcntl.h>
@@ -106,3 +107,15 @@ int px4_task_delete(int pid)
{
return task_delete(pid);
}
const char *getprogname(void)
{
#if CONFIG_TASK_NAME_SIZE > 0
FAR struct tcb_s *thisproc = sched_self();
return thisproc->name;
#else
return "app";
#endif
}
+2
View File
@@ -134,5 +134,7 @@ __EXPORT bool px4_task_is_running(const char *taskname);
__EXPORT int px4_prctl(int option, const char *arg2, unsigned pid);
#endif
__EXPORT const char *getprogname(void);
__END_DECLS