I want to be able to check the owner of a process of which I got the ID from using C on a Unix system. It also needs to work on cygwin. Additionally it would be nice to get the date the process was created, too.
I've seen there are ways through looking up the generated files in /proc/<process-id>/. But unfortunately on cygwin you would need the right permissions to read those files. If possible I am searching for a way without using those files or system commands. I had also found this threat: How to programatically get uid from pid in osx using c++? But it won't work due to missing definitions of KERN_PROC, KERN_PROC_PID and some more. (Have not found the librarys for those in C)
So in short: Does anyone know how I could get the informations on a specific process using c without needing system calls or reading the files in /proc/?