Source-Changes-HG archive

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

[src/trunk]: src/sys/rump Add an "exec" callback for the proxy code. The cli...



details:   https://anonhg.NetBSD.org/src/rev/2c70781db8b6
branches:  trunk
changeset: 762081:2c70781db8b6
user:      pooka <pooka%NetBSD.org@localhost>
date:      Tue Feb 15 10:35:05 2011 +0000

description:
Add an "exec" callback for the proxy code.  The client can now
notify the rump kernel of an exec having taken place.

diffstat:

 sys/rump/include/rump/rumpuser.h |   5 +++--
 sys/rump/librump/rumpkern/rump.c |  17 +++++++++++++++--
 2 files changed, 18 insertions(+), 4 deletions(-)

diffs (78 lines):

diff -r 3c60c33b2032 -r 2c70781db8b6 sys/rump/include/rump/rumpuser.h
--- a/sys/rump/include/rump/rumpuser.h  Tue Feb 15 10:32:56 2011 +0000
+++ b/sys/rump/include/rump/rumpuser.h  Tue Feb 15 10:35:05 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rumpuser.h,v 1.65 2011/01/28 19:21:29 pooka Exp $      */
+/*     $NetBSD: rumpuser.h,v 1.66 2011/02/15 10:35:05 pooka Exp $      */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -36,7 +36,7 @@
 #include <stdint.h>
 #endif
 
-#define RUMPUSER_VERSION 12
+#define RUMPUSER_VERSION 13
 int rumpuser_getversion(void);
 
 int rumpuser_daemonize_begin(void);
@@ -219,6 +219,7 @@
        struct lwp * (*spop_lwproc_curlwp)(void);
        int (*spop_syscall)(int, void *, register_t *);
        void (*spop_procexit)(void);
+       void (*spop_execnotify)(const char *);
        pid_t (*spop_getpid)(void);
 };
 
diff -r 3c60c33b2032 -r 2c70781db8b6 sys/rump/librump/rumpkern/rump.c
--- a/sys/rump/librump/rumpkern/rump.c  Tue Feb 15 10:32:56 2011 +0000
+++ b/sys/rump/librump/rumpkern/rump.c  Tue Feb 15 10:35:05 2011 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rump.c,v 1.229 2011/02/10 13:31:55 pooka Exp $ */
+/*     $NetBSD: rump.c,v 1.230 2011/02/15 10:35:05 pooka Exp $ */
 
 /*
  * Copyright (c) 2007 Antti Kantee.  All Rights Reserved.
@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.229 2011/02/10 13:31:55 pooka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rump.c,v 1.230 2011/02/15 10:35:05 pooka Exp $");
 
 #include <sys/systm.h>
 #define ELFSIZE ARCH_ELFSIZE
@@ -102,6 +102,7 @@
 static int rump_proxy_syscall(int, void *, register_t *);
 static int rump_proxy_rfork(void *, int, const char *);
 static void rump_proxy_procexit(void);
+static void rump_proxy_execnotify(const char *);
 
 static char rump_msgbuf[16*1024]; /* 16k should be enough for std rump needs */
 
@@ -214,6 +215,7 @@
        .spop_lwproc_curlwp     = rump_lwproc_curlwp,
        .spop_procexit          = rump_proxy_procexit,
        .spop_syscall           = rump_proxy_syscall,
+       .spop_execnotify        = rump_proxy_execnotify,
        .spop_getpid            = spgetpid,
 };
 
@@ -780,6 +782,17 @@
 }
 
 static void
+rump_proxy_execnotify(const char *comm)
+{
+       struct proc *p = curproc;
+
+       strlcpy(p->p_comm, comm, sizeof(p->p_comm));
+
+       /* TODO: apply CLOEXEC */
+       /* TODO: other stuff? */
+}
+
+static void
 rump_proxy_procexit(void)
 {
        struct proc *p = curproc;



Home | Main Index | Thread Index | Old Index