
John Meacham
There isn't a standard unix sendfile, while a few different ones have functions called 'sendfile', they have different meanings/prototypes in general. If 'sendfile(2)' is going to be exposed, it should be in a low level platform specific library, however, since you are dealing with deciding to use unportable behavior, it is hard to see what this will gain over a manual FFI wrapper.
Well, for my purposes, I need to have at least three of them -- Linux, Darwin (BSD) and Windows. However, I think you are ultimately right, the heterogenity of sendfile() suggests that one should not stomp all over it with yet another variant. Maybe a reasonable compromise is a function that is more limited by design, with a distinctive name -- `fileSock`? -- that offers access to a universal subset of the functionality of sendfile() -- namely, pushing a file's contents over a socket efficiently. -- _jsn