Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


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

Rep: Reputation: 15
Reading the Linux Kernel version

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

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

Rep: Reputation: 0
Originally Posted by kewl View Post
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


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 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 > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:44 AM.

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