Skip to content

Commit e31d0ba

Browse files
author
maxiao
committed
Resolve the issue of low version glibc and gcc compilation not being able to be resolved due to the definition of __USE_GNU (#1077)
1 parent 65e6297 commit e31d0ba

File tree

1 file changed

+2
-4
lines changed
  • portable/ThirdParty/GCC/Posix

1 file changed

+2
-4
lines changed

portable/ThirdParty/GCC/Posix/port.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,6 @@
5151
*----------------------------------------------------------*/
5252
#include "portmacro.h"
5353

54-
#ifdef __linux__
55-
#define __USE_GNU
56-
#endif
5754

5855
#include <errno.h>
5956
#include <pthread.h>
@@ -64,6 +61,7 @@
6461
#include <string.h>
6562
#include <sys/time.h>
6663
#include <sys/times.h>
64+
#include <sys/prctl.h>
6765
#include <time.h>
6866
#include <unistd.h>
6967

@@ -141,7 +139,7 @@ static void prvPortSetCurrentThreadName(char * pxThreadName)
141139
#ifdef __APPLE__
142140
pthread_setname_np(pxThreadName);
143141
#else
144-
pthread_setname_np(pthread_self(), pxThreadName);
142+
prctl( PR_SET_NAME, pxThreadName );
145143
#endif
146144
}
147145
/*-----------------------------------------------------------*/

0 commit comments

Comments
 (0)