From c8479ceff6aea37def538c902324c68930947f21 Mon Sep 17 00:00:00 2001 From: _ov4 Date: Sun, 18 Oct 2026 09:42:45 +0000 Subject: add self pipe, and non-block-input --- src/self_pipe.cc | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/self_pipe.cc (limited to 'src/self_pipe.cc') diff --git a/src/self_pipe.cc b/src/self_pipe.cc new file mode 100644 index 0000000..42e61d8 --- /dev/null +++ b/src/self_pipe.cc @@ -0,0 +1,21 @@ +#include "pipe.h" + +#include +#include +#include + +#include "error.h" + +namespace ov4 +{ + +void self_pipe_init() +{ + int ret = pipe2(self_pipe_fd, O_NONBLOCK); + if (ret != 0) + { + throw T_error(error_code::FAIL_TO_OPEN_PIPE, "Fail to open self pipe"); + } +} + +} \ No newline at end of file -- cgit v1.3.1-4-g156e