哪个函数可以得到进程的状态?

我现在想做一个程序实现类似pidin的功能得到进程的状态?哪个函数可以实现呢?

http://www.openqnx.com/chinese/viewtopic.php?t=995&highlight=pidin