reading /proc throught C code
Hello, I'm hoping someone can help me out on this problem. I'm trying to read an entery from the proc system using C. Basically I'm using an io board which detects a switch. I can read at command promp using cat /proc/ioboard/input_1 which returns either a 1 or 0 depending on the status of the input. I've tried to read in throught c (the lang I'm coding in) using a simple
/***********code example******************/ input = open("/proc/ioboard/input_1",O_RDONLY); printf("\n input = %d",input); /*****************************************/ However this returns 3 no matter what the input, I assume I can't just read from /proc? Can anyone advise what I need to do. Thanks |
Code:
#include <stdio.h> |
thanks, just realised I forgot to read :cry: Sorry for the stupidity!
|
All times are GMT -5. The time now is 10:20 PM. |