add virKillProcess

This commit is contained in:
Guido Günther 2009-01-06 17:46:46 +00:00
parent ffafc252dd
commit 83467de3ed
4 changed files with 20 additions and 0 deletions

View File

@ -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> Tue Jan 6 18:14:31 CET 2009 Guido Günther <agx@sigxcpu.org>
trivial cleanups trivial cleanups

View File

@ -292,6 +292,7 @@ virParseNumber;
virAsprintf; virAsprintf;
virRun; virRun;
virSkipSpaces; virSkipSpaces;
virKillProcess;
# uuid.h # uuid.h

View File

@ -1337,3 +1337,14 @@ int virDiskNameToIndex(const char *name) {
return idx; 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);
}

View File

@ -166,4 +166,6 @@ static inline int getuid (void) { return 0; }
static inline int getgid (void) { return 0; } static inline int getgid (void) { return 0; }
#endif #endif
int virKillProcess(pid_t pid, int sig);
#endif /* __VIR_UTIL_H__ */ #endif /* __VIR_UTIL_H__ */