The man page for the splice system call says that splice may fail and set errno to EINVAL if:
Target file system doesn't support splicing; neither of the descriptors refers to a pipe; or offset given for non-seekable device
Which file systems support splicing?
My original answer was partially incorrect, this is a major rewrite.
Linux 2.6.30.10 and below
In Linux 2.6.30.10 and older,
splicereturnsEINVALwhen the source or target filesystem does not support splicing. Here are the filesystems that do support splicing:Details follow. Support for splicing in determined in the
do_splice_to()function in the "file to pipe" case and in thedo_splice_from()function in the "pipe to file" case. It is done by checking whether the relevantstruct file_operationscontains.splice_reador.splice_write, respectively. In order to produce the above lists of filesystems, I've greppedfs/*/file.cfor.splice_readand.splice_write.Linux 2.6.31 and above
Starting with Linux 2.6.31, all the filesystems support splicing both in read and write modes.
Details follow. When a filesystem does not have
.splice_reador.splice_writein itsstruct file_operations, a fallback function is used:default_file_splice_readanddefault_file_splice_write, respectively. Seedo_splice_to()anddo_splice_from()for implementations. Note:EINVALmay still be returned for other reasons listed in the documentation.