Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

174
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda