Re: [RFC] bpf.2: Use standard types and attributes

Alejandro Colomar (man-pages)
2021-04-24T17:56:42Z

Hello Alexei,

On 4/24/21 1:20 AM, Alexei Starovoitov wrote:
> Nack.
> The man page should describe the kernel api the way it is in .h file.

Why?

When glibc uses __size_t (or any other non-standard types) just because
the standard doesn't allow it to define some types in some specific
header, the manual pages document the equivalent standard type, (i.e.,
if glibc uses __size_t, we document size_t).

The compiler, AFAIK (gcc is CCd, so they can jump in if I'm wrong),
using uint32_t in every situation where __u32 is expected. They're both
typedefs for the same basic type.

I can understand why Linux will keep using u32 types (and their __ user
space variants), but that doesn't mean user space programs need to use
the same type.

If we have a standard syntax for fixed-width integral types (and for
anything, actually), the manual pages should probably follow it,
whenever possible. Any deviation from the standard (be it C or POSIX)
should have a very good reason to be; otherwise, it only creates confusion.

Thanks,

Alex

--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
Senior SW Engineer; http://www.alejandro-colomar.es/