Module Name: src
Committed By: pooka
Date: Tue Feb 15 10:35:06 UTC 2011
Modified Files:
src/sys/rump/include/rump: rumpuser.h
src/sys/rump/librump/rumpkern: rump.c
Log Message:
Add an "exec" callback for the proxy code. The client can now
notify the rump kernel of an exec having taken place.
To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/rump/include/rump/rumpuser.h
cvs rdiff -u -r1.229 -r1.230 src/sys/rump/librump/rumpkern/rump.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.65 src/sys/rump/include/rump/rumpuser.h:1.66
--- src/sys/rump/include/rump/rumpuser.h:1.65 Fri Jan 28 19:21:29 2011
+++ src/sys/rump/include/rump/rumpuser.h Tue Feb 15 10:35:05 2011
@@ -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);
};
Index: src/sys/rump/librump/rumpkern/rump.c
diff -u src/sys/rump/librump/rumpkern/rump.c:1.229 src/sys/rump/librump/rumpkern/rump.c:1.230
--- src/sys/rump/librump/rumpkern/rump.c:1.229 Thu Feb 10 13:31:55 2011
+++ src/sys/rump/librump/rumpkern/rump.c Tue Feb 15 10:35:05 2011
@@ -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;