From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pj1-x102d.google.com (mail-pj1-x102d.google.com [IPv6:2607:f8b0:4864:20::102d]) by sourceware.org (Postfix) with ESMTPS id F32293858012 for ; Sun, 9 May 2021 20:02:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org F32293858012 Received: by mail-pj1-x102d.google.com with SMTP id p17so8573045pjz.3 for ; Sun, 09 May 2021 13:02:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=D+jK3HAuSdQ6tdKF9+QlBGMC+ueG8o9HYMYmrzPpX1s=; b=XnRfNLZmHvUq44HBNb8BgGBiH0SgbogtjXr1LJlS/gv85HR+XQMVk6zcZSj2ll+1tI 9ukgluu8AtWmAgFJ4ycw4utBnhikQhJ29hy7/yCUBmNOUtoavZicW7rRGTqNzBpNCib4 lAiAQl9pzHS3arVwcPstoLEmRVJ598tdZGmd3v6B0rGgBbbax8NGs5krRRRTpOaV4mh4 XpD2WW3zU/OLPc7kZesS0SvqW6fZl0JtVm/V7Fu0oMMLHtZrYtsebkJkxKn4Lrbj6mOo h9VsskYNLUMN694HRxqqNVwgxoWNKUJnUIIzZeNe8XGw4I9D+f1b8pxQfZVf4lHPE423 KSMg== X-Gm-Message-State: AOAM533qVyaJEGjBJmQ/16eT8sW4C2TvJ99Oz589UwgGH8Vg6O5ynyKn dYYjcQnnLNy/7eYC490KpSHXSHHX0Ps= X-Google-Smtp-Source: ABdhPJw597xzhEG7ow2t6CGCYYCFgUUSBwGCtn4nK5NrVhfnY5F/LxoJ5fZoxYrzdWXxSRg1iyc50w== X-Received: by 2002:a17:90a:ce8b:: with SMTP id g11mr23180107pju.173.1620590536478; Sun, 09 May 2021 13:02:16 -0700 (PDT) Received: from [192.168.192.21] (47-72-82-130.dsl.dyn.ihug.co.nz. [47.72.82.130]) by smtp.gmail.com with ESMTPSA id g1sm9136980pgi.64.2021.05.09.13.02.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 13:02:16 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, libc-alpha@sourceware.org Subject: Re: [PATCH 3/3] open.2: Remove unused To: Alejandro Colomar References: <20210421224418.143065-1-alx.manpages@gmail.com> <20210421224418.143065-3-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: <4d093c28-120b-ecf6-3671-b00159d15da1@gmail.com> Date: Mon, 10 May 2021 08:02:12 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210421224418.143065-3-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, KAM_SHORT, NICE_REPLY_A, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 May 2021 20:02:19 -0000 Hello Alex, On 4/22/21 10:44 AM, Alejandro Colomar wrote: > I can't see a reason to include it. provides O_* > constants for 'flags', S_* constants for 'mode', and mode_t. > > Probably a long time ago, some of those weren't defined in > , and both headers needed to be included, or maybe it's > a historical error. > > Signed-off-by: Alejandro Colomar So, I am uncertain what to do about this patch. I agree that we don't need the on Linux. But, look at open(3p): SYNOPSIS #include #include int open(const char *path, int oflag, ...); O_CREAT [...] and the access permission bits (see ) of the file mode shall be set to the value of the argument following the oflag argument taken as type mode_t modified as follows... But, seemingly in contradiction, fcntl.h(0p) says: The header shall define the symbolic constants for file modes for use as values of mode_t as described in . It almost seems like a small bug in POSIX. I see also that open(2) on FreeBSD mentions only the need to include . What are your thoughts on the above. I'm willing to apply your patch if you still think we should apply it. Thanks, Michael > --- > man2/open.2 | 1 - > 1 file changed, 1 deletion(-) > > diff --git a/man2/open.2 b/man2/open.2 > index bac1ee806..1bcd995f4 100644 > --- a/man2/open.2 > +++ b/man2/open.2 > @@ -53,7 +53,6 @@ > open, openat, creat \- open and possibly create a file > .SH SYNOPSIS > .nf > -.B #include > .B #include > .PP > .BI "int open(const char *" pathname ", int " flags ); > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/