Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Jul 2019 01:35:06 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Konstantin Belousov <kostikbel@gmail.com>, Rick Macklem <rmacklem@FreeBSD.org>
Cc:        "src-committers@freebsd.org" <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>
Subject:   Re: svn commit: r350315 - in head/sys: kern sys
Message-ID:  <YTBPR01MB33127701BFED8EF3FE933C96DDC30@YTBPR01MB3312.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <20190726215628.GE2731@kib.kiev.ua>
References:  <201907250546.x6P5kHWq076756@repo.freebsd.org>, <20190726215628.GE2731@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
Konstantin Belousov wrote:
>On Thu, Jul 25, 2019 at 05:46:17AM +0000, Rick Macklem wrote:
>> Author: rmacklem
>> Date: Thu Jul 25 05:46:16 2019
>> New Revision: 350315
>> URL: https://svnweb.freebsd.org/changeset/base/350315
>>
>> Log:
>>   Add kernel support for a Linux compatible copy_file_range(2) syscall.
>
>> Modified: head/sys/kern/syscalls.master
>> >=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D>=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
>> --- head/sys/kern/syscalls.master     Thu Jul 25 03:55:05 2019        (r=
350314)
>> +++ head/sys/kern/syscalls.master     Thu Jul 25 05:46:16 2019        (r=
350315)
>> @@ -3175,6 +3175,16 @@
>>                   int flag
>>               );
>>       }
>> +569  AUE_NULL        STD {
>> +             ssize_t copy_file_range(
>> +                 int infd,
>> +                 _Inout_opt_ off_t *inoffp,
>> +                 int outfd,
>> +                 _Inout_opt_ off_t *outoffp,
>> +                 size_t len,
>> +                 unsigned int flags
>> +             );
>> +     }
>
>I sat to write the compat32 shims, and only then noted that len has size_t
>type.  Why is it size_t and not off_t ?
Well, that's what Linux did.

Also, since it returns ssize_t, it can't do more than SSIZE_MAX (generally =
1/2 of
SIZE_T_MAX). Returning ssize_t is also what Linux does and is consistent wi=
th
read(2)/write(2).

rick



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YTBPR01MB33127701BFED8EF3FE933C96DDC30>