From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by sourceware.org (Postfix) with ESMTPS id E09AC3947438 for ; Fri, 23 Apr 2021 23:20:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E09AC3947438 Received: by mail-lf1-x12e.google.com with SMTP id h36so25640863lfv.7 for ; Fri, 23 Apr 2021 16:20:38 -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; bh=UN8lYvlKUzpGJek5kJqkHzoy2ZYGZ4aTnHDgEtVTayM=; b=K9FqepAYYH69FmwjF4q+bRA/ZL+VzOcFHo+2levI6BKHDhOAkwtGrulSqrnU6wfOSu GmMFjoujkKhcUTVCmxQ9KCM61ybfxLUS6RiP2LRpxM2gAVbw/100XMjsUWj0kZC7UCDt X+ejLAzHoEwPGcT+QoKpCDP7O7qi4zm8sd8MCU871BBVLsxWoKWg5prOxgI9WyBwjRRf 3IQQMwBFN3BM2Tto0Ayi6c9fwYTmW6qR5vt/dCO/OmYKiw0lC3zcoyalVJeCQZWg3o97 WGf8hDj9IAhRYk+z9p1vwhyDvBtVLvIoQv2Yp+gHHgRyQH0Boc5lPFECxR0qlKAlphWR jrVA== X-Gm-Message-State: AOAM533A6ODJy9tQOO/K6crPnggABipxJb82PXGEvv2rBJlBJpNQz08z +FXm9wDCbCU4VjHbAE4FzTkPRNf/GSBfbWtviNM= X-Google-Smtp-Source: ABdhPJy+70NSFI9yiV1Zf3vRjNCfAKy81SYuXmcSHJyyJH0sQcP51VADEaYyP+gGwB2TgfrCZaEodsB6Qo91uike2qI= X-Received: by 2002:a19:f615:: with SMTP id x21mr4550232lfe.540.1619220037606; Fri, 23 Apr 2021 16:20:37 -0700 (PDT) MIME-Version: 1.0 References: <20210423230609.13519-1-alx.manpages@gmail.com> In-Reply-To: <20210423230609.13519-1-alx.manpages@gmail.com> From: Alexei Starovoitov Date: Fri, 23 Apr 2021 16:20:26 -0700 Message-ID: Subject: Re: [RFC] bpf.2: Use standard types and attributes To: Alejandro Colomar , bpf Cc: "Michael Kerrisk (man-pages)" , linux-man , LKML , libc-alpha@sourceware.org, gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-10.6 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: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Apr 2021 23:20:40 -0000 On Fri, Apr 23, 2021 at 4:15 PM Alejandro Colomar wrote: > > Some manual pages are already using C99 syntax for integral > types 'uint32_t', but some aren't. There are some using kernel > syntax '__u32'. Fix those. > > Some pages also document attributes, using GNU syntax > '__attribute__((xxx))'. Update those to use the shorter and more > portable C2x syntax, which hasn't been standardized yet, but is > already implemented in GCC, and available through either --std=c2x > or any of the --std=gnu... options. > > Signed-off-by: Alejandro Colomar > --- > man2/bpf.2 | 47 +++++++++++++++++++++++------------------------ > 1 file changed, 23 insertions(+), 24 deletions(-) > > diff --git a/man2/bpf.2 b/man2/bpf.2 > index 6e1ffa198..204f01bfc 100644 > --- a/man2/bpf.2 > +++ b/man2/bpf.2 > @@ -188,39 +188,38 @@ commands: > .EX > union bpf_attr { > struct { /* Used by BPF_MAP_CREATE */ > - __u32 map_type; > - __u32 key_size; /* size of key in bytes */ > - __u32 value_size; /* size of value in bytes */ > - __u32 max_entries; /* maximum number of entries > - in a map */ > + uint32_t map_type; > + uint32_t key_size; /* size of key in bytes */ > + uint32_t value_size; /* size of value in bytes */ > + uint32_t max_entries; /* maximum number of entries > + in a map */ Nack. The man page should describe the kernel api the way it is in .h file.