home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / posix / sys / times / times.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-04-01  |  391 b   |  20 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2. #include <errno.h>
  3. #include <sys/times.h>
  4. #include <time.h>
  5.  
  6. clock_t
  7. times(struct tms *buffer)
  8. {
  9.   if (buffer == 0)
  10.   {
  11.     errno = EINVAL;
  12.     return (clock_t)(-1);
  13.   }
  14.   buffer->tms_utime = clock();
  15.   buffer->tms_stime = 0;
  16.   buffer->tms_cutime = 0;
  17.   buffer->tms_cstime = 0;
  18.   return buffer->tms_utime;
  19. }
  20.