diff --git a/src/platforms/posix/px4_layer/px4_posix_tasks.cpp b/src/platforms/posix/px4_layer/px4_posix_tasks.cpp index c539fa7266..eb442e708b 100644 --- a/src/platforms/posix/px4_layer/px4_posix_tasks.cpp +++ b/src/platforms/posix/px4_layer/px4_posix_tasks.cpp @@ -273,6 +273,21 @@ void px4_show_tasks() } __BEGIN_DECLS + +int px4_getpid() +{ + pthread_t pid = pthread_self(); + + // Get pthread ID from the opaque ID + for (int i=0; i