-
Notifications
You must be signed in to change notification settings - Fork 682
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 sendfile(2) for DragonFly #1615
Conversation
245b034
to
90467da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The signatures in libc look the same. Is the only difference that none of the flags are supported on Dragonfly?
The primary difference is the flags field (which FreeBSD actually packs flags and an int into). From the DragonFly man page:
There are also some documentation differences, notably that FreeBSD supports reading from a shared memory object, while the DragonFly man page indicates it must be a regular file. |
Just for consistency's sake, do you think it would make sense to define the API identically on FreeBSD and Dragonfly, but require that the flags field be zero on Dragonfly? That would make it easier to port programs from FreeBSD to Dragonfly. OTOH, it's not very hard with the current API either. I'm kind of on the fence about it. |
I considered it, but my reservation is DragonFly doesn't currently assign meaning to the flags parameter other than requiring that it must be zero. It could be repurposed to something other than a flags bitfield while maintaining ABI compatibility. Consolidating them would also require passing zero for the Given other targets like Linux have different signatures already, I think keeping it separate is probably (?) the best idea for now, while acknowledging they may be consolidated in the future. We can defer merging this until after some of the other PRs are submitted, to avoid them needing to rebased yet again for changelog reasons. I'd rather rebase than make someone else need to, and it gives us time to change our minds on the implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good.
c6cc22e
to
4d5c090
Compare
bors r+ |
The code is copied from the Mac OS and FreeBSD implementations.