mirror of
https://github.com/google/sandboxed-api.git
synced 2024-03-22 13:11:30 +08:00
Replace deprecated SetWalltimeLimit
call
PiperOrigin-RevId: 433414976 Change-Id: I0597a2d8215d4b228794da409e3533651972a98c
This commit is contained in:
parent
622ca18cef
commit
612ff57913
|
@ -38,6 +38,7 @@ cc_binary(
|
||||||
"@com_google_absl//absl/memory",
|
"@com_google_absl//absl/memory",
|
||||||
"@com_google_absl//absl/strings",
|
"@com_google_absl//absl/strings",
|
||||||
"@com_google_absl//absl/strings:str_format",
|
"@com_google_absl//absl/strings:str_format",
|
||||||
|
"@com_google_absl//absl/time",
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ add_executable(sandbox2::sandbox2tool ALIAS sandbox2_sandbox2tool)
|
||||||
target_link_libraries(sandbox2_sandbox2tool PRIVATE
|
target_link_libraries(sandbox2_sandbox2tool PRIVATE
|
||||||
absl::memory
|
absl::memory
|
||||||
absl::strings
|
absl::strings
|
||||||
|
absl::time
|
||||||
sandbox2::bpf_helper
|
sandbox2::bpf_helper
|
||||||
# sandbox2::ipc
|
# sandbox2::ipc
|
||||||
sandbox2::sandbox2
|
sandbox2::sandbox2
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "absl/memory/memory.h"
|
#include "absl/memory/memory.h"
|
||||||
#include "absl/strings/str_format.h"
|
#include "absl/strings/str_format.h"
|
||||||
#include "absl/strings/str_split.h"
|
#include "absl/strings/str_split.h"
|
||||||
|
#include "absl/time/time.h"
|
||||||
#include "sandboxed_api/sandbox2/executor.h"
|
#include "sandboxed_api/sandbox2/executor.h"
|
||||||
#include "sandboxed_api/sandbox2/ipc.h"
|
#include "sandboxed_api/sandbox2/ipc.h"
|
||||||
#include "sandboxed_api/sandbox2/limits.h"
|
#include "sandboxed_api/sandbox2/limits.h"
|
||||||
|
@ -202,7 +203,7 @@ int main(int argc, char** argv) {
|
||||||
sleep(3);
|
sleep(3);
|
||||||
kill(s2.pid(), SIGSTOP);
|
kill(s2.pid(), SIGSTOP);
|
||||||
sleep(3);
|
sleep(3);
|
||||||
s2.SetWallTimeLimit(3);
|
s2.set_walltime_limit(absl::Seconds(3));
|
||||||
kill(s2.pid(), SIGCONT);
|
kill(s2.pid(), SIGCONT);
|
||||||
} else if (absl::GetFlag(FLAGS_sandbox2tool_pause_kill)) {
|
} else if (absl::GetFlag(FLAGS_sandbox2tool_pause_kill)) {
|
||||||
sleep(3);
|
sleep(3);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user