Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • so is it saying that i cant use the /proc/<pid>/stat to constantly check the sp of a running process, because it is always going to be zero ? Commented Jun 4 at 18:04
  • Yes, that is correct. As the quote states, a program can use ptrace(2) system call to obtain reliable values. GDB can also attach to a process (using -p as root) to debug it. Commented Jun 4 at 18:23
  • I updated the answer with the exact line preceding the comment, which zeroes out the three local variables. Commented Jun 4 at 18:31