4 ms·
How do you access the contents of /proc programmatically?
by nerdponx 3y ago
How do you access the contents of /proc programmatically?
- nurettin 3y agoread/select loop? Or am I too outdated?
- ww520 3y agocat, fopen, fread, fwrite, etc.
- nerdponx 3y agoRight, so it's an API, but it's only usable through the file system, and it's a pretty bad API. You still need to parse the crappy ad hoc format instead of getting a struct from the kernel.
- grepfru_it 3y agoYep. So the trade off is then app compatibility or a radical new interface
- josephg 3y agoIf it were in Linux it would probably make sense to keep both interfaces, for the time being. Existing apps can use the current interface, and newer apps can opt in to a fancier interface / api.