mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-08-27 02:51:16 +00:00
add virKillProcess
This commit is contained in:
parent
ffafc252dd
commit
83467de3ed
@ -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
|
||||
|
@ -292,6 +292,7 @@ virParseNumber;
|
||||
virAsprintf;
|
||||
virRun;
|
||||
virSkipSpaces;
|
||||
virKillProcess;
|
||||
|
||||
|
||||
# uuid.h
|
||||
|
11
src/util.c
11
src/util.c
@ -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);
|
||||
}
|
||||
|
@ -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__ */
|
||||
|
Loading…
Reference in New Issue
Block a user