Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Use a consistent approach for rump kernel calls made by libs.



details:   https://anonhg.NetBSD.org/src/rev/44401ead1098
branches:  trunk
changeset: 759640:44401ead1098
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Dec 14 08:04:14 2010 +0000

description:
Use a consistent approach for rump kernel calls made by libs.
Should investigate a dynamic approach in the future.

diffstat:

 common/lib/libprop/prop_kern.c |   7 ++++++-
 usr.sbin/envstat/Makefile      |   6 +++++-
 usr.sbin/envstat/envstat.c     |  18 ++----------------
 3 files changed, 13 insertions(+), 18 deletions(-)

diffs (77 lines):

diff -r 2e9971450e9e -r 44401ead1098 common/lib/libprop/prop_kern.c
--- a/common/lib/libprop/prop_kern.c    Tue Dec 14 06:02:21 2010 +0000
+++ b/common/lib/libprop/prop_kern.c    Tue Dec 14 08:04:14 2010 +0000
@@ -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)
 {
diff -r 2e9971450e9e -r 44401ead1098 usr.sbin/envstat/Makefile
--- a/usr.sbin/envstat/Makefile Tue Dec 14 06:02:21 2010 +0000
+++ b/usr.sbin/envstat/Makefile Tue Dec 14 08:04:14 2010 +0000
@@ -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}
 
diff -r 2e9971450e9e -r 44401ead1098 usr.sbin/envstat/envstat.c
--- a/usr.sbin/envstat/envstat.c        Tue Dec 14 06:02:21 2010 +0000
+++ b/usr.sbin/envstat/envstat.c        Tue Dec 14 08:04:14 2010 +0000
@@ -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             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;



Home | Main Index | Thread Index | Old Index