/usr/share/cagefs-skeleton/usr/include/linux
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ #ifndef _LINUX_FANOTIFY_H #define _LINUX_FANOTIFY_H #include <linux/types.h> /* the following events that user-space can register for */ #define FAN_ACCESS 0x00000001 /* File was accessed */ #define FAN_MODIFY 0x00000002 /* File was modified */ #define FAN_ATTRIB 0x00000004 /* Metadata changed */ #define FAN_CLOSE_WRITE 0x00000008 /* Writtable file closed */ #define FAN_CLOSE_NOWRITE 0x00000010 /* Unwrittable file closed */ #define FAN_OPEN 0x00000020 /* File was opened */ #define FAN_MOVED_FROM 0x00000040 /* File was moved from X */ #define FAN_MOVED_TO 0x00000080 /* File was moved to Y */ #define FAN_CREATE 0x00000100 /* Subfile was created */ #define FAN_DELETE 0x00000200 /* Subfile was deleted */ #define FAN_DELETE_SELF 0x00000400 /* Self was deleted */ #define FAN_MOVE_SELF 0x00000800 /* Self was moved */ #define FAN_OPEN_EXEC 0x00001000 /* File was opened for exec */ #define FAN_Q_OVERFLOW 0x00004000 /* Event queued overflowed */ #define FAN_OPEN_PERM 0x00010000 /* File open in perm check */ #define FAN_ACCESS_PERM 0x00020000 /* File accessed in perm check */ #define FAN_OPEN_EXEC_PERM 0x00040000 /* File open/exec in perm check */ #define FAN_EVENT_ON_CHILD 0x08000000 /* Interested in child events */ #define FAN_ONDIR 0x40000000 /* Event occurred against dir */ /* helper events */ #define FAN_CLOSE (FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE) /* close */ #define FAN_MOVE (FAN_MOVED_FROM | FAN_MOVED_TO) /* moves */ /* flags used for fanotify_init() */ #define FAN_CLOEXEC 0x00000001 #define FAN_NONBLOCK 0x00000002 /* These are NOT bitwise flags. Both bits are used together. */ #define FAN_CLASS_NOTIF 0x00000000 #define FAN_CLASS_CONTENT 0x00000004 #define FAN_CLASS_PRE_CONTENT 0x00000008 /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | \ FAN_CLASS_PRE_CONTENT) #define FAN_UNLIMITED_QUEUE 0x00000010 #define FAN_UNLIMITED_MARKS 0x00000020 #define FAN_ENABLE_AUDIT 0x00000040 /* Flags to determine fanotify event format */ #define FAN_REPORT_TID 0x00000100 /* event->pid is thread id */ #define FAN_REPORT_FID 0x00000200 /* Report unique file id */ #define FAN_REPORT_DIR_FID 0x00000400 /* Report unique directory id */ #define FAN_REPORT_NAME 0x00000800 /* Report events with name */ /* Convenience macro - FAN_REPORT_NAME requires FAN_REPORT_DIR_FID */ #define FAN_REPORT_DFID_NAME (FAN_REPORT_DIR_FID | FAN_REPORT_NAME) /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_INIT_FLAGS (FAN_CLOEXEC | FAN_NONBLOCK | \ FAN_ALL_CLASS_BITS | FAN_UNLIMITED_QUEUE |\ FAN_UNLIMITED_MARKS) /* flags used for fanotify_modify_mark() */ #define FAN_MARK_ADD 0x00000001 #define FAN_MARK_REMOVE 0x00000002 #define FAN_MARK_DONT_FOLLOW 0x00000004 #define FAN_MARK_ONLYDIR 0x00000008 /* FAN_MARK_MOUNT is 0x00000010 */ #define FAN_MARK_IGNORED_MASK 0x00000020 #define FAN_MARK_IGNORED_SURV_MODIFY 0x00000040 #define FAN_MARK_FLUSH 0x00000080 /* FAN_MARK_FILESYSTEM is 0x00000100 */ /* These are NOT bitwise flags. Both bits can be used togther. */ #define FAN_MARK_INODE 0x00000000 #define FAN_MARK_MOUNT 0x00000010 #define FAN_MARK_FILESYSTEM 0x00000100 /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_MARK_FLAGS (FAN_MARK_ADD |\ FAN_MARK_REMOVE |\ FAN_MARK_DONT_FOLLOW |\ FAN_MARK_ONLYDIR |\ FAN_MARK_MOUNT |\ FAN_MARK_IGNORED_MASK |\ FAN_MARK_IGNORED_SURV_MODIFY |\ FAN_MARK_FLUSH) /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_EVENTS (FAN_ACCESS |\ FAN_MODIFY |\ FAN_CLOSE |\ FAN_OPEN) /* * All events which require a permission response from userspace */ /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_PERM_EVENTS (FAN_OPEN_PERM |\ FAN_ACCESS_PERM) /* Deprecated - do not use this in programs and do not add new flags here! */ #define FAN_ALL_OUTGOING_EVENTS (FAN_ALL_EVENTS |\ FAN_ALL_PERM_EVENTS |\ FAN_Q_OVERFLOW) #define FANOTIFY_METADATA_VERSION 3 struct fanotify_event_metadata { __u32 event_len; __u8 vers; __u8 reserved; __u16 metadata_len; __aligned_u64 mask; __s32 fd; __s32 pid; }; #define FAN_EVENT_INFO_TYPE_FID 1 #define FAN_EVENT_INFO_TYPE_DFID_NAME 2 #define FAN_EVENT_INFO_TYPE_DFID 3 /* Variable length info record following event metadata */ struct fanotify_event_info_header { __u8 info_type; __u8 pad; __u16 len; }; /* * Unique file identifier info record. * This structure is used for records of types FAN_EVENT_INFO_TYPE_FID, * FAN_EVENT_INFO_TYPE_DFID and FAN_EVENT_INFO_TYPE_DFID_NAME. * For FAN_EVENT_INFO_TYPE_DFID_NAME there is additionally a null terminated * name immediately after the file handle. */ struct fanotify_event_info_fid { struct fanotify_event_info_header hdr; __kernel_fsid_t fsid; /* * Following is an opaque struct file_handle that can be passed as * an argument to open_by_handle_at(2). */ unsigned char handle[0]; }; /* * User space may need to record additional information about its decision. * The extra information type records what kind of information is included. * The default is none. We also define an extra information buffer whose * size is determined by the extra information type. * * If the information type is Audit Rule, then the information following * is the rule number that triggered the user space decision that * requires auditing. */ #define FAN_RESPONSE_INFO_NONE 0 #define FAN_RESPONSE_INFO_AUDIT_RULE 1 struct fanotify_response { __s32 fd; __u32 response; }; struct fanotify_response_info_header { __u8 type; __u8 pad; __u16 len; }; struct fanotify_response_info_audit_rule { struct fanotify_response_info_header hdr; __u32 rule_number; __u32 subj_trust; __u32 obj_trust; }; /* Legit userspace responses to a _PERM event */ #define FAN_ALLOW 0x01 #define FAN_DENY 0x02 #define FAN_AUDIT 0x10 /* Bitmask to create audit record for result */ #define FAN_INFO 0x20 /* Bitmask to indicate additional information */ /* No fd set in event */ #define FAN_NOFD -1 /* Helper functions to deal with fanotify_event_metadata buffers */ #define FAN_EVENT_METADATA_LEN (sizeof(struct fanotify_event_metadata)) #define FAN_EVENT_NEXT(meta, len) ((len) -= (meta)->event_len, \ (struct fanotify_event_metadata*)(((char *)(meta)) + \ (meta)->event_len)) #define FAN_EVENT_OK(meta, len) ((long)(len) >= (long)FAN_EVENT_METADATA_LEN && \ (long)(meta)->event_len >= (long)FAN_EVENT_METADATA_LEN && \ (long)(meta)->event_len <= (long)(len)) #endif /* _LINUX_FANOTIFY_H */
.
Edit
..
Edit
a.out.h
Edit
acct.h
Edit
acrn.h
Edit
adb.h
Edit
adfs_fs.h
Edit
affs_hardblocks.h
Edit
agpgart.h
Edit
aio_abi.h
Edit
am437x-vpfe.h
Edit
android
Edit
apm_bios.h
Edit
arcfb.h
Edit
arm_sdei.h
Edit
aspeed-lpc-ctrl.h
Edit
aspeed-p2a-ctrl.h
Edit
atalk.h
Edit
atm.h
Edit
atm_eni.h
Edit
atm_he.h
Edit
atm_idt77105.h
Edit
atm_nicstar.h
Edit
atm_tcp.h
Edit
atm_zatm.h
Edit
atmapi.h
Edit
atmarp.h
Edit
atmbr2684.h
Edit
atmclip.h
Edit
atmdev.h
Edit
atmioc.h
Edit
atmlec.h
Edit
atmmpc.h
Edit
atmppp.h
Edit
atmsap.h
Edit
atmsvc.h
Edit
audit.h
Edit
auto_dev-ioctl.h
Edit
auto_fs.h
Edit
auto_fs4.h
Edit
auxvec.h
Edit
ax25.h
Edit
batadv_packet.h
Edit
batman_adv.h
Edit
baycom.h
Edit
bcm933xx_hcs.h
Edit
bfs_fs.h
Edit
binfmts.h
Edit
bits.h
Edit
blkpg.h
Edit
blktrace_api.h
Edit
blkzoned.h
Edit
bpf.h
Edit
bpf_common.h
Edit
bpf_perf_event.h
Edit
bpfilter.h
Edit
bpqether.h
Edit
bsg.h
Edit
bt-bmc.h
Edit
btf.h
Edit
btrfs.h
Edit
btrfs_tree.h
Edit
byteorder
Edit
cachefiles.h
Edit
caif
Edit
can
Edit
can.h
Edit
capability.h
Edit
capi.h
Edit
cciss_defs.h
Edit
cciss_ioctl.h
Edit
ccs.h
Edit
cdrom.h
Edit
cec-funcs.h
Edit
cec.h
Edit
cfm_bridge.h
Edit
cgroupstats.h
Edit
chio.h
Edit
cifs
Edit
close_range.h
Edit
cm4000_cs.h
Edit
cn_proc.h
Edit
coda.h
Edit
coff.h
Edit
connector.h
Edit
const.h
Edit
coresight-stm.h
Edit
cramfs_fs.h
Edit
cryptouser.h
Edit
cuda.h
Edit
cxl_mem.h
Edit
cycx_cfm.h
Edit
dcbnl.h
Edit
dccp.h
Edit
devlink.h
Edit
dlm.h
Edit
dlm_device.h
Edit
dlm_netlink.h
Edit
dlm_plock.h
Edit
dlmconstants.h
Edit
dm-ioctl.h
Edit
dm-log-userspace.h
Edit
dma-buf.h
Edit
dma-heap.h
Edit
dn.h
Edit
dns_resolver.h
Edit
dpll.h
Edit
dqblk_xfs.h
Edit
dvb
Edit
edd.h
Edit
efs_fs_sb.h
Edit
elf-em.h
Edit
elf-fdpic.h
Edit
elf.h
Edit
errno.h
Edit
errqueue.h
Edit
erspan.h
Edit
ethtool.h
Edit
ethtool_netlink.h
Edit
eventfd.h
Edit
eventpoll.h
Edit
f2fs.h
Edit
fadvise.h
Edit
falloc.h
Edit
fanotify.h
Edit
fb.h
Edit
fcntl.h
Edit
fd.h
Edit
fdreg.h
Edit
fib_rules.h
Edit
fiemap.h
Edit
filter.h
Edit
firewire-cdev.h
Edit
firewire-constants.h
Edit
fou.h
Edit
fpga-dfl.h
Edit
fs.h
Edit
fscrypt.h
Edit
fsi.h
Edit
fsl_hypervisor.h
Edit
fsl_mc.h
Edit
fsmap.h
Edit
fsverity.h
Edit
fuse.h
Edit
futex.h
Edit
gameport.h
Edit
gen_stats.h
Edit
genetlink.h
Edit
genwqe
Edit
gfs2_ondisk.h
Edit
gpio.h
Edit
gsmmux.h
Edit
gtp.h
Edit
handshake.h
Edit
hash_info.h
Edit
hdlc
Edit
hdlc.h
Edit
hdlcdrv.h
Edit
hdreg.h
Edit
hid.h
Edit
hiddev.h
Edit
hidraw.h
Edit
hpet.h
Edit
hsi
Edit
hsr_netlink.h
Edit
hw_breakpoint.h
Edit
hyperv.h
Edit
i2c-dev.h
Edit
i2c.h
Edit
i2o-dev.h
Edit
i8k.h
Edit
icmp.h
Edit
icmpv6.h
Edit
idxd.h
Edit
if.h
Edit
if_addr.h
Edit
if_addrlabel.h
Edit
if_alg.h
Edit
if_arcnet.h
Edit
if_arp.h
Edit
if_bonding.h
Edit
if_bridge.h
Edit
if_cablemodem.h
Edit
if_eql.h
Edit
if_ether.h
Edit
if_fc.h
Edit
if_fddi.h
Edit
if_hippi.h
Edit
if_infiniband.h
Edit
if_link.h
Edit
if_ltalk.h
Edit
if_macsec.h
Edit
if_packet.h
Edit
if_phonet.h
Edit
if_plip.h
Edit
if_ppp.h
Edit
if_pppol2tp.h
Edit
if_pppox.h
Edit
if_slip.h
Edit
if_team.h
Edit
if_tun.h
Edit
if_tunnel.h
Edit
if_vlan.h
Edit
if_x25.h
Edit
if_xdp.h
Edit
ife.h
Edit
igmp.h
Edit
iio
Edit
ila.h
Edit
in.h
Edit
in6.h
Edit
in_route.h
Edit
inet_diag.h
Edit
inotify.h
Edit
input-event-codes.h
Edit
input.h
Edit
io_uring.h
Edit
ioctl.h
Edit
iommufd.h
Edit
ioprio.h
Edit
ip.h
Edit
ip6_tunnel.h
Edit
ip_vs.h
Edit
ipc.h
Edit
ipmi.h
Edit
ipmi_bmc.h
Edit
ipmi_msgdefs.h
Edit
ipmi_ssif_bmc.h
Edit
ipsec.h
Edit
ipv6.h
Edit
ipv6_route.h
Edit
ipx.h
Edit
irqnr.h
Edit
isdn
Edit
iso_fs.h
Edit
isst_if.h
Edit
ivtv.h
Edit
ivtvfb.h
Edit
jffs2.h
Edit
joystick.h
Edit
kcm.h
Edit
kcmp.h
Edit
kcov.h
Edit
kd.h
Edit
kdev_t.h
Edit
kernel-page-flags.h
Edit
kernel.h
Edit
kernelcapi.h
Edit
kexec.h
Edit
keyboard.h
Edit
keyctl.h
Edit
kfd_ioctl.h
Edit
kfd_sysfs.h
Edit
kvm.h
Edit
kvm_para.h
Edit
l2tp.h
Edit
landlock.h
Edit
libc-compat.h
Edit
limits.h
Edit
lirc.h
Edit
llc.h
Edit
loadpin.h
Edit
loop.h
Edit
lp.h
Edit
lsm.h
Edit
lwtunnel.h
Edit
magic.h
Edit
major.h
Edit
map_to_7segment.h
Edit
matroxfb.h
Edit
max2175.h
Edit
mdio.h
Edit
media-bus-format.h
Edit
media.h
Edit
mei.h
Edit
mei_uuid.h
Edit
membarrier.h
Edit
memfd.h
Edit
mempolicy.h
Edit
meye.h
Edit
mii.h
Edit
minix_fs.h
Edit
misc
Edit
mman.h
Edit
mmc
Edit
mmtimer.h
Edit
module.h
Edit
mount.h
Edit
mpls.h
Edit
mpls_iptunnel.h
Edit
mptcp.h
Edit
mptcp_pm.h
Edit
mqueue.h
Edit
mroute.h
Edit
mroute6.h
Edit
mrp_bridge.h
Edit
msdos_fs.h
Edit
msg.h
Edit
mtio.h
Edit
nbd-netlink.h
Edit
nbd.h
Edit
ncsi.h
Edit
ndctl.h
Edit
neighbour.h
Edit
net.h
Edit
net_dropmon.h
Edit
net_namespace.h
Edit
net_tstamp.h
Edit
netconf.h
Edit
netdev.h
Edit
netdevice.h
Edit
netfilter
Edit
netfilter.h
Edit
netfilter_arp
Edit
netfilter_arp.h
Edit
netfilter_bridge
Edit
netfilter_bridge.h
Edit
netfilter_decnet.h
Edit
netfilter_ipv4
Edit
netfilter_ipv4.h
Edit
netfilter_ipv6
Edit
netfilter_ipv6.h
Edit
netlink.h
Edit
netlink_diag.h
Edit
netrom.h
Edit
nexthop.h
Edit
nfc.h
Edit
nfs.h
Edit
nfs2.h
Edit
nfs3.h
Edit
nfs4.h
Edit
nfs4_mount.h
Edit
nfs_fs.h
Edit
nfs_idmap.h
Edit
nfs_mount.h
Edit
nfsacl.h
Edit
nfsd
Edit
nfsd_netlink.h
Edit
nilfs2_api.h
Edit
nilfs2_ondisk.h
Edit
nitro_enclaves.h
Edit
nl80211.h
Edit
nsfs.h
Edit
nubus.h
Edit
nvme_ioctl.h
Edit
nvram.h
Edit
omap3isp.h
Edit
omapfb.h
Edit
oom.h
Edit
openat2.h
Edit
openvswitch.h
Edit
packet_diag.h
Edit
param.h
Edit
parport.h
Edit
patchkey.h
Edit
pci.h
Edit
pci_regs.h
Edit
pcitest.h
Edit
perf_event.h
Edit
personality.h
Edit
pfkeyv2.h
Edit
pfrut.h
Edit
pg.h
Edit
phantom.h
Edit
phonet.h
Edit
pidfd.h
Edit
pkt_cls.h
Edit
pkt_sched.h
Edit
pktcdvd.h
Edit
pmu.h
Edit
poll.h
Edit
posix_acl.h
Edit
posix_acl_xattr.h
Edit
posix_types.h
Edit
ppdev.h
Edit
ppp-comp.h
Edit
ppp-ioctl.h
Edit
ppp_defs.h
Edit
pps.h
Edit
pr.h
Edit
prctl.h
Edit
psample.h
Edit
psci.h
Edit
psp-dbc.h
Edit
psp-sev.h
Edit
ptp_clock.h
Edit
ptrace.h
Edit
qemu_fw_cfg.h
Edit
qnx4_fs.h
Edit
qnxtypes.h
Edit
qrtr.h
Edit
quota.h
Edit
radeonfb.h
Edit
raid
Edit
random.h
Edit
rds.h
Edit
reboot.h
Edit
reiserfs_fs.h
Edit
reiserfs_xattr.h
Edit
remoteproc_cdev.h
Edit
resource.h
Edit
rfkill.h
Edit
rio_cm_cdev.h
Edit
rio_mport_cdev.h
Edit
rkisp1-config.h
Edit
romfs_fs.h
Edit
rose.h
Edit
route.h
Edit
rpl.h
Edit
rpl_iptunnel.h
Edit
rpmsg.h
Edit
rpmsg_types.h
Edit
rseq.h
Edit
rtc.h
Edit
rtnetlink.h
Edit
rxrpc.h
Edit
scc.h
Edit
sched
Edit
sched.h
Edit
scif_ioctl.h
Edit
screen_info.h
Edit
sctp.h
Edit
seccomp.h
Edit
securebits.h
Edit
sed-opal.h
Edit
seg6.h
Edit
seg6_genl.h
Edit
seg6_hmac.h
Edit
seg6_iptunnel.h
Edit
seg6_local.h
Edit
selinux_netlink.h
Edit
sem.h
Edit
serial.h
Edit
serial_core.h
Edit
serial_reg.h
Edit
serio.h
Edit
sev-guest.h
Edit
shm.h
Edit
signal.h
Edit
signalfd.h
Edit
smc.h
Edit
smc_diag.h
Edit
smiapp.h
Edit
snmp.h
Edit
sock_diag.h
Edit
socket.h
Edit
sockios.h
Edit
sonet.h
Edit
sonypi.h
Edit
sound.h
Edit
soundcard.h
Edit
spi
Edit
stat.h
Edit
stddef.h
Edit
stm.h
Edit
string.h
Edit
sunrpc
Edit
surface_aggregator
Edit
suspend_ioctls.h
Edit
swab.h
Edit
switchtec_ioctl.h
Edit
sync_file.h
Edit
synclink.h
Edit
sysctl.h
Edit
sysinfo.h
Edit
target_core_user.h
Edit
taskstats.h
Edit
tc_act
Edit
tc_ematch
Edit
tcp.h
Edit
tcp_metrics.h
Edit
tdx-guest.h
Edit
tee.h
Edit
termios.h
Edit
thermal.h
Edit
time.h
Edit
time_types.h
Edit
timerfd.h
Edit
times.h
Edit
timex.h
Edit
tiocl.h
Edit
tipc.h
Edit
tipc_config.h
Edit
tipc_netlink.h
Edit
tipc_sockets_diag.h
Edit
tls.h
Edit
toshiba.h
Edit
tps6594_pfsm.h
Edit
tty.h
Edit
tty_flags.h
Edit
types.h
Edit
udf_fs_i.h
Edit
udmabuf.h
Edit
udp.h
Edit
uhid.h
Edit
uinput.h
Edit
uio.h
Edit
uleds.h
Edit
ultrasound.h
Edit
um_timetravel.h
Edit
un.h
Edit
unistd.h
Edit
unix_diag.h
Edit
usb
Edit
usbdevice_fs.h
Edit
usbip.h
Edit
userfaultfd.h
Edit
userio.h
Edit
utime.h
Edit
utsname.h
Edit
uuid.h
Edit
uvcvideo.h
Edit
v4l2-common.h
Edit
v4l2-controls.h
Edit
v4l2-dv-timings.h
Edit
v4l2-mediabus.h
Edit
v4l2-subdev.h
Edit
vbox_err.h
Edit
vbox_vmmdev_types.h
Edit
vboxguest.h
Edit
vdpa.h
Edit
vduse.h
Edit
version.h
Edit
veth.h
Edit
vfio.h
Edit
vfio_ccw.h
Edit
vfio_zdev.h
Edit
vhost.h
Edit
vhost_types.h
Edit
videodev2.h
Edit
virtio_9p.h
Edit
virtio_balloon.h
Edit
virtio_blk.h
Edit
virtio_bt.h
Edit
virtio_config.h
Edit
virtio_console.h
Edit
virtio_crypto.h
Edit
virtio_fs.h
Edit
virtio_gpio.h
Edit
virtio_gpu.h
Edit
virtio_i2c.h
Edit
virtio_ids.h
Edit
virtio_input.h
Edit
virtio_iommu.h
Edit
virtio_mem.h
Edit
virtio_mmio.h
Edit
virtio_net.h
Edit
virtio_pci.h
Edit
virtio_pcidev.h
Edit
virtio_pmem.h
Edit
virtio_ring.h
Edit
virtio_rng.h
Edit
virtio_scmi.h
Edit
virtio_scsi.h
Edit
virtio_snd.h
Edit
virtio_types.h
Edit
virtio_vsock.h
Edit
vm_sockets.h
Edit
vm_sockets_diag.h
Edit
vmcore.h
Edit
vsockmon.h
Edit
vt.h
Edit
vtpm_proxy.h
Edit
wait.h
Edit
watch_queue.h
Edit
watchdog.h
Edit
wireguard.h
Edit
wireless.h
Edit
wmi.h
Edit
wwan.h
Edit
x25.h
Edit
xattr.h
Edit
xdp_diag.h
Edit
xfrm.h
Edit
xilinx-v4l2-controls.h
Edit
zorro.h
Edit
zorro_ids.h
Edit