I want to get the user ID of a given process ID using C

How can I do it?

Any insight appreciated ;)

有帮助吗?

解决方案

If you have the procfs file system, then the effective user ID of the files in /proc/<pid> are that of the user.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top