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 commit is contained in:
maxiao 2024-06-05 11:46:22 +08:00
parent 65e6297b68
commit e31d0ba097

View file

@ -51,9 +51,6 @@
*----------------------------------------------------------*/ *----------------------------------------------------------*/
#include "portmacro.h" #include "portmacro.h"
#ifdef __linux__
#define __USE_GNU
#endif
#include <errno.h> #include <errno.h>
#include <pthread.h> #include <pthread.h>
@ -64,6 +61,7 @@
#include <string.h> #include <string.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/times.h> #include <sys/times.h>
#include <sys/prctl.h>
#include <time.h> #include <time.h>
#include <unistd.h> #include <unistd.h>
@ -141,7 +139,7 @@ static void prvPortSetCurrentThreadName(char * pxThreadName)
#ifdef __APPLE__ #ifdef __APPLE__
pthread_setname_np(pxThreadName); pthread_setname_np(pxThreadName);
#else #else
pthread_setname_np(pthread_self(), pxThreadName); prctl( PR_SET_NAME, pxThreadName );
#endif #endif
} }
/*-----------------------------------------------------------*/ /*-----------------------------------------------------------*/