lkml.org 
[lkml]   [2020]   [Apr]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    From
    Date
    SubjectRe: [RFC] uapi: Convert stat.h #define flags to enums
    On Mon, Apr 20, 2020 at 9:39 AM Daniel Xu <dxu@dxuuu.xyz> wrote:
    >
    > Hi Christoph,
    >
    > On Sun Apr 19, 2020 at 6:30 PM PST, Christoph Hellwig wrote:
    > > And that breaks every userspace program using ifdef to check if a
    > > symbolic name has been defined.
    >
    > How about shadowing #define's? Like for `enum nfnetlink_groups` in
    > include/uapi/linux/netfilter/nfnetlink.h .
    >

    FWIW, we did #define to enum conversion for big chunks of BPF UAPI
    headers ([0]) and that greatly improved BPF user experience. A bunch
    of other kernel headers are already using enums for constants. I think
    converting more Linux headers to use enums for constants and capture
    them as part of type information is a good step forward that should
    further simplify writing all kinds of introspection and monitoring
    tools.

    [0] https://patchwork.ozlabs.org/project/netdev/patch/20200303003233.3496043-2-andriin@fb.com/

    > Thanks,
    > Daniel

    \
     
     \ /
      Last update: 2020-04-21 20:25    [W:4.531 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site