{
timet timv;
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
timv = time (NULL);
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (timv == -1)
SCM_MISC_ERROR ("current time not available", SCM_EOL);
return scm_from_long (timv);
struct timeval time;
int ret, err;
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
ret = gettimeofday (&time, NULL);
err = errno;
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (ret == -1)
{
errno = err;
timet timv;
int err;
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
timv = time (NULL);
err = errno;
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (timv == -1)
{
errno = err;
/* deferring interupts is essential since a) setzone may install a temporary
environment b) localtime uses a static buffer. */
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
oldenv = setzone (zone, SCM_ARG2, FUNC_NAME);
#ifdef LOCALTIME_CACHE
tzset ();
zoff += 24 * 60 * 60;
result = filltime (<, zoff, zname);
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (zname)
free (zname);
return result;
#if HAVE_GMTIME_R
bd_time = gmtime_r (&itime, &bd_buf);
#else
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
bd_time = gmtime (&itime);
if (bd_time != NULL)
bd_buf = *bd_time;
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
#endif
if (bd_time == NULL)
SCM_SYSERROR;
scm_frame_free ((char *)lt.tm_zone);
#endif
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
oldenv = setzone (zone, SCM_ARG2, FUNC_NAME);
#ifdef LOCALTIME_CACHE
tzset ();
result = scm_cons (scm_from_long (itime),
filltime (<, zoff, zname));
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (zname)
free (zname);
SCM_EOL)));
have_zone = 1;
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
oldenv = setzone (zone, SCM_ARG2, FUNC_NAME);
}
#endif
if (have_zone)
{
restorezone (velts[10], oldenv, FUNC_NAME);
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
}
#endif
}
/* GNU glibc strptime() "%s" is affected by the current timezone, since it
reads a UTC time_t value and converts with localtime_r() to set the tm
- fields, hence the use of SCM_DEFER_INTS. */
+ fields, hence the use of SCM_CRITICAL_SECTION_START. */
t.tm_isdst = -1;
- SCM_DEFER_INTS;
+ SCM_CRITICAL_SECTION_START;
rest = strptime (str, fmt, &t);
- SCM_ALLOW_INTS;
+ SCM_CRITICAL_SECTION_END;
if (rest == NULL)
{
/* POSIX doesn't say strptime sets errno, and on glibc 2.3.2 for