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
Last edited by knobby67; 09-17-2006 at 06:30 AM.
|