Given the pid of a Linux process, I want to check, from a C program, if the process is still running.
You can issue a kill(2) system call with 0 as the signal.
There's nothing unsafe about kill -0. The program
must be aware that the result can become obsolete at any time
(including that the pid can get reused before kill is called),
that's all. And using procfs instead does use the pid too,
and doing so in a more cumbersome and nonstandard way.