Use a consistent approach for rump kernel calls made by libs.

Should investigate a dynamic approach in the future.
This commit is contained in:
pooka 2010-12-14 08:04:14 +00:00
parent d56adbbf56
commit 57ec646236
3 changed files with 13 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: prop_kern.c,v 1.13 2009/10/11 12:13:45 bad Exp $ */
/* $NetBSD: prop_kern.c,v 1.14 2010/12/14 08:04:14 pooka Exp $ */
/*-
* Copyright (c) 2006, 2009 The NetBSD Foundation, Inc.
@ -43,6 +43,11 @@
#include <stdlib.h>
#include <stdio.h>
#ifdef RUMP_ACTION
#include <rump/rump_syscalls.h>
#define ioctl(a,b,c) rump_sys_ioctl(a,b,c)
#endif
static int
_prop_object_externalize_to_pref(prop_object_t obj, struct plistref *pref, char **bufp)
{

View File

@ -1,8 +1,12 @@
# $NetBSD: Makefile,v 1.9 2010/12/13 18:00:38 pooka Exp $
# $NetBSD: Makefile,v 1.10 2010/12/14 08:04:14 pooka Exp $
RUMPPRG= envstat
SRCS+= envstat.c config.c config_yacc.y config_lex.l
.PATH: ${.CURDIR}/../../common/lib/libprop
CPPFLAGS+= -DRUMP_ACTION
RUMPSRCS+= prop_kern.c
LDADD= -lprop
DPADD= ${LIBPROP}

View File

@ -1,4 +1,4 @@
/* $NetBSD: envstat.c,v 1.83 2010/12/13 18:00:38 pooka Exp $ */
/* $NetBSD: envstat.c,v 1.84 2010/12/14 08:04:14 pooka Exp $ */
/*-
* Copyright (c) 2007, 2008 Juan Romero Pardines.
@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: envstat.c,v 1.83 2010/12/13 18:00:38 pooka Exp $");
__RCSID("$NetBSD: envstat.c,v 1.84 2010/12/14 08:04:14 pooka Exp $");
#endif /* not lint */
#include <stdio.h>
@ -117,20 +117,6 @@ static int usage(void);
static int sysmonfd; /* fd of /dev/sysmon */
/* sneak in between ioctl() */
int
ioctl(int fd, unsigned long request, ...)
{
va_list ap;
int rv;
va_start(ap, request);
rv = prog_ioctl(fd, request, va_arg(ap, void *));
va_end(ap);
return rv;
}
int main(int argc, char **argv)
{
prop_dictionary_t dict;