Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* 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 */
- };
Add Comment
Please, Sign In to add comment