2023-07-03 13:10:16 +02:00
|
|
|
#include "sys/sysproto.hpp"
|
2024-01-13 18:57:02 +01:00
|
|
|
#include "thread/Process.hpp"
|
2025-04-05 21:50:45 +02:00
|
|
|
#include "thread/Thread.hpp"
|
2023-10-31 23:58:03 +01:00
|
|
|
#include "utils/Logs.hpp"
|
2023-10-31 19:28:40 +01:00
|
|
|
#include <pipe.hpp>
|
2025-12-03 18:07:25 +01:00
|
|
|
#include <utility>
|
2023-07-03 13:10:16 +02:00
|
|
|
|
2023-10-31 19:28:40 +01:00
|
|
|
orbis::SysResult orbis::sys_pipe(Thread *thread) {
|
2024-01-04 01:53:58 +01:00
|
|
|
auto [a, b] = createPipe();
|
|
|
|
|
auto fd0 = thread->tproc->fileDescriptors.insert(a);
|
|
|
|
|
auto fd1 = thread->tproc->fileDescriptors.insert(b);
|
2025-12-03 18:07:25 +01:00
|
|
|
ORBIS_LOG_ERROR(__FUNCTION__, (int)fd0, (int)fd1);
|
|
|
|
|
thread->retval[0] = std::to_underlying(fd0);
|
|
|
|
|
thread->retval[1] = std::to_underlying(fd1);
|
2023-10-31 19:28:40 +01:00
|
|
|
return {};
|
|
|
|
|
}
|