rpcsx/kernel/orbis/src/sys/sys_pipe.cpp

17 lines
506 B
C++
Raw Normal View History

2023-07-03 13:10:16 +02:00
#include "sys/sysproto.hpp"
#include "thread/Process.hpp"
#include "thread/Thread.hpp"
2023-10-31 23:58:03 +01:00
#include "utils/Logs.hpp"
#include <pipe.hpp>
#include <utility>
2023-07-03 13:10:16 +02:00
orbis::SysResult orbis::sys_pipe(Thread *thread) {
auto [a, b] = createPipe();
auto fd0 = thread->tproc->fileDescriptors.insert(a);
auto fd1 = thread->tproc->fileDescriptors.insert(b);
ORBIS_LOG_ERROR(__FUNCTION__, (int)fd0, (int)fd1);
thread->retval[0] = std::to_underlying(fd0);
thread->retval[1] = std::to_underlying(fd1);
return {};
}