more on identifying the system a program is running on...

fred smith fredex at fcshome.stoneham.ma.us
Thu Jul 1 13:49:49 UTC 2010


I asked recently about using /etc/redhat-release and got some useful answers.
My thanks to all who replied.

Now a slight variant:

Can anyone suggest some resource that a PROGRAM (compiled C program) can
examine while running to find out what platform it is runninng on ?

Things that come to mind include:
1. output of uname to see if the kernel version contains "elX" where X
is a digit, such as el4, el5, etc., identifying RHEL-4, RHEL-5, etc.
2. do the same thing by exmining the filename of the kernel (if I knew
   how to find the file for the currently running kernel, that is.

can anyone suggest any other checks I could do?

Thanks again!

-- 
---- Fred Smith -- fredex at fcshome.stoneham.ma.us -----------------------------
                    The Lord detests the way of the wicked 
                  but he loves those who pursue righteousness.
----------------------------- Proverbs 15:9 (niv) -----------------------------


More information about the users mailing list