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