Process_VMS.h 1.5 KB

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