Page MenuHomeFreeBSD

Make linux(4) support splice(2) - kind of
ClosedPublic

Authored by trasz on Sun, Jul 12, 3:24 PM.

Details

Summary

Add a trivial linux(4) splice(2) implementation, which simply
returns EINVAL. Fixes grep (grep-3.1-2build1).

PR: kern/247219

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

trasz created this revision.Sun, Jul 12, 3:24 PM
trasz requested review of this revision.Sun, Jul 12, 3:24 PM
trasz updated this revision to Diff 74360.Sun, Jul 12, 3:26 PM

Upload the right diff.

trasz updated this revision to Diff 74361.Sun, Jul 12, 3:29 PM

Add arm64.

trasz added a comment.Mon, Jul 13, 3:24 PM

(Tinderboxed.)

emaste added inline comments.Mon, Jul 13, 3:29 PM
sys/compat/linux/linux_file.c
1774 ↗(On Diff #74361)

so consumers handle EINVAL from splice but not ENOSYS?

trasz added inline comments.Mon, Jul 13, 10:04 PM
sys/compat/linux/linux_file.c
1774 ↗(On Diff #74361)

Precisely. Well, the one I found: grep. But looking at splice(2) man page, consumers probably need to handle it anyway: with early kernels exactly one of the fds had to be a pipe, later both could be, then there's "EINVAL The target filesystem doesn't support splicing"...

emaste accepted this revision.Tue, Jul 14, 12:58 AM

Probably worth putting that EINVAL description in a comment by the return.

This revision is now accepted and ready to land.Tue, Jul 14, 12:58 AM
This revision was automatically updated to reflect the committed changes.