// Allowed patterns: the checker must not flag any of these. #include "strawberry/parse_num.hpp" #include "strawberry/proc_read.hpp" #include "strawberry/thread_entry.hpp" #include #include #include #include void handler(int) noexcept {} struct W { std::vector workers_; std::thread t_; void start() { t_ = std::thread(strawberry::run_guarded("t", [] {})); workers_.emplace_back(strawberry::run_guarded("w", [] {})); } }; int pid(const std::string& s) { return strawberry::parse_number(s).value_or(-1); } std::string boot() { return strawberry::read_small_file_or_empty("/proc/sys/kernel/random/boot_id"); } std::ifstream config(const char* p) { return std::ifstream(p); } // invariant-allow(ifstream): fixture void install() { struct sigaction a{}; a.sa_handler = handler; sigaction(SIGSEGV, &a, nullptr); }