github.com/castai/kvisor@v1.7.1-0.20240516114728-b3572a2607b5/pkg/ebpftracer/c/headers/common/binprm.h (about)

     1  #ifndef __COMMON_BINPRM_H__
     2  #define __COMMON_BINPRM_H__
     3  
     4  #include <vmlinux.h>
     5  
     6  #include <common/common.h>
     7  
     8  // PROTOTYPES
     9  
    10  statfunc const char *get_binprm_filename(struct linux_binprm *);
    11  statfunc const char *get_binprm_interp(struct linux_binprm *);
    12  statfunc struct file *get_file_ptr_from_bprm(struct linux_binprm *);
    13  statfunc int get_argc_from_bprm(struct linux_binprm *);
    14  statfunc int get_envc_from_bprm(struct linux_binprm *);
    15  
    16  // FUNCTIONS
    17  
    18  statfunc const char *get_binprm_filename(struct linux_binprm *bprm)
    19  {
    20      return BPF_CORE_READ(bprm, filename);
    21  }
    22  
    23  statfunc const char *get_binprm_interp(struct linux_binprm *bprm)
    24  {
    25      return BPF_CORE_READ(bprm, interp);
    26  }
    27  
    28  statfunc struct file *get_file_ptr_from_bprm(struct linux_binprm *bprm)
    29  {
    30      return BPF_CORE_READ(bprm, file);
    31  }
    32  
    33  statfunc int get_argc_from_bprm(struct linux_binprm *bprm)
    34  {
    35      return BPF_CORE_READ(bprm, argc);
    36  }
    37  
    38  statfunc int get_envc_from_bprm(struct linux_binprm *bprm)
    39  {
    40      return BPF_CORE_READ(bprm, envc);
    41  }
    42  
    43  #endif