2020-08-20 20:04:08 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2020, the SerenityOS developers.
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-08-20 20:04:08 -03:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include "ChessEngine.h"
|
|
|
|
|
#include <LibCore/EventLoop.h>
|
|
|
|
|
#include <LibCore/File.h>
|
2021-03-12 13:29:37 -03:00
|
|
|
#include <unistd.h>
|
2020-08-20 20:04:08 -03:00
|
|
|
|
|
|
|
|
int main()
|
|
|
|
|
{
|
2021-05-13 18:20:26 -03:00
|
|
|
if (pledge("stdio recvfd sendfd unix rpath", nullptr) < 0) {
|
2020-11-01 17:45:14 -03:00
|
|
|
perror("pledge");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
2020-08-20 20:04:08 -03:00
|
|
|
Core::EventLoop loop;
|
2021-01-16 13:42:31 -03:00
|
|
|
if (pledge("stdio recvfd sendfd unix", nullptr) < 0) {
|
2020-11-01 17:45:14 -03:00
|
|
|
perror("pledge");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
if (unveil(nullptr, nullptr) < 0) {
|
|
|
|
|
perror("unveil");
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-12-22 19:37:11 -03:00
|
|
|
auto engine = ChessEngine::construct(Core::File::standard_input(), Core::File::standard_output());
|
2020-08-20 20:04:08 -03:00
|
|
|
return loop.exec();
|
|
|
|
|
}
|