home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / sys / next / programm / 5168 < prev    next >
Encoding:
Text File  |  1992-07-21  |  1.1 KB  |  39 lines

  1. Newsgroups: comp.sys.next.programmer
  2. Path: sparky!uunet!decwrl!csus.edu!news
  3. From: eps@futon.SFSU.EDU (Eric P. Scott)
  4. Subject: Re: man page for "table" system call?
  5. Message-ID: <1992Jul22.071210.25470@csus.edu>
  6. Sender: news@csus.edu
  7. Reply-To: eps@cs.sfsu.edu
  8. Organization: San Francisco State University
  9. References: <63894@hydra.gatech.EDU>
  10. Date: Wed, 22 Jul 1992 07:12:10 GMT
  11. Lines: 26
  12.  
  13. In article <63894@hydra.gatech.EDU> roy@prism.gatech.EDU
  14.     (Roy Mongiovi) writes:
  15. >Where do I find the documentation for table(2)?
  16.  
  17. NeXTanswers' hardware.422 and whatever you can glean from the
  18. #include files (and, of course, any examples you just happen to
  19. find lying around, such as
  20.  
  21. #include <stdio.h>
  22. #include <sys/types.h>
  23. #include <sys/table.h>
  24. main() {
  25.     struct tbl_loadavg avg;
  26.  
  27.     (void)table(TBL_LOADAVG, 0, (caddr_t)&avg, 1, sizeof avg);
  28.     (void)printf("load average:%5.2f,%5.2f,%5.2f\n",
  29.         (double)avg.tl_avenrun[0]/(double)avg.tl_lscale,
  30.         (double)avg.tl_avenrun[1]/(double)avg.tl_lscale,
  31.         (double)avg.tl_avenrun[2]/(double)avg.tl_lscale);
  32.     exit(0);
  33. }
  34.  
  35. which I posted a few weeks ago, or the "locate the loginwindow
  36. process" code in iwf.)
  37.  
  38.                     -=EPS=-
  39.