Date: Fri, 5 Jul 2019 09:37:48 -0600 From: Alan Somers <asomers@freebsd.org> To: Rick Macklem <rmacklem@uoguelph.ca> Cc: "freebsd-current@FreeBSD.org" <freebsd-current@freebsd.org>, Jilles Tjoelker <jilles@freebsd.org>, "kib@freebsd.org" <kib@freebsd.org> Subject: Re: [Differential] D20584: add a linux compatible copy_file_range(2) syscall Message-ID: <CAOtMX2jeiR6aw%2BaWs1EGUf5PeYEwV2HABM=fgzGkucd-MGk1fw@mail.gmail.com> In-Reply-To: <YTXPR01MB02854D6BDAF9EB943DEC3F1EDDF50@YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM> References: <differential-rev-PHID-DREV-ki3nyojxtg6yf3c3i7o3-req@reviews.freebsd.org> <f9a25b0afb51a92b4fd28f57a18b0d73@localhost.localdomain> <YTXPR01MB02854D6BDAF9EB943DEC3F1EDDF50@YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Jul 5, 2019 at 9:28 AM Rick Macklem <rmacklem@uoguelph.ca> wrote: > > jilles wrote in copy_file_range.2:99 > > The Linux man page (from http://man7.org/linux/man->pages/man2/copy_file_range.2.html ) says that a non-zero flags argument will cause >the call to return an [EINVAL] error. I think that is better than ignoring the argument >completely since it allows adding flags more safely (since there will not be existing >applications that pass in, for example, uninitialized data as flags). > > The fun part is that the Linux folks are already discussing adding flags. > I don't know if they are already in Linux-next (or whatever they call their next > release), but it sounded like they were headed that way. > > As such, I thought ignoring "flags" would be easier than returning EINVAL for > code that works on Linux. > > However, I can see the counter argument, which is "returning EINVAL will > indicate that the Linux flag isn't used on FreeBSD", so that developers will > become aware of that. > > What do others think w.r.t. which is the better approach? rick Better to return EINVAL. That way a program written for FreeBSD 14 which uses a FreeBSD 14-specific flag will fail when run on FreeBSD 13, which lacks that flag. -Alan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2jeiR6aw%2BaWs1EGUf5PeYEwV2HABM=fgzGkucd-MGk1fw>
