From e31d0ba097f641ad2ac460f375769fa15f90b63d Mon Sep 17 00:00:00 2001 From: maxiao Date: Wed, 5 Jun 2024 11:46:22 +0800 Subject: [PATCH] Resolve the issue of low version glibc and gcc compilation not being able to be resolved due to the definition of __USE_GNU (#1077) --- portable/ThirdParty/GCC/Posix/port.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/portable/ThirdParty/GCC/Posix/port.c b/portable/ThirdParty/GCC/Posix/port.c index fdb556d04..6a7837d79 100644 --- a/portable/ThirdParty/GCC/Posix/port.c +++ b/portable/ThirdParty/GCC/Posix/port.c @@ -51,9 +51,6 @@ *----------------------------------------------------------*/ #include "portmacro.h" -#ifdef __linux__ - #define __USE_GNU -#endif #include #include @@ -64,6 +61,7 @@ #include #include #include +#include #include #include @@ -141,7 +139,7 @@ static void prvPortSetCurrentThreadName(char * pxThreadName) #ifdef __APPLE__ pthread_setname_np(pxThreadName); #else - pthread_setname_np(pthread_self(), pxThreadName); + prctl( PR_SET_NAME, pxThreadName ); #endif } /*-----------------------------------------------------------*/