LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Tags used in this thread
Popular LQ Tags , ,

Reply
 
Thread Tools
Old 10-23-2009, 02:04 AM   #1
kewl
LQ Newbie
 
Registered: Feb 2009
Posts: 23
Thanked: 0
Reading the Linux Kernel version


[Log in to get rid of this advertisement]
Hi,
Is there any way to read the kernel version number using c++ code in an application?
windows_xp_2003 kewl is offline  
Tag This Post , ,
Reply With Quote
Old 10-23-2009, 02:59 AM   #2
neonsignal
Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Lenny (2.6.30-bpo kernel, Fluxbox) on Toshiba Portege 3500
Posts: 419
Thanked: 91
You could open the file '/proc/version' and read the contents into a string.
linux neonsignal is offline     Reply With Quote
Old 10-31-2009, 03:18 AM   #3
anshexp
LQ Newbie
 
Registered: Jul 2009
Posts: 14
Thanked: 0
Quote:
Originally Posted by kewl View Post
Hi,
Is there any way to read the kernel version number using c++ code in an application?
generally u can se the kernel version by command by uname -a
on shell.

if u want to find out it in C++ code the u try
system("uname -a") in ur c++ code.
and include stdlib.h
if it will not work then tell me
windows_xp_2003 anshexp is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Regarding distribution + kernel version + gcc version + glib version. JCipriani Linux - General 8 04-19-2008 03:54 PM
reading kernel ip tables in red hat linux 2.6 sakthivelbatusai Linux - Networking 1 04-26-2007 11:57 AM
Reading Linux' version string TioDuke Programming 7 05-12-2006 12:43 AM
who knows the kernel version of each version of linux iamthewind Linux - Software 4 11-17-2003 06:18 AM


All times are GMT -5. The time now is 06:51 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration