long ru_nivcsw; /* involuntary context switches */
};
-void getrusage(int who, struct rusage *rusage);
+void _getrusage(int who, struct rusage *rusage);
#elif defined(_POSIX_SOURCE) || defined(__USG)
time_t tms_cstime; /* system time, children */
};
-long times(struct tms *buffer);
+long _times(struct tms *buffer);
#else /* Version 7 UNIX */
long child_system_time;
};
-long times(struct tbuffer *buffer);
+long _times(struct tbuffer *buffer);
#endif
#if defined(__BSD4_2)
struct rusage rusage;
- getrusage(RUSAGE_SELF, &rusage);
+ _getrusage(RUSAGE_SELF, &rusage);
return (((unsigned long)rusage.ru_utime.tv_sec * CLOCKS_PER_SEC)
+ rusage.ru_utime.tv_usec);
#elif defined(_POSIX_SOURCE) || defined(__USG)
struct tms tms;
- times(&tms);
+ _times(&tms);
/* Assume that time_t can be converted to clock_t for Sys5 */
return tms.tms_utime;
#else
struct tbuffer tbuffer;
- times(&tbuffer);
+ _times(&tbuffer);
return tbuffer.proc_user_time;
#endif
}
double
difftime(time_t time1, time_t time0)
{
+ /* be careful: time_t is unsigned */
if (time0 > time1)
return - (double) (time0 - time1);
else return (double) (time1 - time0);
int tz_dsttime; /* type of dst correction */
};
-int gettimeofday(struct timeval *tp, struct timezone *tzp);
+int _gettimeofday(struct timeval *tp, struct timezone *tzp);
#elif !defined(_POSIX_SOURCE) && !defined(__USG)
#if !defined(_MINIX) /* MINIX has no ftime() */
short timezone;
short dstflag;
};
-void ftime(struct timeb *bp);
+void _ftime(struct timeb *bp);
#endif
#endif
struct timeval tv;
struct timezone tz;
- gettimeofday(&tv, &tz);
+ _gettimeofday(&tv, &tz);
_daylight = tz.tz_dsttime;
_timezone = tz.tz_minuteswest * 60;
#if !defined(_MINIX) /* MINIX has no ftime() */
struct timeb time;
- ftime(&time);
+ _ftime(&time);
_timezone = time.timezone * 60L;
_daylight = time.dstflag;
#endif
int tz_dsttime; /* type of dst correction */
};
-int gettimeofday(struct timeval *tp, struct timezone *tzp);
+int _gettimeofday(struct timeval *tp, struct timezone *tzp);
time_t
time(time_t *timer)
{
struct timeval tv;
struct timezone tz;
- gettimeofday(&tv, &tz);
+ _gettimeofday(&tv, &tz);
if (timer) *timer = tv.tv_sec;
return tv.tv_sec;