mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
(Mostly) internal change. Add pid()
accessor.
PiperOrigin-RevId: 397070773 Change-Id: I9ebac9078f3866ef3e0061ec79da5c9f71e5f480
This commit is contained in:
parent
aea8bb2ed0
commit
c400f92eaa
|
@ -99,10 +99,6 @@ bool Sandbox2::IsTerminated() const {
|
|||
return monitor_->IsDone();
|
||||
}
|
||||
|
||||
void Sandbox2::SetWallTimeLimit(time_t limit) const {
|
||||
set_walltime_limit(absl::Seconds(limit));
|
||||
}
|
||||
|
||||
void Sandbox2::set_walltime_limit(absl::Duration limit) const {
|
||||
if (limit == absl::ZeroDuration()) {
|
||||
VLOG(1) << "Disarming walltime timer to ";
|
||||
|
|
|
@ -95,7 +95,9 @@ class Sandbox2 final {
|
|||
// for responses after each request and reset the deadline in between.
|
||||
// Sandboxed API can be used to implement persistent sandboxes.
|
||||
ABSL_DEPRECATED("Use set_walltime_limit() instead")
|
||||
void SetWallTimeLimit(time_t limit) const;
|
||||
void SetWallTimeLimit(time_t limit) const {
|
||||
this->set_walltime_limit(absl::Seconds(limit));
|
||||
}
|
||||
|
||||
// Sets a wall time limit on a running sandboxee, absl::ZeroDuration() to
|
||||
// disarm. This can be useful in a persistent sandbox scenario, to impose a
|
||||
|
@ -103,8 +105,11 @@ class Sandbox2 final {
|
|||
// between. Sandboxed API can be used to implement persistent sandboxes.
|
||||
void set_walltime_limit(absl::Duration limit) const;
|
||||
|
||||
// Gets the pid inside the executor.
|
||||
pid_t GetPid() { return monitor_ != nullptr ? monitor_->pid_ : -1; }
|
||||
// Returns the process id inside the executor.
|
||||
ABSL_DEPRECATED("Use pid() instead")
|
||||
pid_t GetPid() { return this->pid(); }
|
||||
|
||||
pid_t pid() const { return monitor_ != nullptr ? monitor_->pid_ : -1; }
|
||||
|
||||
// Gets the comms inside the executor.
|
||||
Comms* comms() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user