1
0
mirror of https://github.com/PDP-10/klh10.git synced 2026-02-06 16:35:39 +00:00
Files
PDP-10.klh10/contrib/backwr/sysdep.c
Olaf Seibert 58b59dbaa1 Overlay panda-dist/klh10-2.0h
by the late MRC, Mark Crispin.
Source: probably the former http://panda.com/tops-20/ .
panda-dist.tar.gz dated Mar 30  2007.
2015-04-27 23:07:21 +02:00

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);
}