-
Notifications
You must be signed in to change notification settings - Fork 681
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
Implement sendfile for OS X / MacOS #560
Comments
Here is how go handle this: https://golang.org/search?q=sendfile |
Sorry for the delayed response. I think the right way to handle this in nix is to have each platforms syscall implemented as-is, wrapping the libc implementations. Happy to accept a PR! :-) |
This is somewhat confusing as there is an identically named method in BSDs (including FreeBSD and Darwin) which has different semantics. The BSD What's the convention for handling this scenario? Should the BSD Once this question is answered, I'd be interested in taking this ticket. |
They're not as different as they sound. A streaming socket, after all, is a file descriptor. Still, there are important differences, like the |
OK! Would wrapping the Darwin syscall implementation have any value? E.g. what Go does in their syscall package? |
Oh, I don't want to get into the business of calling bare syscalls. That's caused a lot of trouble for Go. Better to use the C APIs. |
I agree on the above. We don't have the resources to deal with the potential issues that come from bare syscalls. I think the only time we should consider it is where the libc doesn't expose a wrapper. The cases I know of in nix are the linux calls |
Sounds good. Could we modify this ticket to include both Darwin and the other BSDs, since it's the same API? I'll get started on this tonight. |
This merged years ago in #901 and can be closed as complete. |
I guess this is just not implemented yet, right? Not something that's impossible or inviable to implement.
The problem might be that the system call is very different on OS X and linux. So should it be implemented on each system as is? Or should some common denominator be in nix? (given that syscall exists in libc for both platforms with different signature)
The text was updated successfully, but these errors were encountered: