Search code examples
linuxqtpidqthread

How to get PID of QThread in Linux?


I need to get PID of specific QThread in linux. getpid returns pid of parent process. getCurrentThreadId returns Qt inner code. Is there any other way?


Solution

  • Found the answer there: https://stackoverflow.com/a/21280941/2656799

    It is in use of syscall(SYS_gettid)