-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-dragonflyOperating system: DragonFly BSDOperating system: DragonFly BSDO-netbsdOperating system: NetBSDOperating system: NetBSDT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.
Description
Issue #48624 is adding support for the more efficient posix_spawn
in some cases of Command.spawn
. The posix_spawn
of NetBSD and DragonFlyBSD supports returning ENOENT directly so these platforms can grow support for it. They just need the libc bindings (like in rust-lang/libc@92d50c9) and then an update to libstd's Command target list as done in #48624.
OpenBSD does not support this though as their implementation uses fork
rather than vfork
and lacks a communication back to the parent about the exec
failure.
This test .c file was used to check for the needed support:
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <spawn.h>
extern char **environ;
int
main(void)
{
pid_t pid;
char *pargv[] = {"/nonexistent", NULL};
int status = posix_spawn(&pid, "/nonexistent", NULL, NULL, pargv, environ);
assert(status == ENOENT);
return 0;
}
A failing assert means the platform cannot grow posix_spawn
support.
Metadata
Metadata
Assignees
Labels
A-runtimeArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsArea: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflowsC-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.O-dragonflyOperating system: DragonFly BSDOperating system: DragonFly BSDO-netbsdOperating system: NetBSDOperating system: NetBSDT-libsRelevant to the library team, which will review and decide on the PR/issue.Relevant to the library team, which will review and decide on the PR/issue.