fx.io: add basic rosetta support

This commit is contained in:
2026-07-19 13:25:53 +01:00
parent 181a6bac09
commit cb97001033
10 changed files with 2286 additions and 2 deletions
+32
View File
@@ -0,0 +1,32 @@
#include "posix.h"
#include <errno.h>
#include <fx/io/stream.h>
#include <unistd.h>
fx_status fx_pipe_create(fx_iostream **reader, fx_iostream **writer)
{
#if 0
int fds[2];
int err = pipe(fds);
if (err != 0) {
return fx_status_from_errno(errno, FX_ERR_NOT_SUPPORTED);
}
fx_iostream *r = fx_iostream_create(FX_STREAM_READ, fds[0], true);
fx_iostream *w = fx_iostream_create(FX_STREAM_WRITE, fds[1], true);
if (!r || !w) {
fx_iostream_unref(r);
fx_iostream_unref(w);
close(fds[0]);
close(fds[1]);
return FX_ERR_NO_MEMORY;
}
*reader = r;
*writer = w;
return FX_SUCCESS;
#endif
return FX_ERR_NOT_SUPPORTED;
}