home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / EMXLIB8F.ZIP / EMX / LIB / IO / UTIMES.C < prev    next >
Encoding:
C/C++ Source or Header  |  1993-01-02  |  547 b   |  26 lines

  1. /* utimes.c (emx+gcc) -- Copyright (c) 1990-1993 by Eberhard Mattes */
  2.  
  3. #include <sys/emx.h>
  4. #include <sys/time.h>
  5. #include <time.h>
  6.  
  7. int utimes (const char *name, const struct timeval *tvp)
  8. {
  9.   struct timeval tv[2];
  10.  
  11.   if (tvp == NULL)
  12.     {
  13.       tv[0].tv_sec = tv[1].tv_sec = time (NULL);
  14.       tv[0].tv_usec = tv[1].tv_usec = 0;
  15.     }
  16.   else
  17.     {
  18.       tv[0] = tvp[0];
  19.       tv[1] = tvp[1];
  20.     }
  21.   if (!_tzset_flag) tzset ();
  22.   tv[0].tv_sec -= timezone;
  23.   tv[1].tv_sec -= timezone;
  24.   return (__utimes (name, tv));
  25. }
  26.