Use uname(2) to get OS name and arch.

This commit is contained in:
Garrett Wollman 1994-02-03 23:23:18 +00:00
parent 348d23490a
commit 357bd33b86
2 changed files with 11 additions and 15 deletions

View File

@ -1,5 +1,5 @@
#
# $Id: Makefile,v 1.2 1993/12/22 11:33:47 rgrimes Exp $
# $Id: Makefile,v 1.3 1993/12/23 10:21:55 rgrimes Exp $
#
CFLAGS+= -I${.CURDIR}/../include
@ -34,7 +34,8 @@ SRCS= ntp_config.c ntp_control.c ntp_io.c ntp_leap.c \
refclock_wwvb.c refclock_goes.c refclock_mx4200.c \
refclock_parse.c refclock_as2201.c refclock_omega.c \
refclock_tpro.c refclock_leitch.c refclock_irig.c \
refclock_msfees.c ntp_intres.c ntp_filegen.c version.c
refclock_msfees.c refclock_gpstm.c ntp_intres.c \
ntp_filegen.c version.c
beforedepend: version.c

View File

@ -264,15 +264,8 @@ static u_char def_clock_var[] = {
/*
* System and processor definitions. These will change for the gizmo board.
*/
#ifndef STR_SYSTEM
#define STR_SYSTEM "UNIX"
#endif
#ifndef STR_PROCESSOR
#define STR_PROCESSOR "unknown"
#endif
static char str_system[] = STR_SYSTEM;
static char str_processor[] = STR_PROCESSOR;
#include <sys/utsname.h>
static struct utsname utsname;
/*
* Trap structures. We only allow a few of these, and send
@ -433,6 +426,8 @@ init_control()
{
int i;
uname(&utsname);
ctl_clr_stats();
ctl_auth_keyid = 0;
@ -1267,12 +1262,12 @@ ctl_putsys(varid)
ctl_putuint(sys_var[CS_LEAPWARNING].text, (U_LONG)leap_warning);
break;
case CS_PROCESSOR:
ctl_putstr(sys_var[CS_PROCESSOR].text, str_processor,
sizeof(str_processor) - 1);
ctl_putstr(sys_var[CS_PROCESSOR].text, utsname.machine,
strlen(utsname.machine));
break;
case CS_SYSTEM:
ctl_putstr(sys_var[CS_SYSTEM].text, str_system,
sizeof(str_system) - 1);
ctl_putstr(sys_var[CS_SYSTEM].text, utsname.sysname,
strlen(utsname.sysname));
break;
case CS_KEYID:
ctl_putuint(sys_var[CS_KEYID].text, (U_LONG)0);