github.com/inspektor-gadget/inspektor-gadget@v0.28.1/pkg/gadgets/top/file/tracer/bpf/stat.h (about)

     1  /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
     2  #ifndef __STAT_H
     3  #define __STAT_H
     4  
     5  /* From include/uapi/linux/stat.h */
     6  
     7  #define S_IFMT 00170000
     8  #define S_IFSOCK 0140000
     9  #define S_IFLNK 0120000
    10  #define S_IFREG 0100000
    11  #define S_IFBLK 0060000
    12  #define S_IFDIR 0040000
    13  #define S_IFCHR 0020000
    14  #define S_IFIFO 0010000
    15  #define S_ISUID 0004000
    16  #define S_ISGID 0002000
    17  #define S_ISVTX 0001000
    18  
    19  #define S_ISLNK(m) (((m)&S_IFMT) == S_IFLNK)
    20  #define S_ISREG(m) (((m)&S_IFMT) == S_IFREG)
    21  #define S_ISDIR(m) (((m)&S_IFMT) == S_IFDIR)
    22  #define S_ISCHR(m) (((m)&S_IFMT) == S_IFCHR)
    23  #define S_ISBLK(m) (((m)&S_IFMT) == S_IFBLK)
    24  #define S_ISFIFO(m) (((m)&S_IFMT) == S_IFIFO)
    25  #define S_ISSOCK(m) (((m)&S_IFMT) == S_IFSOCK)
    26  
    27  #endif /* __STAT_H */