summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/child_process.ts
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2023-12-15 16:20:05 +0530
committerGitHub <noreply@github.com>2023-12-15 11:50:05 +0100
commit81a6504e670d32bdc5e0a8328c328fdf8e208913 (patch)
tree27a90846e42edd1863e45e9792375d7777f10667 /ext/node/polyfills/child_process.ts
parent62e3f5060ef9cc6a31b3e496dd15548c0abd07e6 (diff)
refactor: setup child process pipe in Rust (#21579)
Avoid passing the fd into JS and back into Rust. Instead we setup the child's end of the pipe directly using a special Rust op.
Diffstat (limited to 'ext/node/polyfills/child_process.ts')
-rw-r--r--ext/node/polyfills/child_process.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/ext/node/polyfills/child_process.ts b/ext/node/polyfills/child_process.ts
index c7d007f46..da82546f6 100644
--- a/ext/node/polyfills/child_process.ts
+++ b/ext/node/polyfills/child_process.ts
@@ -49,6 +49,7 @@ import {
} from "ext:deno_node/internal/util.mjs";
const { core } = globalThis.__bootstrap;
+const ops = core.ops;
const MAX_BUFFER = 1024 * 1024;
@@ -822,7 +823,8 @@ export function execFileSync(
return ret.stdout as string | Buffer;
}
-function setupChildProcessIpcChannel(fd: number) {
+function setupChildProcessIpcChannel() {
+ const fd = ops.op_node_child_ipc_pipe();
if (typeof fd != "number" || fd < 0) return;
setupChannel(process, fd);
}