Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.5 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 87049C433E0 for ; Tue, 9 Feb 2021 12:28:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43F6E64EB1 for ; Tue, 9 Feb 2021 12:28:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229626AbhBIM2Z (ORCPT ); Tue, 9 Feb 2021 07:28:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229503AbhBIM2Y (ORCPT ); Tue, 9 Feb 2021 07:28:24 -0500 Received: from mail-ej1-x629.google.com (mail-ej1-x629.google.com [IPv6:2a00:1450:4864:20::629]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DD30C061786 for ; Tue, 9 Feb 2021 04:27:44 -0800 (PST) Received: by mail-ej1-x629.google.com with SMTP id jj19so31013699ejc.4 for ; Tue, 09 Feb 2021 04:27:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=BOwyYXqV408vrsQ0qObVRTVlkAluUIzudoJs4Zic1K4=; b=HsrXJFmGuMrdEjhPfC8wubXUT1rJKUF9UZcoMCtZktbDn7xmAlVtAbEkn6VpsFfBLY lzEsfbhQxIIPZOgEmCjuQY9kFVJEppJdP1M8L7i2yQQaNV7Qwt97F1ooGXOIr2W7NC27 Ks22x8YxmoB/X53ylklp70dQBIaoAS+tMzQzm+Mj2auoUgTnjgjR4FvqjfYLxW5Ytzqy siCO9IUvl9xNMGWY4wPuSzm9saXbOK74/u4wYHB142bSD4boCwo2vaWWOUkF/qcj+4xi 0Tpjs4INVefedMEZNkMfmlr3M2YGGW0D6+BgSsO20zlu8jgF4C9q6DGCYpY2TZdY/sIB 40hA== 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=BOwyYXqV408vrsQ0qObVRTVlkAluUIzudoJs4Zic1K4=; b=etgA1Ir5FzslmEG4QMTpBfM3HM+3dAv+2VOXF1oHHdJmO9ggue7L8n4kBycgSFPjuR og+TtgwCCcj3GRpza0Fu8HeXYwvmKbBBLzpBJK3KDF2xkly4rW9HpIrH5iOr523KxhRn 1szZbh/68SzKPnnyNjohnChpjKgZ3kJj8b/wNePvJGbMTQWDZjzETuEjNxGi4Xz4+zYd Uh49xoIkVPPvpKNnaAnvtLogwcQOqN+OArVGuYZ1kZGWzqAgFZ/lViKwQFwQVPl5Y9gH wIHNYhUzD3SqoVn7P5sZgjEHlxz5AnKvx/EHIMYNxefSKFzLqcrPeRD36MRMSl3TjCiu 5rWw== X-Gm-Message-State: AOAM532nFCbHr57Rd1wm1Ft7DICitnAiq4cFi2RYSjs5kbmE/4ZWefI2 5pOFxbyVed//01ITflEK7Ew= X-Google-Smtp-Source: ABdhPJxzIakx3/AoqDngLL4kFwf9iEYn/Gcc6Jo8EUtiMypTcDH41T75DQ+MrrwmUYYajn3ATnxkaw== X-Received: by 2002:a17:906:7689:: with SMTP id o9mr22426866ejm.324.1612873662858; Tue, 09 Feb 2021 04:27:42 -0800 (PST) Received: from ?IPv6:2001:a61:24ca:4d01:a815:d0d9:f754:e0ef? ([2001:a61:24ca:4d01:a815:d0d9:f754:e0ef]) by smtp.gmail.com with ESMTPSA id b17sm11366218edv.56.2021.02.09.04.27.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Feb 2021 04:27:42 -0800 (PST) Cc: mtk.manpages@gmail.com, Alejandro Colomar Subject: Re: Why does stat(2) say is needed? To: Jonathan Wakely , linux-man@vger.kernel.org References: <20210209110912.GX3008@redhat.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Tue, 9 Feb 2021 13:27:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <20210209110912.GX3008@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-man@vger.kernel.org Hi Jonathan! On 2/9/21 12:09 PM, Jonathan Wakely wrote: > The stat(2) man page says: > > SYNOPSIS > #include > #include > #include > > int stat(const char *pathname, struct stat *statbuf); > int fstat(int fd, struct stat *statbuf); > int lstat(const char *pathname, struct stat *statbuf); > > But I don't see anything there that would require . POSIX > doesn't require it (and since POSIX.1-2001 no longer requires > , saying "Although was required for > conforming implementations of previous POSIX specifications, it was > not required for UNIX applications.") > > Is the inclusion of there a mistake? I do not know the reasons for it, but it has been there in the manual page since 1993, and the reasons are thus lost in the mists of the VCS and mailing list that the project did not have back then :-}. By now, I'm prepared to classify it as a mistake. Thanks, Michael > I've been trying to track down why a libstdc++ header includes > for no apparent reason, and my best guess is that it's a > result of this man page saying to do it. > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/