]> xenbits.xensource.com Git - libvirt.git/commitdiff
add virKillProcess
authorGuido Günther <agx@sigxcpu.org>
Tue, 6 Jan 2009 17:46:46 +0000 (17:46 +0000)
committerGuido Günther <agx@sigxcpu.org>
Tue, 6 Jan 2009 17:46:46 +0000 (17:46 +0000)
ChangeLog
src/libvirt_private.syms
src/util.c
src/util.h

index 30b5228471f5325d4482fbb4419b02e59647aa42..f777e1ec29e58a3ff38158f6a6c3d4d34d98a73d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jan  6 18:44:34 CET 2009 Guido Günther <agx@sigxcpu.org>
+
+       add virKillProcess
+       * src/util.[ch] (virKillProcess): new function
+       * src/libvirt_private.syms: add symbol
+
 Tue Jan  6 18:14:31 CET 2009 Guido Günther <agx@sigxcpu.org>
 
        trivial cleanups
index 90bcc681a49d3ad06c58e0d4f0ef065c76e004ab..f502e12e7e859e589d64dbcbf3e8841b7ff71d16 100644 (file)
@@ -292,6 +292,7 @@ virParseNumber;
 virAsprintf;
 virRun;
 virSkipSpaces;
+virKillProcess;
 
 
 # uuid.h
index f324bdf7c28deeed53b5e4751cdc14fda9435492..dd18522635c10527177d76677d44a47e8bfc1426 100644 (file)
@@ -1337,3 +1337,14 @@ int virDiskNameToIndex(const char *name) {
 
     return idx;
 }
+
+/* send signal to a single process */
+int virKillProcess(pid_t pid, int sig)
+{
+    if (pid < 1) {
+        errno = ESRCH;
+        return -1;
+    }
+
+    return kill(pid, sig);
+}
index 87ac908714e0fc0497892e8155b7934406ee83ff..f622bad06c63c9774b47a32f7ea8b95ec495fd28 100644 (file)
@@ -166,4 +166,6 @@ static inline int getuid (void) { return 0; }
 static inline int getgid (void) { return 0; }
 #endif
 
+int virKillProcess(pid_t pid, int sig);
+
 #endif /* __VIR_UTIL_H__ */