ChessEngine: Use pledge and unveil

This commit is contained in:
Brendan Coles 2020-11-01 20:45:14 +00:00 committed by Andreas Kling
parent 9f8a8e07c2
commit 328915a279
Notes: sideshowbarker 2024-07-19 01:35:05 +09:00

View file

@ -30,7 +30,20 @@
int main()
{
if (pledge("stdio shared_buffer accept unix rpath cpath fattr", nullptr) < 0) {
perror("pledge");
return 1;
}
Core::EventLoop loop;
if (pledge("stdio shared_buffer unix", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto engine = ChessEngine::construct(Core::File::stdin(), Core::File::stdout());
return loop.exec();
}