I have to know if a thread is currently executing a system call (e.g. read/write/etc.) by knowing its tid. Is there a way to do that in Linux?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This should list the state code of the thread
The two relevant codes are:
Edit:
If you want to get the exact system call programmatically, you could use
ptraceas you have suggested and readEAX, you should also use thePTRACE_SYSCALLflag to have the process stop at the next system call entry.