mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Include Sequent support. (Thanks to Matt Nelson <nelsonm@ctron.com>).
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@464 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
259bf6d783
commit
d61783e463
1 changed files with 27 additions and 0 deletions
|
@ -37,6 +37,33 @@
|
||||||
/* There are several places where I need to deal with tz more intelligently */
|
/* There are several places where I need to deal with tz more intelligently */
|
||||||
/* I should allow customization of a strftime() format string for printing. */
|
/* I should allow customization of a strftime() format string for printing. */
|
||||||
|
|
||||||
|
#ifdef _SEQUENT_
|
||||||
|
/* Sequent does not provide us with gettimeofday(). */
|
||||||
|
int gettimeofday(tvp, tzp)
|
||||||
|
struct timeval *tvp;
|
||||||
|
struct timezone *tzp;
|
||||||
|
{
|
||||||
|
/* struct timespec is struct timeval with nanosecond resolution */
|
||||||
|
/* requires <sys/timers.h> */
|
||||||
|
static struct timespec tsp;
|
||||||
|
|
||||||
|
getclock(TIMEOFDAY, &tsp);
|
||||||
|
tvp->tv_sec = tsp.tv_sec;
|
||||||
|
tvp->tv_usec = (time_t)(tsp.tv_nsec/1000);
|
||||||
|
|
||||||
|
if (tzp) {
|
||||||
|
/* set external variables timezone (seconds between timezone */
|
||||||
|
/* and UTC), altzone (seconds between alternate timezone and */
|
||||||
|
/* UTC), and daylight (non-zero if alternate timezone) based */
|
||||||
|
/* on TZ environment variable */
|
||||||
|
/* requires <time.h> */
|
||||||
|
tzset();
|
||||||
|
tzp->tz_minuteswest = (int)(timezone/60);
|
||||||
|
tzp->tz_dsttime = daylight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* _SEQUENT_ */
|
||||||
|
|
||||||
/* tmp for passing to gettimeofday() */
|
/* tmp for passing to gettimeofday() */
|
||||||
static struct timeval _Time_tv;
|
static struct timeval _Time_tv;
|
||||||
static struct timezone _Time_tz;
|
static struct timezone _Time_tz;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue