cputime.c 772 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. double
  10. cputime(void)
  11. {
  12. int32_t t[4];
  13. int32_t times(int32_t*);
  14. int i;
  15. times(t);
  16. for(i=1; i<4; i++)
  17. t[0] += t[i];
  18. return t[0] / 100.;
  19. }
  20. int32_t
  21. seek(int f, int32_t o, int p)
  22. {
  23. int32_t lseek(int, int32_t, int);
  24. return lseek(f, o, p);
  25. }
  26. int
  27. create(char *n, int m, int32_t p)
  28. {
  29. int creat(char*, int);
  30. if(m != 1)
  31. return -1;
  32. return creat(n, p);
  33. }