};
#endif
-void gettimeofday (struct timeval *, struct timezone *);
-
#define MAXPATHLEN _MAX_PATH
/* Emulate sleep...we could have done this with a define, but that
return NULL;
}
-/* This is needed because lib/gettime.c calls gettimeofday, which MSVC
- doesn't have. Copied from w32.c. */
-void
-gettimeofday (struct timeval *tv, struct timezone *tz)
-{
- struct _timeb tb;
- _ftime (&tb);
-
- tv->tv_sec = tb.time;
- tv->tv_usec = tb.millitm * 1000L;
- /* Implementation note: _ftime sometimes doesn't update the dstflag
- according to the new timezone when the system timezone is
- changed. We could fix that by using GetSystemTime and
- GetTimeZoneInformation, but that doesn't seem necessary, since
- Emacs always calls gettimeofday with the 2nd argument NULL (see
- current_emacs_time). */
- if (tz)
- {
- tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
- tz->tz_dsttime = tb.dstflag; /* type of dst correction */
- }
-}
-
int
fchown (int fd, unsigned uid, unsigned gid)
{
#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
#endif /* _TIMEVAL_DEFINED */
-#ifndef _TIMEZONE_DEFINED
-#define _TIMEZONE_DEFINED
-struct timezone
-{
- int tz_minuteswest; /* minutes west of Greenwich */
- int tz_dsttime; /* type of dst correction */
-};
-#endif
-
-
-/* This needs to be compatible with Posix signature, in order to pass
- the configure test for the type of the second argument; see
- m4/gettimeofday.m4. We use '__restrict' here, rather than
- 'restrict', for the benefit of the old nt/configure.bat build,
- which does not force the use of -std= switch to GCC, and that
- causes compilation errors with 'restrict', which is a C99
- extension. */
-int gettimeofday (struct timeval *__restrict, void *__restrict);
-
#define ITIMER_REAL 0
#define ITIMER_PROF 1
return root_dir;
}
-#include <sys/timeb.h>
-
-/* Emulate gettimeofday (Ulrich Leodolter, 1/11/95). */
-int
-gettimeofday (struct timeval *__restrict tv, void *__restrict tzv)
-{
- struct _timeb tb;
- _ftime (&tb);
-
- tv->tv_sec = tb.time;
- tv->tv_usec = tb.millitm * 1000L;
- /* Implementation note: _ftime sometimes doesn't update the dstflag
- according to the new timezone when the system timezone is
- changed. We could fix that by using GetSystemTime and
- GetTimeZoneInformation, but that doesn't seem necessary, since
- Emacs always calls gettimeofday with the 2nd argument NULL (see
- current_emacs_time). */
- if (tzv)
- {
- struct timezone *tz = (struct timezone *)tzv;
-
- tz->tz_minuteswest = tb.timezone; /* minutes west of Greenwich */
- tz->tz_dsttime = tb.dstflag; /* type of dst correction */
- }
- return 0;
-}
-
/* Emulate fdutimens. */
/* Set the access and modification time stamps of FD (a.k.a. FILE) to be