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

x/sys/unix: add support for vectorized ("scatter/gather") IO syscalls on Darwin #64710

Closed
mschoenlaub opened this issue Dec 14, 2023 · 8 comments
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. OS-Darwin
Milestone

Comments

@mschoenlaub
Copy link

mschoenlaub commented Dec 14, 2023

Proposal Details

The following syscalls could be supported on modern OSX versions (Darwin 11 and newer)

  • unix.Readv(fd int, iovs [][]byte) (n int, err error)
  • unix.Preadv(fd int, iovs [][]byte, offset int64) (n int, err error)
  • unix.Writev(fd int, iovs [][]byte) (n int, err error)
  • unix.Pwritev(fd int, iovs [][]byte, offset int64) (n int, err error)

I think https://go-review.googlesource.com/c/sys/+/548795 contains everything needed to implement this on Darwin.
In cases where the version is too old, the public functions in unix would simply return ENOSYS instead of running into a dyld error due to trying to jump to a function that doesn't exist.

@gopherbot gopherbot added this to the Proposal milestone Dec 14, 2023
@mschoenlaub mschoenlaub changed the title proposal: x/sys/unix: add support for iovec operations on darwin proposal: x/sys/unix: add support for vectrized IO syscalls on Darwin Dec 14, 2023
@mauri870
Copy link
Member

cc @golang/darwin

@gopherbot
Copy link
Contributor

Change https://go.dev/cl/548795 mentions this issue: unix: support Readv, Preadv, Writev and Pwritev for darwin

@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Dec 14, 2023
@adonovan adonovan changed the title proposal: x/sys/unix: add support for vectrized IO syscalls on Darwin proposal: x/sys/unix: add support for vectorized ("scatter/gather") IO syscalls on Darwin Dec 22, 2023
@adonovan
Copy link
Member

adonovan commented Dec 22, 2023

Why just Darwin? p{read,write}v have been supported on Linux and various BSDs for a while. Ideally the sys interface would have implementations for all platforms that support it, even if the macOS implementation needs an additional compatibility check.

[Update: I now see that we have a Linux implementation already. But my point is that the proposal should cover the API change, and implementations for all platforms can follow at their own pace if they conform to the approved proposal.]

@mschoenlaub
Copy link
Author

Hm, yeah, @adonovan I think you are right. The goal should be to implement it on all platforms supported, but I agree on these implementations better coming in at their own pace.
However, I think I wasn't fully aware of actually proposing an API change of any sort, because due to the Linux implementation already being there, I just assumed that the API now basically has to be whatever the Linux implementation conforms to.

@ianlancetaylor
Copy link
Member

Yes, there is no need for a proposal to add new system calls for a GOOS that are the same as existing system calls for a different GOOS.

@ianlancetaylor ianlancetaylor modified the milestones: Proposal, Unreleased Aug 23, 2024
@ianlancetaylor ianlancetaylor added NeedsFix The path to resolution is known, but the work has not been done. and removed Proposal labels Aug 23, 2024
@ianlancetaylor ianlancetaylor changed the title proposal: x/sys/unix: add support for vectorized ("scatter/gather") IO syscalls on Darwin x/sys/unix: add support for vectorized ("scatter/gather") IO syscalls on Darwin Aug 23, 2024
@mschoenlaub
Copy link
Author

@gopherbot remove NeedsFix

@gopherbot gopherbot removed the NeedsFix The path to resolution is known, but the work has not been done. label Mar 20, 2025
@mschoenlaub
Copy link
Author

@ianlancetaylor, Hoping I'm using these labels right.

@gopherbot add PendingFix.

@mschoenlaub
Copy link
Author

@gopherbot add FixPending

@gopherbot gopherbot added the FixPending Issues that have a fix which has not yet been reviewed or submitted. label Mar 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FixPending Issues that have a fix which has not yet been reviewed or submitted. OS-Darwin
Projects
None yet
Development

No branches or pull requests

5 participants