summaryrefslogtreecommitdiff
path: root/Userland/Services/ChessEngine/main.cpp
blob: d07e5ce1735b063bc373b88e6c9610cc78bd4498 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * 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();
}