/* SPDX-License-Identifier: LGPL-2.1-or-later */ /* * Copyright (C) 2019, Google Inc. * * process.h - Process object */ #ifndef __LIBCAMERA_PROCESS_H__ #define __LIBCAMERA_PROCESS_H__ #include #include #include namespace libcamera { class Process final { public: enum ExitStatus { NotExited, NormalExit, SignalExit, }; Process(); ~Process(); int start(const std::string &path, const std::vector &args = std::vector(), const std::vector &fds = std::vector()); ExitStatus exitStatus() const { return exitStatus_; } int exitCode() const { return exitCode_; } void kill(); Signal finished; private: void closeAllFdsExcept(const std::vector &fds); int isolate(); void died(int wstatus); pid_t pid_; bool running_; enum ExitStatus exitStatus_; int exitCode_; friend class ProcessManager; }; } /* namespace libcamera */ #endif /* __LIBCAMERA_PROCESS_H__ */