-1

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

How can I do it?

Any insight appreciated ;)

Max
  • 29
  • 1
  • 6
  • There's a similar question [here](http://stackoverflow.com/q/6457682/960195) that might prove useful. – Adam Mihalcin Apr 10 '12 at 04:36
  • 1
    [Stack Overflow is not a Code Writing, Tutorial or Consulting Service](http://meta.stackexchange.com/a/128553/172496) ... Or more succinctly, [What Have you tried?](http://mattgemmell.com/2008/12/08/what-have-you-tried/) – Brian Roach Apr 10 '12 at 04:38
  • 1
    I'm very sorry and thanks for your advice. Hope you forgive me as a newer. And I will reform myself endlessly. So, thanks all of you ;) – Max Apr 10 '12 at 04:51

1 Answers1

2

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

paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953