How to detect OS is SLES 10 or not

Hi,

I would like to programmatically find if given OS is SLES 10 / RHEL 3/.RHEL 4/RHEL5 etc ..
For this do we have any library call/sys call? Or should we use any sys. structure which would give me detailed info. Share me if you have any pointers.

Thanks in advance

  • Krishna

cat /etc/issue