Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net
[platform/kernel/linux-rpi.git] / tools / include / uapi / linux / bpf.h
index c994ff5..6961a7b 100644 (file)
@@ -1273,6 +1273,9 @@ enum {
 
 /* Create a map that will be registered/unregesitered by the backed bpf_link */
        BPF_F_LINK              = (1U << 13),
+
+/* Get path from provided FD in BPF_OBJ_PIN/BPF_OBJ_GET commands */
+       BPF_F_PATH_FD           = (1U << 14),
 };
 
 /* Flags for BPF_PROG_QUERY. */
@@ -1421,6 +1424,13 @@ union bpf_attr {
                __aligned_u64   pathname;
                __u32           bpf_fd;
                __u32           file_flags;
+               /* Same as dirfd in openat() syscall; see openat(2)
+                * manpage for details of path FD and pathname semantics;
+                * path_fd should accompanied by BPF_F_PATH_FD flag set in
+                * file_flags field, otherwise it should be set to zero;
+                * if BPF_F_PATH_FD flag is not set, AT_FDCWD is assumed.
+                */
+               __s32           path_fd;
        };
 
        struct { /* anonymous struct used by BPF_PROG_ATTACH/DETACH commands */