diff options
| author | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-08 19:50:27 +0000 |
|---|---|---|
| committer | Mikhail Glushenkov <foldr@codedgers.com> | 2009-09-08 19:50:27 +0000 |
| commit | 4a91b7605b41c4677097e970005ba3a7d045032f (patch) | |
| tree | c5cc6bbbad8cba285d5e571dfead5306d383703a /llvm/lib/System/Unix | |
| parent | b17a190186c8bc07e304b69b29bd241d8cfc6c92 (diff) | |
| download | bcm5719-llvm-4a91b7605b41c4677097e970005ba3a7d045032f.tar.gz bcm5719-llvm-4a91b7605b41c4677097e970005ba3a7d045032f.zip | |
Add a Kill() function to the Program class.
llvm-svn: 81246
Diffstat (limited to 'llvm/lib/System/Unix')
| -rw-r--r-- | llvm/lib/System/Unix/Program.inc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/System/Unix/Program.inc b/llvm/lib/System/Unix/Program.inc index fca92923825..fdd0c25fd14 100644 --- a/llvm/lib/System/Unix/Program.inc +++ b/llvm/lib/System/Unix/Program.inc @@ -283,6 +283,16 @@ Program::Wait(unsigned secondsToWait, } +bool +Program::Kill(std::string* ErrMsg) { + if (Pid_ == 0) { + MakeErrMsg(ErrMsg, "Process not started!"); + return true; + } + + return (kill(Pid_, SIGKILL) == 0); +} + bool Program::ChangeStdinToBinary(){ // Do nothing, as Unix doesn't differentiate between text and binary. return false; |

