Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3697926
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T04:55:10+00:00 2026-05-19T04:55:10+00:00

The Linux kernel exposes information about the current environment using the sysfs filesystem in

  • 0

The Linux kernel exposes information about the current environment using the sysfs filesystem in /sys. I’m interested in getting information about online CPUs and their memory hierarchy (Level 1 to Level 3 caches).

Since all this information is basically text files I could write a parser on my own, but I’m curious what the best way of processing the information in sysfs is. Currently I found two alternatives:

libsysfs

and

libudev

The downside of libsysfs seems to be that the code is now almost 5 years old and almost no documentation is available, libudev seems more active but documentation is quite rare. There was only one useful tutorial I found on libudev — http://www.signal11.us/oss/udev/

What is the state of the art way to process content from sysfs in C/C++?

[Update]

Currently it is not possible to access data stored in /sys/devices/system due to the fact that the exposed information are not real devices. The only way to access this data is to do it manually.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T04:55:10+00:00Added an answer on May 19, 2026 at 4:55 am

    The kernel authors have published sysfs-rules.txt, which explains how sysfs must be used. They point out in particular

    Do not use libsysfs

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, I'm reading about Linux kernel development and there are some code snippets using
Given a linux kernel oops, how do you go about diagnosing the problem? In
I am interested in cross-compiling a Linux kernel for an ARM target on a
I'm writing a Linux module and getting: Unable to handle kernel NULL pointer dereference
After a linux kernel upgrade, my VMWare server cannot start until using vmware-config.pl to
I am interested in Android kernel level programming. Actually I am a Linux kernel
I'm trying to write a kernel module, which prints some information about the objects
I'm writing a Linux kernel module that needs to open and read files. What's
I've been digging through some parts of the Linux kernel, and found calls like
I have a ARM11 based hardware board which runs a Linux kernel ver. 2.6.21.5-cfs-v19.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.