Demos: Use pledge and unveil

This commit is contained in:
Brendan Coles 2020-11-01 19:37:48 +00:00 committed by Andreas Kling
commit 9faca895d3
Notes: sideshowbarker 2024-07-19 01:35:12 +09:00
8 changed files with 115 additions and 0 deletions

View file

@ -199,6 +199,21 @@ int main(int argc, char** argv)
{
auto app = GUI::Application::construct(argc, argv);
if (pledge("stdio rpath shared_buffer", nullptr) < 0) {
perror("pledge");
return 1;
}
if (unveil("/res", "r") < 0) {
perror("unveil");
return 1;
}
if (unveil(nullptr, nullptr) < 0) {
perror("unveil");
return 1;
}
auto window = GUI::Window::construct();
window->set_double_buffering_enabled(true);
window->set_title("LibGfx Demo");