pstack icon indicating copy to clipboard operation
pstack copied to clipboard

Compilation fails on systems with glibc version < 2.30

Open Dologan opened this issue 1 year ago • 2 comments

pstack-2.5.1/self.cc: In member function ‘virtual void pstack::Procman::SelfProcess::listLWPs(std::function<void(int)>)’:
pstack-2.5.1/self.cc:31:7: error: ‘gettid’ was not declared in this scope; did you mean ‘getuid’?

This is discussed in https://stackoverflow.com/questions/30680550/c-gettid-was-not-declared-in-this-scope

And the solution:

#include <sys/syscall.h>
#define gettid() syscall(SYS_gettid)
#endif

fixes the issue

Dologan avatar Mar 08 '24 13:03 Dologan

Ah, well, I see now it doesn't support glibc versions < 3.4 anyway, so I guess this is moot.

Dologan avatar Mar 08 '24 13:03 Dologan

I can certainly try and make this work for slightly older systems out of the box

peadar avatar Mar 10 '24 23:03 peadar