Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Command.spawn posix_spawn support for NetBSD / DragonFlyBSD. #48681

Open
bdrewery opened this issue Mar 2, 2018 · 1 comment
Open

Command.spawn posix_spawn support for NetBSD / DragonFlyBSD. #48681

bdrewery opened this issue Mar 2, 2018 · 1 comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one. O-dragonfly Operating system: DragonFly BSD O-netbsd Operating system: NetBSD T-libs Relevant to the library team, which will review and decide on the PR/issue.

Comments

@bdrewery
Copy link
Contributor

bdrewery commented Mar 2, 2018

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.

@bdrewery
Copy link
Contributor Author

bdrewery commented Mar 2, 2018

This can be labeled as an enhancement.

@cuviper cuviper added A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. O-netbsd Operating system: NetBSD O-dragonfly Operating system: DragonFly BSD labels Mar 2, 2018
@Enselic Enselic added T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Sep 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-runtime Area: std's runtime and "pre-main" init for handling backtraces, unwinds, stack overflows C-enhancement Category: An issue proposing an enhancement or a PR with one. O-dragonfly Operating system: DragonFly BSD O-netbsd Operating system: NetBSD T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

3 participants