Skip to content

Commit

Permalink
Define LookupLock by means of BPF_F_LOCK
Browse files Browse the repository at this point in the history
Signed-off-by: Tobias Klauser <tobias@cilium.io>
  • Loading branch information
tklauser authored and ti-mo committed Apr 11, 2024
1 parent 1d00992 commit 32b95e4
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions internal/unix/types_linux.go
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions internal/unix/types_other.go
Expand Up @@ -93,6 +93,7 @@ const (
DEBUGFS_MAGIC
BPF_RB_NO_WAKEUP
BPF_RB_FORCE_WAKEUP
BPF_F_LOCK
)

type Statfs_t struct {
Expand Down
2 changes: 1 addition & 1 deletion map.go
Expand Up @@ -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.
//
Expand Down

0 comments on commit 32b95e4

Please sign in to comment.