LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > 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

Reply
 
Search this Thread
Old 10-23-2009, 01:04 AM   #1
kewl
LQ Newbie
 
Registered: Feb 2009
Posts: 29

Rep: Reputation: 15
Reading the Linux Kernel version


Hi,
Is there any way to read the kernel version number using c++ code in an application?
 
Old 10-23-2009, 01:59 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Wheezy (Fluxbox WM)
Posts: 1,363
Blog Entries: 52

Rep: Reputation: 353Reputation: 353Reputation: 353Reputation: 353
You could open the file '/proc/version' and read the contents into a string.
 
Old 10-31-2009, 02:18 AM   #3
anshexp
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Rep: Reputation: 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
 
  


Reply

Tags
code, kernel, version


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 02:54 PM
reading kernel ip tables in red hat linux 2.6 sakthivelbatusai Linux - Networking 1 04-26-2007 10:57 AM
Reading Linux' version string TioDuke Programming 7 05-11-2006 11:43 PM
who knows the kernel version of each version of linux iamthewind Linux - Software 4 11-17-2003 05:18 AM


All times are GMT -5. The time now is 03:32 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration