/* * Copyright (c) 2021, Kyle Pereira * * SPDX-License-Identifier: BSD-2-Clause */ #include "SpiceAgent.h" #include #include #include #include static constexpr auto SPICE_DEVICE = "/dev/hvc0p1"sv; ErrorOr serenity_main(Main::Arguments) { Core::EventLoop loop; TRY(Core::System::pledge("unix rpath wpath stdio sendfd recvfd", nullptr)); TRY(Core::System::unveil(SPICE_DEVICE, "rw")); TRY(Core::System::unveil("/tmp/portal/clipboard", "rw")); TRY(Core::System::unveil(nullptr, nullptr)); int serial_port_fd = TRY(Core::System::open(SPICE_DEVICE, O_RDWR)); auto conn = TRY(ClipboardServerConnection::try_create()); auto agent = SpiceAgent(serial_port_fd, conn); return loop.exec(); }