Module Name: src
Committed By: pooka
Date: Wed Apr 21 11:13:29 UTC 2010
Modified Files:
src/lib/librumpuser: rumpuser.c
src/sys/rump/include/rump: rumpuser.h
Log Message:
Add rumpuser_kill, which sends a signal to a host process.
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/lib/librumpuser/rumpuser.c
cvs rdiff -u -r1.38 -r1.39 src/sys/rump/include/rump/rumpuser.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/librumpuser/rumpuser.c
diff -u src/lib/librumpuser/rumpuser.c:1.1 src/lib/librumpuser/rumpuser.c:1.2
--- src/lib/librumpuser/rumpuser.c:1.1 Fri Feb 26 18:54:20 2010
+++ src/lib/librumpuser/rumpuser.c Wed Apr 21 11:13:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.c,v 1.1 2010/02/26 18:54:20 pooka Exp $ */
+/* $NetBSD: rumpuser.c,v 1.2 2010/04/21 11:13:29 pooka Exp $ */
/*
* Copyright (c) 2007-2010 Antti Kantee. All Rights Reserved.
@@ -27,7 +27,7 @@
#include <sys/cdefs.h>
#if !defined(lint)
-__RCSID("$NetBSD: rumpuser.c,v 1.1 2010/02/26 18:54:20 pooka Exp $");
+__RCSID("$NetBSD: rumpuser.c,v 1.2 2010/04/21 11:13:29 pooka Exp $");
#endif /* !lint */
/* thank the maker for this */
@@ -53,6 +53,7 @@
#include <errno.h>
#include <fcntl.h>
#include <poll.h>
+#include <signal.h>
#include <stdarg.h>
#include <stdint.h>
#include <stdio.h>
@@ -571,3 +572,14 @@
return rv;
}
+
+int
+rumpuser_kill(int64_t pid, int sig, int *error)
+{
+
+ if (pid == RUMPUSER_PID_SELF) {
+ DOCALL(int, raise(sig));
+ } else {
+ DOCALL(int, kill((pid_t)pid, sig));
+ }
+}
Index: src/sys/rump/include/rump/rumpuser.h
diff -u src/sys/rump/include/rump/rumpuser.h:1.38 src/sys/rump/include/rump/rumpuser.h:1.39
--- src/sys/rump/include/rump/rumpuser.h:1.38 Fri Mar 5 18:47:49 2010
+++ src/sys/rump/include/rump/rumpuser.h Wed Apr 21 11:13:29 2010
@@ -1,4 +1,4 @@
-/* $NetBSD: rumpuser.h,v 1.38 2010/03/05 18:47:49 pooka Exp $ */
+/* $NetBSD: rumpuser.h,v 1.39 2010/04/21 11:13:29 pooka Exp $ */
/*
* Copyright (c) 2007 Antti Kantee. All Rights Reserved.
@@ -97,6 +97,9 @@
int rumpuser_putchar(int, int *);
+#define RUMPUSER_PID_SELF ((int64_t)-1)
+int rumpuser_kill(int64_t, int, int *);
+
#define RUMPUSER_PANIC (-1)
void rumpuser_exit(int);
void rumpuser_seterrno(int);