Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pthread_setname_np was not declared in this scope #4063

Closed
navinagaraj opened this issue Jun 26, 2023 · 2 comments
Closed

pthread_setname_np was not declared in this scope #4063

navinagaraj opened this issue Jun 26, 2023 · 2 comments

Comments

@navinagaraj
Copy link

navinagaraj commented Jun 26, 2023

While building i am facing the issue i added the with " -lpthread " option also but build failed. I added the web page related to small C library for embedded systems is that ok ?

web page Link:

https://patchwork.ozlabs.org/project/uclibc-ng/patch/20161110012740.82DFF10162@helium.openadk.org/

platform Info:

Kernel Architecture   -> arm  (Linux)           
Kernel Version        -> 4.19 
gcc                   -> 5.5.0          
uClibc                -> 0.9.33.2 

Error:

In file included from src/Thread.cpp:32:0:
src/Thread_POSIX.cpp: In function 'void {anonymous}::setThreadName(pthread_t, const string&)':
src/Thread_POSIX.cpp:71:51: error: 'pthread_setname_np' was not declared in this scope
  if (pthread_setname_np(thread, threadName.c_str()) == ERANGE && threadName.size() > 15)

Previous issue:

#3832
#4042

@aleks-f
Copy link
Member

aleks-f commented Jun 28, 2023

@aleks-f aleks-f self-assigned this Jun 28, 2023
@aleks-f aleks-f added this to the Release 1.13.0 milestone Jun 28, 2023
@aleks-f aleks-f assigned zaleksandar and unassigned aleks-f Jul 25, 2023
@aleks-f
Copy link
Member

aleks-f commented Aug 18, 2023

this is not available on GLIBC<2.12 and also not available on many platforms, so it would probably be best solved by using prctl(2) with PR_SET_NAME/PR_GET_NAME

aleks-f pushed a commit that referenced this issue Oct 23, 2023
* Fix pthread_setname not declared #4063

* Fix include prctl.h for specific OS #4063

* Fix getThreadName for specific OS #4063

---------

Co-authored-by: root <root@debian-gnu-linux-11.localdomain>
Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
@aleks-f aleks-f added the fixed label Oct 24, 2023
aleks-f pushed a commit that referenced this issue Nov 23, 2023
* Fix pthread_setname not declared #4063

* Fix include prctl.h for specific OS #4063

* Fix getThreadName for specific OS #4063

---------

Co-authored-by: root <root@debian-gnu-linux-11.localdomain>
Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
aleks-f pushed a commit that referenced this issue Nov 27, 2023
* Fix pthread_setname not declared #4063

* Fix include prctl.h for specific OS #4063

* Fix getThreadName for specific OS #4063

---------

Co-authored-by: root <root@debian-gnu-linux-11.localdomain>
Co-authored-by: Pavle <pavle@debian-gnu-linux-11.localdomain>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants