ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Why don't you just try to open the files in the proc or sys filesystem? That will tell you if they are there and readable. The open will fail with ENOENT if the file doesn't exist.
For those of us unacquainted with the differences, perhaps you could briefly explain them, and also how you would distinguish between them in some other context, such as with commandline tools, etc. This sounds like something that changed across kernel versions; maybe just checking the kernel version would suffice.
--- rod.
As of 2.6.29, both /proc and /sys are available in the kernel. I do not know if any distros turn one or the other off; I suppose that is possible in the kernel compilation but if true it seems it would break a lot of things.
I'm somewhat confused by this statement - both have been available "forever". At least since the 2.5 development kernels.
ya its true that both are available but the fact is procfs have only process details, but for hardware related stuffs sysfs is used if you can see the following link you can understand. But we can select procfs to have hardware details.
ya its true that both are available but the fact is procfs have only process details, but for hardware related stuffs sysfs is used if you can see the following link you can understand. But we can select procfs to have hardware details.
Here kernel developer clearly mentioned what are the headers to use when procfs has hardware details, or sysfs has hardware details.
Thanks every one for your kind information.
Alagunambi Welkin
/proc has a lot of hardware information in it. /sys is more-or-less a reorganization of /proc, and the kernel developers insist that /sys is a more rational structure (I suppose that is true). Kernel developers are encouraging use of /sys rather than /proc, so at some point I suppose /proc will become deprecated. It is hard to see, however, how /proc will ever go away, given the extensive use that everyone makes of it.
/proc has a lot of hardware information in it. /sys is more-or-less a reorganization of /proc, and the kernel developers insist that /sys is a more rational structure (I suppose that is true). Kernel developers are encouraging use of /sys rather than /proc, so at some point I suppose /proc will become deprecated. It is hard to see, however, how /proc will ever go away, given the extensive use that everyone makes of it.
But i still didnt get the answer how to find hardware details are in procfs or in sysfs
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.