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

posix_spawn(3) support on OpenBSD #3501

Closed
nuudlman opened this issue Dec 26, 2023 · 4 comments
Closed

posix_spawn(3) support on OpenBSD #3501

nuudlman opened this issue Dec 26, 2023 · 4 comments
Labels
C-API-request Category: API request

Comments

@nuudlman
Copy link
Contributor

OpenBSD has supported posix_spawn(3) since version 5.2

It appears that support is already plumbed up for NetBSD, so I'll try to set up a pull request later today.

@nuudlman nuudlman added the C-API-request Category: API request label Dec 26, 2023
@nuudlman
Copy link
Contributor Author

OpenBSD defines posix_spawnattr_t and posix_spawn_file_actions_t opaquely, so I'm not sure how to define those symbols.

Right now I have it set up as

pub type posix_spawnattr_t = *mut __posix_spawnattr;
pub type posix_spawn_file_actions_t = *mut __posix_spawn_file_actions;

but I can't get a definition for __posix_spawnattr and __posix_spawn_file_actions that will pass the either the compiler or the test suite.

If I define the types exactly as they actually are, the test suite fails because it tries to instantiate them directly. Defining an empty type (pub struct __posix_spawnattr {}) runs into the missing copy implementations lint.

Is there something obvious I'm missing here?

@semarie
Copy link
Contributor

semarie commented Dec 27, 2023

opaque type could be implemented using:

pub type posix_spawnattr_t = *mut ::c_void;
pub type posix_spawn_file_actions_t = *mut ::c_void;

it means there are "pointer on something".

this strategy is already used for pthread_attr_t for example (which is also opaque type on OpenBSD).

@nuudlman
Copy link
Contributor Author

That worked! Thanks for the suggestion.

@nuudlman
Copy link
Contributor Author

Implemented in #3502

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-API-request Category: API request
Projects
None yet
Development

No branches or pull requests

2 participants