From 32b95e4a83690a69eb2de5796db313893f71d1d0 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 10 Apr 2024 14:18:12 +0200 Subject: [PATCH] Define LookupLock by means of BPF_F_LOCK Signed-off-by: Tobias Klauser --- internal/unix/types_linux.go | 1 + internal/unix/types_other.go | 1 + map.go | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/unix/types_linux.go b/internal/unix/types_linux.go index 025774f72..d725cfaa3 100644 --- a/internal/unix/types_linux.go +++ b/internal/unix/types_linux.go @@ -41,6 +41,7 @@ const ( BPF_F_INNER_MAP = linux.BPF_F_INNER_MAP BPF_F_KPROBE_MULTI_RETURN = linux.BPF_F_KPROBE_MULTI_RETURN BPF_F_UPROBE_MULTI_RETURN = linux.BPF_F_UPROBE_MULTI_RETURN + BPF_F_LOCK = linux.BPF_F_LOCK BPF_OBJ_NAME_LEN = linux.BPF_OBJ_NAME_LEN BPF_TAG_SIZE = linux.BPF_TAG_SIZE BPF_RINGBUF_BUSY_BIT = linux.BPF_RINGBUF_BUSY_BIT diff --git a/internal/unix/types_other.go b/internal/unix/types_other.go index 807037181..3ff896271 100644 --- a/internal/unix/types_other.go +++ b/internal/unix/types_other.go @@ -93,6 +93,7 @@ const ( DEBUGFS_MAGIC BPF_RB_NO_WAKEUP BPF_RB_FORCE_WAKEUP + BPF_F_LOCK ) type Statfs_t struct { diff --git a/map.go b/map.go index b2744dba9..e46fa3f12 100644 --- a/map.go +++ b/map.go @@ -575,7 +575,7 @@ func (m *Map) Info() (*MapInfo, error) { type MapLookupFlags uint64 // LookupLock look up the value of a spin-locked map. -const LookupLock MapLookupFlags = 4 +const LookupLock MapLookupFlags = unix.BPF_F_LOCK // Lookup retrieves a value from a Map. //