summaryrefslogtreecommitdiffstats
path: root/util.h
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2009-04-01 14:49:12 -0700
committerJosh Stone <jistone@redhat.com>2009-04-01 15:39:04 -0700
commit4cc40e829870dd6a1d9714706d38f5fd4b2ec982 (patch)
tree9c9607d35b5b4c9578b057627d4542836b67875c /util.h
parent0dbfd2a9ccad1759c58f240843cabc50d502e44a (diff)
downloadsystemtap-steved-4cc40e829870dd6a1d9714706d38f5fd4b2ec982.tar.gz
systemtap-steved-4cc40e829870dd6a1d9714706d38f5fd4b2ec982.tar.xz
systemtap-steved-4cc40e829870dd6a1d9714706d38f5fd4b2ec982.zip
PR10016: Purge stap of all pgrp and system() usage
We hereby no longer try to manipulate process groups in any way. We don't set a private process group, and we never kill() our entire group either. Instead of using system(), we now have a stap_system() which saves the child PID, so when we get a terminating signal we can pass it along to the child. Signals sent through the TTY have always worked, since the TTY sends it to the entire pgrp. However, if we're running as part of a wrapper script or GUI, which may not have a separate process group for stap, we still would like to allow "kill -TERM $STAPPID" to terminate stap nicely. There's still a short window of failure in the time that staprun is active, because we can't kill a setuid process from a user process. Once staprun drops privileges and execs to stapio though, everything should work fine.
Diffstat (limited to 'util.h')
-rw-r--r--util.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/util.h b/util.h
index d385be02..7c557049 100644
--- a/util.h
+++ b/util.h
@@ -13,6 +13,8 @@ void tokenize(const std::string& str, std::vector<std::string>& tokens,
std::string find_executable(const std::string& name);
const std::string cmdstr_quoted(const std::string& cmd);
std::string git_revision(const std::string& path);
+int stap_system(const char *command);
+int kill_stap_spawn(int sig);
// stringification generics