Process_VMS.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. //
  2. // Process_VMS.h
  3. //
  4. // $Id: //poco/1.4/Foundation/include/Poco/Process_VMS.h#3 $
  5. //
  6. // Library: Foundation
  7. // Package: Processes
  8. // Module: Process
  9. //
  10. // Definition of the ProcessImpl class for OpenVMS.
  11. //
  12. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  13. // and Contributors.
  14. //
  15. // SPDX-License-Identifier: BSL-1.0
  16. //
  17. #ifndef Foundation_Process_VMS_INCLUDED
  18. #define Foundation_Process_VMS_INCLUDED
  19. #include "Poco/Foundation.h"
  20. #include "Poco/RefCountedObject.h"
  21. #include <vector>
  22. #include <map>
  23. #include <unistd.h>
  24. namespace Poco {
  25. class Pipe;
  26. class ProcessHandleImpl: public RefCountedObject
  27. {
  28. public:
  29. ProcessHandleImpl(pid_t pid);
  30. ~ProcessHandleImpl();
  31. pid_t id() const;
  32. int wait() const;
  33. private:
  34. pid_t _pid;
  35. };
  36. class ProcessImpl
  37. {
  38. public:
  39. typedef pid_t PIDImpl;
  40. typedef std::vector<std::string> ArgsImpl;
  41. typedef std::map<std::string, std::string> EnvImpl;
  42. static PIDImpl idImpl();
  43. static void timesImpl(long& userTime, long& kernelTime);
  44. static ProcessHandleImpl* launchImpl(
  45. const std::string& command,
  46. const ArgsImpl& args,
  47. const std::string& initialDirectory,
  48. Pipe* inPipe,
  49. Pipe* outPipe,
  50. Pipe* errPipe,
  51. const EnvImpl& env);
  52. static int waitImpl(PIDImpl pid);
  53. static void killImpl(ProcessHandleImpl& handle);
  54. static void killImpl(PIDImpl pid);
  55. static bool isRunningImpl(const ProcessHandleImpl& handle);
  56. static bool isRunningImpl(PIDImpl pid);
  57. static void requestTerminationImpl(PIDImpl pid);
  58. };
  59. } // namespace Poco
  60. #endif // Foundation_Process_VMS_INCLUDED