1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-16 00:34:59 +00:00
serenity/Userland/Services/ChessEngine/main.cpp
Andreas Kling 31d4bcf5bf Userland: Tighten a *lot* of pledges! :^)
Since applications using Core::EventLoop no longer need to create a
socket in /tmp/rpc/, and also don't need to listen for incoming
connections on this socket, we can remove a whole bunch of pledges!
2021-05-13 23:28:40 +02:00

30 lines
688 B
C++

/*
* Copyright (c) 2020, the SerenityOS developers.
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "ChessEngine.h"
#include <LibCore/EventLoop.h>
#include <LibCore/File.h>
#include <unistd.h>
int main()
{
if (pledge("stdio recvfd sendfd unix rpath", nullptr) < 0) {
perror("pledge");
return 1;
}
Core::EventLoop loop;
if (pledge("stdio recvfd sendfd unix", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto engine = ChessEngine::construct(Core::File::standard_input(), Core::File::standard_output());
return loop.exec();
}