Merged contents of time_dep1.c into time1.c.
There was nothing OS-specific left.
This commit is contained in:
parent
c594e945d3
commit
f2c4ddb44d
|
@ -119,7 +119,6 @@ SCSHOBJS = \
|
||||||
scsh/dirstuff1.o \
|
scsh/dirstuff1.o \
|
||||||
scsh/fdports1.o \
|
scsh/fdports1.o \
|
||||||
scsh/flock1.o \
|
scsh/flock1.o \
|
||||||
scsh/machine/time_dep1.o \
|
|
||||||
scsh/signals1.o \
|
scsh/signals1.o \
|
||||||
scsh/machine/libansi.o \
|
scsh/machine/libansi.o \
|
||||||
scsh/network1.o \
|
scsh/network1.o \
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
31
scsh/time1.c
31
scsh/time1.c
|
@ -38,6 +38,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include <sys/time.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -451,6 +452,36 @@ char *tzname_loser(struct tm *dp)
|
||||||
** localtime() & gmtime() don't error.
|
** localtime() & gmtime() don't error.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Support for fine-grained timer.
|
||||||
|
** This used to be OS-dependent but the code below works on all systems
|
||||||
|
*/
|
||||||
|
|
||||||
|
s48_value time_plus_ticks()
|
||||||
|
{
|
||||||
|
struct timeval t;
|
||||||
|
struct timezone tz;
|
||||||
|
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
||||||
|
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
||||||
|
s48_value sch_listval = S48_UNSPECIFIC;
|
||||||
|
s48_value sch_retval = S48_UNSPECIFIC;
|
||||||
|
S48_DECLARE_GC_PROTECT(3);
|
||||||
|
|
||||||
|
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
||||||
|
|
||||||
|
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
||||||
|
|
||||||
|
|
||||||
|
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
||||||
|
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
||||||
|
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
||||||
|
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
||||||
|
|
||||||
|
S48_GC_UNPROTECT();
|
||||||
|
|
||||||
|
return sch_retval;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void s48_init_time(void)
|
void s48_init_time(void)
|
||||||
{
|
{
|
||||||
S48_EXPORT_FUNCTION(time_plus_ticks);
|
S48_EXPORT_FUNCTION(time_plus_ticks);
|
||||||
|
|
|
@ -1,39 +0,0 @@
|
||||||
/* OS-dependent support for fine-grained timer.
|
|
||||||
** Copyright (c) 1995 by Olin Shivers.
|
|
||||||
**
|
|
||||||
** We return the current time in seconds and sub-second "ticks" where the
|
|
||||||
** number of ticks/second is OS dependent (and is defined in time_dep.scm).
|
|
||||||
** This definition works on any BSD Unix with the gettimeofday()
|
|
||||||
** microsecond-resolution timer.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include <errno.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include "scheme48.h"
|
|
||||||
#include "../time1.h"
|
|
||||||
|
|
||||||
s48_value time_plus_ticks()
|
|
||||||
{
|
|
||||||
struct timeval t;
|
|
||||||
struct timezone tz;
|
|
||||||
s48_value sch_tv_sec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_tv_usec = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_listval = S48_UNSPECIFIC;
|
|
||||||
s48_value sch_retval = S48_UNSPECIFIC;
|
|
||||||
S48_DECLARE_GC_PROTECT(3);
|
|
||||||
|
|
||||||
S48_GC_PROTECT_3(sch_tv_sec, sch_tv_usec, sch_listval);
|
|
||||||
|
|
||||||
if( gettimeofday(&t, &tz) ) s48_raise_os_error (errno);
|
|
||||||
|
|
||||||
|
|
||||||
sch_tv_sec = s48_enter_integer(t.tv_sec);
|
|
||||||
sch_tv_usec = s48_enter_integer(t.tv_usec);
|
|
||||||
sch_listval = s48_cons (sch_tv_usec, S48_NULL);
|
|
||||||
sch_retval = s48_cons (sch_tv_sec, sch_listval);
|
|
||||||
|
|
||||||
S48_GC_UNPROTECT();
|
|
||||||
|
|
||||||
return sch_retval;
|
|
||||||
|
|
||||||
}
|
|
Loading…
Reference in New Issue