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

Add macOS support #44

Merged
merged 3 commits into from
Apr 19, 2024
Merged

Add macOS support #44

merged 3 commits into from
Apr 19, 2024

Conversation

retrage
Copy link
Contributor

@retrage retrage commented Apr 17, 2024

macOS Virtualization.framework provides a VirtIO VM socket device, and a macOS guest supports vsock. This PR proposes adding macOS support.

retrage added 2 commits April 17, 2024 13:43
VMADDR_CID_LOCAL is used for vsock loopback, and is not supported on
non-linux OSes.

Signed-off-by: Akira Moroo <[email protected]>
macOS does not have some constants, and it has slightly different
sockaddr_vm struct from other OSes.

Signed-off-by: Akira Moroo <[email protected]>
src/lib.rs Show resolved Hide resolved
src/lib.rs Show resolved Hide resolved
Since macOS does not have `accept4`, this commit replaces it with
`accept` and `fcntl` to avoid fd leak to child processes.

Signed-off-by: Akira Moroo <[email protected]>
@retrage retrage requested a review from qwandor April 19, 2024 05:43
@qwandor qwandor merged commit 2223f5a into rust-vsock:master Apr 19, 2024
2 checks passed
@retrage retrage deleted the macos-support branch April 19, 2024 10:31
@qwandor qwandor mentioned this pull request Aug 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants