Created
October 22, 2009 22:54
-
-
Save mhansen/216429 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* Prototypes for functions called upon a read to a /proc file | |
| These functions all fill the buffer parameter with a string, | |
| which is returned to the process calling read() */ | |
| #define NR_DEVS 6 /* number of minor devices */ | |
| _PROTOTYPE( void get_uptime, (char *buffer, int bufSize) ); | |
| _PROTOTYPE( void get_Hz, (char *buffer, int bufSize) ); | |
| _PROTOTYPE( void get_bootenv, (char *buffer, int bufSize) ); | |
| _PROTOTYPE( void get_cpuinfo, (char *buffer, int bufSize) ); | |
| _PROTOTYPE( void get_processes, (char *buffer, int bufSize) ); | |
| _PROTOTYPE( void get_bootimage, (char *buffer, int bufSize) ); | |
| /* call vector of functions to retrieve file contents, indexed by minor no. */ | |
| void (*pr_vec[NR_DEVS]) (char *buffer, int bufSize) = { | |
| /* function minor file */ | |
| get_Hz, /* 0 = /proc/hz */ | |
| get_uptime, /* 1 = /proc/uptime */ | |
| get_bootenv, /* 2 = /proc/bootenv */ | |
| get_cpuinfo, /* 3 = /proc/cpuinfo */ | |
| get_processes,/*4 = /proc/processes */ | |
| get_bootimage,/*5 = /proc/bootimage */ | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment