Re: sendfile(2) behaviour has changed ?
Matti Aarnio (matti.aarnio@zmailer.org)
Wed, 16 Oct 2002 12:10:46 +0300
On Wed, Oct 16, 2002 at 10:49:08AM +0200, Zilvinas Valinskas wrote:
> This sample code copies a file using sendfile(2) call works just fine on 
> 2.2.x and 2.4.x kernels. On 2.5.x kernels (not sure starting which
> version) it stopped working. Program terminates with EINVAL error. 
>
> $ ./sendfile
> sendfile: Invalid argument
> 
> Is this expected behaviour ? that sendfile(2) on 2.5.4x linux kernel requires
> socket as an output fd paramter ? 
  It has only been intended for output to a TCP stream socket.
> Was it ever legal to copy file(s) on filesystem using sendfile(2) ?
> (which was kindda nice feature ... )
  No.  It was a nice misfeature.
/Matti Aarnio
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/