Commit ff775b2
fix(ext/node): support numeric FDs in child_process stdio array (#33140)
## Summary
Now that `fs.openSync` returns real OS file descriptors (#33039),
numeric values in child_process stdio arrays should be treated as raw fds rather
than Deno resource IDs. This re-lands the functionality from #32959
(reverted in #33017) with the correct fd-based approach.
- Rename `StdioOrRid` to `StdioOrFd`, replace `Rid(ResourceId)` with
`Fd(i32)`
- `as_stdio()` dups the fd directly (`libc::dup` on Unix, handle clone
on Windows) instead of looking up the resource table
- `extra_stdio` now accepts `StdioOrFd` so numeric fds work beyond
stdin/stdout/stderr
- Hardcoded `Rid(1)`/`Rid(2)` for inherit become `Fd(1)`/`Fd(2)`
- Remove unused `FileResource` import
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d198cda commit ff775b2
File tree
4 files changed
+217
-106
lines changed- ext
- io
- node/polyfills/internal
- process
- tests/unit_node
4 files changed
+217
-106
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
262 | 262 | | |
263 | 263 | | |
264 | 264 | | |
265 | | - | |
266 | | - | |
267 | | - | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
272 | | - | |
273 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
274 | 281 | | |
275 | 282 | | |
276 | 283 | | |
277 | 284 | | |
278 | | - | |
279 | | - | |
280 | | - | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
281 | 288 | | |
282 | 289 | | |
283 | 290 | | |
284 | 291 | | |
285 | | - | |
286 | | - | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
287 | 301 | | |
288 | 302 | | |
289 | 303 | | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
290 | 309 | | |
291 | 310 | | |
292 | 311 | | |
| |||
339 | 358 | | |
340 | 359 | | |
341 | 360 | | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
342 | 373 | | |
343 | 374 | | |
344 | 375 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
| 751 | + | |
752 | 752 | | |
753 | 753 | | |
754 | 754 | | |
| |||
0 commit comments