00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00018 #ifndef BOOST_PROCESS_POSIX_CONTEXT_HPP
00019 #define BOOST_PROCESS_POSIX_CONTEXT_HPP
00020
00021 #include <boost/process/context.hpp>
00022 #include <boost/process/stream_behavior.hpp>
00023 #include <map>
00024 #include <string>
00025 #include <unistd.h>
00026
00027 namespace boost {
00028 namespace process {
00029
00034 typedef std::map<int, stream_behavior> behavior_map;
00035
00036 template <class Path>
00037 class posix_basic_context : public basic_work_directory_context<Path>, public environment_context
00038 {
00039 public:
00051 posix_basic_context()
00052 : uid(::getuid()),
00053 euid(::geteuid()),
00054 gid(::getgid()),
00055 egid(::getegid())
00056 {
00057 }
00058
00062 behavior_map input_behavior;
00063
00067 behavior_map output_behavior;
00068
00075 uid_t uid;
00076
00083 uid_t euid;
00084
00091 gid_t gid;
00092
00099 gid_t egid;
00100
00107 Path chroot;
00108 };
00109
00113 typedef posix_basic_context<std::string> posix_context;
00114
00115 }
00116 }
00117
00118 #endif