Support RUMP_ACTION to compile a rump kernel client.

This commit is contained in:
pooka 2010-11-04 23:36:10 +00:00
parent 23c2b7b527
commit ddce2e059a
2 changed files with 26 additions and 4 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.23 2006/08/26 15:26:02 matt Exp $
# $NetBSD: Makefile,v 1.24 2010/11/04 23:36:10 pooka Exp $
# @(#)Makefile 8.1 (Berkeley) 6/5/93
.include <bsd.own.mk>
@ -20,4 +20,15 @@ CPPFLAGS+=-DINET6
# keywords.c keywords.h : keywords.sh
# ${HOST_SH} keywords.sh
#
# Compile-time debug flag. If compiled with "make RUMP_ACTION=1",
# make rump system calls.
#
.ifdef RUMP_ACTION
CPPFLAGS+= -DRUMP_SYS_NETWORKING -DRUMP_SYS_READWRITE -DRUMP_SYS_CLOSE
CPPFLAGS+= -DRUMP_ACTION -DSMALL -Dsysctl=rump_sys___sysctl
LDADD+= -lrumpclient
DBG= -g
.endif
.include <bsd.prog.mk>

View File

@ -1,4 +1,4 @@
/* $NetBSD: route.c,v 1.121 2010/06/26 14:29:36 kefren Exp $ */
/* $NetBSD: route.c,v 1.122 2010/11/04 23:36:10 pooka Exp $ */
/*
* Copyright (c) 1983, 1989, 1991, 1993
@ -39,7 +39,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1989, 1991, 1993\
#if 0
static char sccsid[] = "@(#)route.c 8.6 (Berkeley) 4/28/95";
#else
__RCSID("$NetBSD: route.c,v 1.121 2010/06/26 14:29:36 kefren Exp $");
__RCSID("$NetBSD: route.c,v 1.122 2010/11/04 23:36:10 pooka Exp $");
#endif
#endif /* not lint */
@ -71,6 +71,12 @@ __RCSID("$NetBSD: route.c,v 1.121 2010/06/26 14:29:36 kefren Exp $");
#include <paths.h>
#include <err.h>
#ifdef RUMP_ACTION
#include <rump/rump.h>
#include <rump/rump_syscalls.h>
#include <rump/rumpclient.h>
#endif
#include "keywords.h"
#include "extern.h"
@ -154,7 +160,12 @@ usage(const char *cp)
int
main(int argc, char * const *argv)
{
int ch;
int ch, error;
#ifdef RUMP_ACTION
if ((error = rumpclient_init()) != 0)
errx(1, "rump client init: %s", strerror(error));
#endif
if (argc < 2)
usage(NULL);