diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-15 12:38:10 +1000 |
---|---|---|
committer | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2010-09-15 16:17:17 +1000 |
commit | 507a5a689e7441782fcdbe96d88068dee9a3145e (patch) | |
tree | 530da38ea52cdbb276327ca90aa8bcc4c5ca0e7b /win32 | |
parent | 9e713dacbf3b6f8d114a337271c57dfccec58af7 (diff) | |
download | busybox-w32-507a5a689e7441782fcdbe96d88068dee9a3145e.tar.gz busybox-w32-507a5a689e7441782fcdbe96d88068dee9a3145e.tar.bz2 busybox-w32-507a5a689e7441782fcdbe96d88068dee9a3145e.zip |
win32: process.c: implement kill(), SIGTERM only
Diffstat (limited to 'win32')
-rw-r--r-- | win32/process.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/win32/process.c b/win32/process.c index 1b9b61878..cdd71182b 100644 --- a/win32/process.c +++ b/win32/process.c | |||
@@ -317,3 +317,20 @@ procps_status_t* FAST_FUNC procps_scan(procps_status_t* sp, int flags) | |||
317 | strncpy(sp->comm, pe.szExeFile, COMM_LEN); | 317 | strncpy(sp->comm, pe.szExeFile, COMM_LEN); |
318 | return sp; | 318 | return sp; |
319 | } | 319 | } |
320 | |||
321 | int kill(pid_t pid, int sig) | ||
322 | { | ||
323 | HANDLE h; | ||
324 | |||
325 | if (sig != SIGTERM) { | ||
326 | bb_error_msg("kill only supports SIGTERM"); | ||
327 | errno = ENOSYS; | ||
328 | return -1; | ||
329 | } | ||
330 | h = OpenProcess(PROCESS_TERMINATE, FALSE, pid); | ||
331 | if (h == NULL) | ||
332 | return -1; | ||
333 | if (TerminateProcess(h, 0) == 0) | ||
334 | return -1; | ||
335 | return 0; | ||
336 | } | ||