Advance Wayland and KDE package bring-up
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
SPDX-FileCopyrightText: 2024 Vlad Zahorodnii <vlad.zahorodnii@kde.org>
|
||||
|
||||
SPDX-License-Identifier: GPL-2.0-or-later
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "utils/filedescriptor.h"
|
||||
|
||||
#include <optional>
|
||||
#include <unistd.h>
|
||||
|
||||
namespace KWin
|
||||
{
|
||||
|
||||
struct Pipe
|
||||
{
|
||||
FileDescriptor fds[2];
|
||||
|
||||
static std::optional<Pipe> create(int flags)
|
||||
{
|
||||
int fds[2];
|
||||
if (pipe2(fds, flags) != 0) {
|
||||
return std::nullopt;
|
||||
}
|
||||
return Pipe{
|
||||
.fds = {
|
||||
FileDescriptor(fds[0]),
|
||||
FileDescriptor(fds[1]),
|
||||
},
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace KWin
|
||||
Reference in New Issue
Block a user