如何从C ++查找Red Hat Linux的老版本 [英] How to find the vesrion of Red Hat Linux from c++

查看:107
本文介绍了如何从C ++查找Red Hat Linux的老版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


谁能告诉我如何从c ++中找到Red Hat Linux的版本,或者是否有任何获取版本号的功能.
谢谢
Dev

Hi,
Can anyone plz tell me how to find the vesrion of Red Hat Linux from c++ or if there is any fucntion to get the version number.
Thanks
Dev

推荐答案

命令uname()可以做到.

手册页uname(2)
The command uname() should do it.

manpage uname(2)


您可以从环境变量中获取此版本信息.
您可以对所选择的环境变量使用getenv()函数.
我不确定哪个变量可以在Red Hat上为您提供此信息,但是您可以通过发出envset命令来检查它.
You could get this version information from the environment variables.
You can use the getenv() function to the environment variable of you choice.
I''m not sure which variable gives you this information on Red Hat, but you could check that by issuing the env or set commands.


这篇关于如何从C ++查找Red Hat Linux的老版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆