Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

173
Vistas
Programmatically getting Linux device resource info

I was given some resource list to get value of them programmatically in C. Although I know these are too specific and is not really important or generic, still due to my intelligent boss, I just wanted to have opinion about the list. Remember it may run in any type of Linux based device , may be desktop, laptop even in embedded devices like rpi or edison, gallileo

SERIAL_NO /*vendor specific*/
BATTERY_LEVEL /*not generic*/
HEAP /*only program specific*/
CPU_FREQUENCY /*vendor specific register*/
PROCESSOR_TYPE /*vendor specific register*/
PROCESSOR_SPEED /*vendor specific register*/
STORAGE /*I am not really sure*/
MODEL /*vendor specific register*/
IMEI /*vendor specific driver, not generic*/
DEVICE_TYPE /*vendor specific register*/
ALTITUDE /*vendor specific sensor, not generic*/
SPEED /*vendor specific sensor*/
BEARING /*vendor specific*/

If anyone have any suggestion, be it technical or strategic, please advice me. Tired of such illogical requirements. Sorry if anyway I violated SO rules.

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Some suggestions:

  1. Find tools that dump/use the info you are looking for and strace them to get an idea on where to look for this info

  2. Find opensource tools that dump/use the info you are looking for and read the code

  3. Look into /proc, for example cpuinfo

over 4 years ago · Santiago Trujillo Denunciar

0

It also depends on what are the types of the devices you're interesting (network adaptor, block device etc). For many of them the usual way to get some info can be the sysctl which provides you a native C API which means the solution is supposed to be portable between all platforms supporting this device. So, what you may do is to search what exact driver handles your device and see what sysctls it supports. For this you need either read its header file[s], or its implementation or its doc if present. man sysctl for reference. However I don't know any kind of a "generic" way to get info of a random device.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda