You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ideally, I'd want to add _OS\waitid_async(), and expose it as OS\waitid_async() and OS\waitpid_async() - however, waitid() does not exist in macos, despite being part of the specifications for some time.
I think we'd want to just add waitpid_async(), and if later we want process group support, we add _OS\waitpgid_async(), and add an OS\waitid_async() that wraps the two separate functions - unless MacOS adds waitid in the mean time.
... but the design of process group support can be left for later, that's just be brain dumping. For now, let's stick with just waitpid.
Summary:
refs hhvm/hsl#176
This part of enabling a pattern of:
```
list($stderr_parent, $stderr_child) = OS\socketpair(); // yep, stderr is read-write
$stdin_child = OS\dup($stderr_child);
OS\shutdown($stdin_child, OS\SHUT_WR);
$stdout_child = OS\dup($stderr_child);
OS\shutdown($stdout_child, OS\SHUT_RD);
```
`dup2()` is not necessary as we support explicitly remapping FDs when creating subprocesses
`dup2()` is not desirable as:
- Hack programs do not have insights to the real FD numbers. Especially in CLI server mode, STDIN/STDOUT/STDERR may not be on the canonical STDIN_FILENO/STDOUT_FILENO/STDERR_FILENO
- Given that, there's a large risk of accidentally creating cross-request issues with `dup2()`
Reviewed By: shayne-fletcher
Differential Revision: D33166096
fbshipit-source-id: 41339a9a33c854982009086f3efdfc35277715c0
OS\posix_spawn()
andOS\posix_spawnp()
_OS\dup()
_OS\waitpid_async()
or similar_OS\shutdown()
OS\posix_spawn()
andOS\posix_spawnp()
OS\waitpid_async()
OS\shutdown()
OS\dup()
OS\socketpair()
(already in_OS\
)The text was updated successfully, but these errors were encountered: