Guest User

Untitled

a guest
Apr 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. /* Prototypes for functions called upon a read to a /proc file
  2. These functions all fill the buffer parameter with a string,
  3. which is returned to the process calling read() */
  4. #define NR_DEVS 6 /* number of minor devices */
  5.  
  6. _PROTOTYPE( void get_uptime, (char *buffer, int bufSize) );
  7. _PROTOTYPE( void get_Hz, (char *buffer, int bufSize) );
  8. _PROTOTYPE( void get_bootenv, (char *buffer, int bufSize) );
  9. _PROTOTYPE( void get_cpuinfo, (char *buffer, int bufSize) );
  10. _PROTOTYPE( void get_processes, (char *buffer, int bufSize) );
  11. _PROTOTYPE( void get_bootimage, (char *buffer, int bufSize) );
  12.  
  13. /* call vector of functions to retrieve file contents, indexed by minor no. */
  14. void (*pr_vec[NR_DEVS]) (char *buffer, int bufSize) = {
  15. /* function minor file */
  16. get_Hz, /* 0 = /proc/hz */
  17. get_uptime, /* 1 = /proc/uptime */
  18. get_bootenv, /* 2 = /proc/bootenv */
  19. get_cpuinfo, /* 3 = /proc/cpuinfo */
  20. get_processes,/*4 = /proc/processes */
  21. get_bootimage,/*5 = /proc/bootimage */
  22. };
Add Comment
Please, Sign In to add comment