2020-01-18 05:38:21 -03:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
|
|
|
*
|
2021-04-22 05:24:48 -03:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 05:38:21 -03:00
|
|
|
*/
|
|
|
|
|
|
2019-11-26 13:38:24 -03:00
|
|
|
#include "LookupServer.h"
|
2020-02-06 11:04:03 -03:00
|
|
|
#include <LibCore/EventLoop.h>
|
2020-02-14 18:29:06 -03:00
|
|
|
#include <LibCore/LocalServer.h>
|
2021-11-23 11:30:59 -03:00
|
|
|
#include <LibCore/System.h>
|
|
|
|
|
#include <LibMain/Main.h>
|
2019-06-20 16:48:33 -03:00
|
|
|
|
2021-11-23 11:30:59 -03:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments)
|
2019-06-20 16:48:33 -03:00
|
|
|
{
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio accept unix inet rpath"));
|
2020-02-02 08:34:39 -03:00
|
|
|
Core::EventLoop event_loop;
|
2021-11-23 11:30:59 -03:00
|
|
|
auto server = TRY(LookupServer::LookupServer::try_create());
|
2020-01-22 07:13:52 -03:00
|
|
|
|
2021-11-27 19:26:34 -03:00
|
|
|
TRY(Core::System::pledge("stdio accept inet rpath"));
|
2021-11-23 11:30:59 -03:00
|
|
|
TRY(Core::System::unveil("/proc/net/adapters", "r"));
|
|
|
|
|
TRY(Core::System::unveil("/etc/hosts", "r"));
|
|
|
|
|
TRY(Core::System::unveil(nullptr, nullptr));
|
2019-11-26 13:38:24 -03:00
|
|
|
return event_loop.exec();
|
2019-03-19 12:29:06 -03:00
|
|
|
}
|