From owner-freebsd-current@freebsd.org Fri Jul 5 15:45:34 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0004915CE2EF for ; Fri, 5 Jul 2019 15:45:33 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 21D7A753E7; Fri, 5 Jul 2019 15:45:33 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lj1-f193.google.com with SMTP id t28so9667088lje.9; Fri, 05 Jul 2019 08:45:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LzFEnssOpSzw3lCoWWS0aOGirLzbz/o3dUU8OCJSVMA=; b=LnjDoPCadklC15Adtvjr1HfBuf+vgN+olPiinviQXqqsXlUxcYh1ABpGDfgPuSB3EJ x6sLby55ejAjB68/YowYAW2xU1Z5vBuKPyEm/4DrZoq5K5F6mTxZqbmgGShaxfuaqHh2 2wyxiJedjfAkdX9lGx+rg6stLSjTedRN4vYzohL2rLiO9PHDuCI2E3qAs2Kg2O8sv7NE eceDucg7s6WxytwU+5usZfOLnlF52JCxP9Ysx8ydJ83BcSvopQST8U0dRQaL7DQWD4T5 yD5BWFNd0diqJXxw8lNkxzhWR2qs83zK4kzyljconS2AIg30SV2Bko8S4BR7luw4cBuE Ombw== X-Gm-Message-State: APjAAAWduK/5z0D/lnw4F+ozUWg9DoeH0efFY54cQsg3rNFE+Fb9wOwk C61tev/jGRuEt1/XLGlFjYYhkutqS0zSe7vVepI= X-Google-Smtp-Source: APXvYqzrnKBmE/isoXU5JVESEFMydW3YAeIe7NZYv7Bm6AV2IORXnBLoImHCSDlZonL+FdUsmCoFAabHRZaH3PuCk/c= X-Received: by 2002:a2e:9dc1:: with SMTP id x1mr2561966ljj.0.1562341080157; Fri, 05 Jul 2019 08:38:00 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Alan Somers Date: Fri, 5 Jul 2019 09:37:48 -0600 Message-ID: Subject: Re: [Differential] D20584: add a linux compatible copy_file_range(2) syscall To: Rick Macklem Cc: "freebsd-current@FreeBSD.org" , Jilles Tjoelker , "kib@freebsd.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 21D7A753E7 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.208.193 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-3.43 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[freebsd.org]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; NEURAL_HAM_SHORT(-0.14)[-0.137,0]; RCVD_IN_DNSWL_NONE(0.00)[193.208.85.209.list.dnswl.org : 127.0.5.0]; IP_SCORE(-1.28)[ip: (-0.49), ipnet: 209.85.128.0/17(-3.46), asn: 15169(-2.40), country: US(-0.06)]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; RWL_MAILSPIKE_POSSIBLE(0.00)[193.208.85.209.rep.mailspike.net : 127.0.0.17]; MIME_TRACE(0.00)[0:+]; R_DKIM_NA(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; RCVD_COUNT_TWO(0.00)[2] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2019 15:45:34 -0000 On Fri, Jul 5, 2019 at 9:28 AM Rick Macklem wrote: > > jilles wrote in copy_file_range.2:99 > > The Linux man page (from http://man7.org/linux/man->pages/man2/copy_fil= e_range.2.html ) says that a non-zero flags argument will cause >the call t= o return an [EINVAL] error. I think that is better than ignoring the argume= nt >completely since it allows adding flags more safely (since there will n= ot 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 the= ir 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 w= ill > 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