home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume25 / byte-benchmarks3.1 / part01 / src / syscall.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-01  |  1.3 KB  |  59 lines

  1. /*******************************************************************************
  2.  *  The BYTE UNIX Benchmarks - Release 3
  3.  *          Module: syscall.c   SID: 3.3 5/15/91 19:30:21
  4.  *          
  5.  *******************************************************************************
  6.  * Bug reports, patches, comments, suggestions should be sent to:
  7.  *
  8.  *    Ben Smith, Rick Grehan or Tom Yager at BYTE Magazine
  9.  *    ben@bytepb.byte.com   rick_g@bytepb.byte.com   tyager@bytepb.byte.com
  10.  *
  11.  *******************************************************************************
  12.  *  Modification Log:
  13.  *  $Header: syscall.c,v 3.4 87/06/22 14:32:54 kjmcdonell Beta $
  14.  *  August 29, 1990 - Modified timing routines
  15.  *
  16.  ******************************************************************************/
  17. /*
  18.  *  syscall  -- sit in a loop calling the system
  19.  *
  20.  */
  21. char SCCSid[] = "@(#) @(#)syscall.c:3.3 -- 5/15/91 19:30:21";
  22.  
  23. #include <stdio.h>
  24. #include "timeit.c"
  25.  
  26. unsigned long iter;
  27.  
  28. report()
  29. {
  30.     fprintf(stderr,"%ld loops\n", iter);
  31.     exit(0);
  32. }
  33.  
  34. main(argc, argv)
  35. int    argc;
  36. char    *argv[];
  37. {
  38.     int    duration;
  39.     int    i;
  40.  
  41.     if (argc != 2) {
  42.         printf("Usage: %s duration\n", argv[0]);
  43.         exit(1);
  44.     }
  45.  
  46.     duration = atoi(argv[1]);
  47.  
  48.     iter = 0;
  49.     wake_me(duration, report);
  50.  
  51.     while (1) {
  52.         close(dup(0));
  53.         getpid();
  54.         getuid();
  55.         umask(022);
  56.         iter++;
  57.     }
  58. }
  59.