#include <pidfd.h>
|
static absl::StatusOr< PidFd > | FromRunningProcess (pid_t pid) |
|
static absl::StatusOr< PidFd > | LaunchSubprocess (absl::Span< const std::string > argv, std::vector< std::pair< sapi::file_util::fileops::FDCloser, int > > fds, absl::Span< const std::string > env) |
|
|
sapi::file_util::fileops::FDCloser | fd_ |
|
pid_t | pid_ |
|
◆ PidFd()
cuttlefish::process_sandboxer::PidFd::PidFd |
( |
sapi::file_util::fileops::FDCloser |
, |
|
|
pid_t |
|
|
) |
| |
|
private |
◆ AllFds()
absl::StatusOr< std::vector< std::pair< FDCloser, int > > > cuttlefish::process_sandboxer::PidFd::AllFds |
( |
| ) |
|
Copies file descriptors from the target process, mapping them into the current process.
Keys are file descriptor numbers in the target process, values are open file descriptors in the current process.
◆ Argv()
absl::StatusOr< std::vector< std::string > > cuttlefish::process_sandboxer::PidFd::Argv |
( |
| ) |
|
◆ Env()
absl::StatusOr< std::vector< std::string > > cuttlefish::process_sandboxer::PidFd::Env |
( |
| ) |
|
◆ FromRunningProcess()
absl::StatusOr< PidFd > cuttlefish::process_sandboxer::PidFd::FromRunningProcess |
( |
pid_t |
pid | ) |
|
|
static |
Returns a managed pidfd tracking a previously started process with pid
.
Only reliably refers to the process pid
if the caller can guarantee it was not reaped while this is executing, otherwise it may refer to an unknown process.
◆ Get()
int cuttlefish::process_sandboxer::PidFd::Get |
( |
| ) |
const |
◆ HaltChildHierarchy()
absl::Status cuttlefish::process_sandboxer::PidFd::HaltChildHierarchy |
( |
| ) |
|
Halt all descendants of the process. Only safe to use if the caller guarantees the process doesn't spawn or reap any children while running.
◆ HaltHierarchy()
absl::Status cuttlefish::process_sandboxer::PidFd::HaltHierarchy |
( |
| ) |
|
Halt the process and all its descendants.
◆ LaunchSubprocess()
absl::StatusOr< PidFd > cuttlefish::process_sandboxer::PidFd::LaunchSubprocess |
( |
absl::Span< const std::string > |
argv, |
|
|
std::vector< std::pair< sapi::file_util::fileops::FDCloser, int > > |
fds, |
|
|
absl::Span< const std::string > |
env |
|
) |
| |
|
static |
Launches a subprocess and returns a pidfd tracking the newly launched process.
◆ SendSignal()
absl::Status cuttlefish::process_sandboxer::PidFd::SendSignal |
( |
int |
signal | ) |
|
|
private |
◆ fd_
sapi::file_util::fileops::FDCloser cuttlefish::process_sandboxer::PidFd::fd_ |
|
private |
◆ pid_
pid_t cuttlefish::process_sandboxer::PidFd::pid_ |
|
private |
The documentation for this class was generated from the following files:
- cuttlefish/host/commands/process_sandboxer/pidfd.h
- cuttlefish/host/commands/process_sandboxer/pidfd.cpp