mirror of
https://github.com/PDP-10/klh10.git
synced 2026-02-06 16:35:39 +00:00
by the late MRC, Mark Crispin. Source: probably the former http://panda.com/tops-20/ . panda-dist.tar.gz dated Mar 30 2007.
37 lines
595 B
C
37 lines
595 B
C
#include <time.h>
|
|
#include <sys/utsname.h>
|
|
|
|
typedef unsigned int bool;
|
|
# define false 0
|
|
# define true 1
|
|
|
|
int sy_getgmtoffset(void)
|
|
{
|
|
struct tm* tm;
|
|
time_t now;
|
|
static bool firsttime = true;
|
|
static int offset;
|
|
|
|
if (firsttime) {
|
|
now = time(NULL);
|
|
tm = localtime(&now);
|
|
offset = timegm(tm) - now;
|
|
firsttime = false;
|
|
}
|
|
|
|
return (offset);
|
|
}
|
|
|
|
char* sy_getsystem(void)
|
|
{
|
|
static struct utsname unameinfo;
|
|
static bool firsttime = true;
|
|
|
|
if (firsttime) {
|
|
(void) uname(&unameinfo); /* Get sysname etc. */
|
|
firsttime = false;
|
|
}
|
|
|
|
return(unameinfo.sysname);
|
|
}
|