Message ID | 20210421224418.143065-3-alx.manpages@gmail.com |
---|---|
State | Not applicable |
Headers |
Return-Path: <libc-alpha-bounces@sourceware.org> X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7ABF7398B41B; Wed, 21 Apr 2021 22:45:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7ABF7398B41B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1619045129; bh=TBV3lzdeBKywsP3oOhk/jWWDiZqdQXkgjglV+hJqsE4=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=A8nOYenT1em1ji0FOsQtE/JIkyeCaF1H9r04qB1peQ6Gc6ILeWbJTgK1LcCY7F2A9 6ijcBSaJ3JCQujVu/Zb5Jq66r6zkPyythWhT6/6A8kEsB34dVc1l9teW4y1zhLLw3q PC3Jq9oJIW42+Ased/HlyxnVu1c57W/Yiufqq0zw= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by sourceware.org (Postfix) with ESMTPS id DB8FB389366A for <libc-alpha@sourceware.org>; Wed, 21 Apr 2021 22:45:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DB8FB389366A Received: by mail-wr1-x429.google.com with SMTP id c15so33917947wro.13 for <libc-alpha@sourceware.org>; Wed, 21 Apr 2021 15:45:25 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TBV3lzdeBKywsP3oOhk/jWWDiZqdQXkgjglV+hJqsE4=; b=BebvNkDrbiAkgHRyjJBz3J+0Jm5weVvu9DkcYILAHWeaacpgJRGS1PGbBzx8lABXxq AsNCACNaA9A5r2fyRbn5jdCkVsvXKz3E6roDMEhbIFGD18DxCEuJgB4H+l5ys+xmBJez AT4Hg228vXjhN2UOGn9R6zc/9mOzMERY+G+ybS2byQREKSfjM8PN2MeBy8OvlGMsnQn3 PyOz/YWsqzCPG35cbTUgFzmJ9qztaDlBgCc1hnMXwaokhUDEWhYsl8SjlLrzbVxqgjeM T+rb79Vh38/V8G9iZoBvEtL5hIfwLbRskj2abXdP0VoPL86CTlvEeZaKtSjCvQaJUV2b kpgw== X-Gm-Message-State: AOAM5309yUHCr1xcEgI5qM8niWMyD21t5sraYwfUOUWcRPnhkp/0URqa qCx8BrI9ps+8K1Y4sTtRdzQ= X-Google-Smtp-Source: ABdhPJzAkq1+A4BK6bEFwkEKZnCcncbKGhnSO18pjKhzL4neqqYf8xzgVu8eE/vLVif1ir3C+iUKeQ== X-Received: by 2002:a5d:51cf:: with SMTP id n15mr438914wrv.30.1619045125056; Wed, 21 Apr 2021 15:45:25 -0700 (PDT) Received: from sqli.sqli.com ([195.53.121.100]) by smtp.googlemail.com with ESMTPSA id l13sm781800wrt.14.2021.04.21.15.45.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Apr 2021 15:45:24 -0700 (PDT) To: mtk.manpages@gmail.com Subject: [PATCH 3/3] open.2: Remove unused <sys/stat.h> Date: Thu, 22 Apr 2021 00:44:19 +0200 Message-Id: <20210421224418.143065-3-alx.manpages@gmail.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20210421224418.143065-1-alx.manpages@gmail.com> References: <20210421224418.143065-1-alx.manpages@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, 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 <libc-alpha.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/libc-alpha/> List-Post: <mailto:libc-alpha@sourceware.org> List-Help: <mailto:libc-alpha-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/libc-alpha>, <mailto:libc-alpha-request@sourceware.org?subject=subscribe> From: Alejandro Colomar via Libc-alpha <libc-alpha@sourceware.org> Reply-To: Alejandro Colomar <alx.manpages@gmail.com> Cc: Alejandro Colomar <alx.manpages@gmail.com>, linux-man@vger.kernel.org, libc-alpha@sourceware.org Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" <libc-alpha-bounces@sourceware.org> |
Series |
[1/3] alloc_hugepages.2, arch_prctl.2, capget.2, clone.2, delete_module.2, execveat.2, exit_group.2, get_robust_list.2, getunwind.2, init_module.2: Add note about the use of syscall(2)
|
|
Commit Message
Alejandro Colomar
April 21, 2021, 10:44 p.m. UTC
I can't see a reason to include it. <fcntl.h> provides O_*
constants for 'flags', S_* constants for 'mode', and mode_t.
Probably a long time ago, some of those weren't defined in
<fcntl.h>, and both headers needed to be included, or maybe it's
a historical error.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
man2/open.2 | 1 -
1 file changed, 1 deletion(-)
Comments
Hello Alex, On 4/22/21 10:44 AM, Alejandro Colomar wrote: > I can't see a reason to include it. <fcntl.h> provides O_* > constants for 'flags', S_* constants for 'mode', and mode_t. > > Probably a long time ago, some of those weren't defined in > <fcntl.h>, and both headers needed to be included, or maybe it's > a historical error. > > Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com> So, I am uncertain what to do about this patch. I agree that we don't need the <sys/stat.h> on Linux. But, look at open(3p): SYNOPSIS #include <sys/stat.h> #include <fcntl.h> int open(const char *path, int oflag, ...); O_CREAT [...] and the access permission bits (see <sys/stat.h>) 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 <fcntl.h> header shall define the symbolic constants for file modes for use as values of mode_t as described in <sys/stat.h>. It almost seems like a small bug in POSIX. I see also that open(2) on FreeBSD mentions only the need to include <fcntl.h>. 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 <sys/stat.h> > .B #include <fcntl.h> > .PP > .BI "int open(const char *" pathname ", int " flags ); >
Hi Michael! On 5/9/21 10:02 PM, Michael Kerrisk (man-pages) wrote: > It almost seems like a small bug in POSIX. Yes, it seems so. > > I see also that open(2) on FreeBSD mentions only the need to > include <fcntl.h>. > > What are your thoughts on the above. I'm willing to apply your > patch if you still think we should apply it. We could file a bug to the Open Group. Could you do that? I don't know how to do it. Let's wait and see. I don't have any patches that depend on this one, so we can hold on. I'll ping you in a month or so if needed. I guess that POSIX will confirm that we can remove it, but let's wait. Thanks, Alex
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 <sys/stat.h> .B #include <fcntl.h> .PP .BI "int open(const char *" pathname ", int " flags );