3 Replies - 1368 Views - Last Post: 05 October 2012 - 05:58 AM Rate Topic: -----

#1 apaddobs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 16-May 12

how to get OS name,architecture,version and Process owner in C++/Unix?

Posted 05 October 2012 - 12:29 AM

   const char* os name = ??? //Should return Linux
   const char* architecture = ??? //Should return AMD or RHEL or relevant architecture
   const char* version = ??? //Should return RHEL 4.1 or 5.3 etc
   const char* powner = ??? //Should return the name of the owner (of the parent pid).



Can someone pls. let me know the functions for the same?
Is This A Good Question/Topic? 0
  • +

Replies To: how to get OS name,architecture,version and Process owner in C++/Unix?

#2 Salem_c  Icon User is offline

  • void main'ers are DOOMED
  • member icon

Reputation: 1643
  • View blog
  • Posts: 3,120
  • Joined: 30-May 10

Re: how to get OS name,architecture,version and Process owner in C++/Unix?

Posted 05 October 2012 - 12:39 AM

http://linux.die.net/man/2/uname
Was This Post Helpful? 0
  • +
  • -

#3 apaddobs  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 49
  • Joined: 16-May 12

Re: how to get OS name,architecture,version and Process owner in C++/Unix?

Posted 05 October 2012 - 05:51 AM

Thank you. That helped. Just one thing left out from the list above though. The process owner's name. How do I get that?
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6058
  • View blog
  • Posts: 23,495
  • Joined: 23-August 08

Re: how to get OS name,architecture,version and Process owner in C++/Unix?

Posted 05 October 2012 - 05:58 AM

http://linux.die.net/lkmpg/x710.html
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1