LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-09-2018, 03:39 PM   #1
ldmarks
LQ Newbie
 
Registered: Nov 2018
Posts: 1

Rep: Reputation: Disabled
Format for reading /proc/self/status and /proc/meminfo


I want to be able to read the information in /proc/self/status (primarily memory information) and the total available memory from /proc/meminfo. This needs to be done "on the fly" in code which will be used on different systems. Are there include files which specify the format used? While I can (on one system) do a simple search for MemFree for instance, I would prefer not to have to search for MEMFREE, Memfree etc since I am not sure if the format is standardized across all OS.
 
Old 11-09-2018, 05:45 PM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
It will certainly not be consistent across all OS - in fact /proc is different on various *nix let alone others.
But for Linux distros you can assume they will be consistent - /proc is a pseudo filesystem provided by the kernel. "files" may be added to over time, and meminfo certainly has, but pre-existent entries are not going to change retro-spectively.

Personally I always parse those sort of thing case-insenitively.
 
  


Reply



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
Committed_AS in /proc/meminfo LinuxLover Linux - Server 4 10-17-2023 07:03 PM
/proc/meminfo - Active(file) engr04 Linux - Newbie 8 10-19-2012 06:42 PM
/proc/meminfo VS /proc/kcore Fill Linux - Newbie 2 08-04-2011 04:13 AM
/proc/meminfo vkmgeek Linux - General 6 03-20-2008 12:12 AM
/proc/meminfo gives wrong info jr8rdt Linux - Hardware 2 12-07-2006 06:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration