diff --git a/sandboxed_api/sandbox2/examples/tool/BUILD.bazel b/sandboxed_api/sandbox2/examples/tool/BUILD.bazel index 121d628..9463379 100644 --- a/sandboxed_api/sandbox2/examples/tool/BUILD.bazel +++ b/sandboxed_api/sandbox2/examples/tool/BUILD.bazel @@ -38,6 +38,7 @@ cc_binary( "@com_google_absl//absl/memory", "@com_google_absl//absl/strings", "@com_google_absl//absl/strings:str_format", + "@com_google_absl//absl/time", ], ) diff --git a/sandboxed_api/sandbox2/examples/tool/CMakeLists.txt b/sandboxed_api/sandbox2/examples/tool/CMakeLists.txt index 5b5c25b..28463b8 100644 --- a/sandboxed_api/sandbox2/examples/tool/CMakeLists.txt +++ b/sandboxed_api/sandbox2/examples/tool/CMakeLists.txt @@ -21,6 +21,7 @@ add_executable(sandbox2::sandbox2tool ALIAS sandbox2_sandbox2tool) target_link_libraries(sandbox2_sandbox2tool PRIVATE absl::memory absl::strings + absl::time sandbox2::bpf_helper # sandbox2::ipc sandbox2::sandbox2 diff --git a/sandboxed_api/sandbox2/examples/tool/sandbox2tool.cc b/sandboxed_api/sandbox2/examples/tool/sandbox2tool.cc index 68d3061..e089338 100644 --- a/sandboxed_api/sandbox2/examples/tool/sandbox2tool.cc +++ b/sandboxed_api/sandbox2/examples/tool/sandbox2tool.cc @@ -39,6 +39,7 @@ #include "absl/memory/memory.h" #include "absl/strings/str_format.h" #include "absl/strings/str_split.h" +#include "absl/time/time.h" #include "sandboxed_api/sandbox2/executor.h" #include "sandboxed_api/sandbox2/ipc.h" #include "sandboxed_api/sandbox2/limits.h" @@ -202,7 +203,7 @@ int main(int argc, char** argv) { sleep(3); kill(s2.pid(), SIGSTOP); sleep(3); - s2.SetWallTimeLimit(3); + s2.set_walltime_limit(absl::Seconds(3)); kill(s2.pid(), SIGCONT); } else if (absl::GetFlag(FLAGS_sandbox2tool_pause_kill)) { sleep(3);