Skip to content

Commit

Permalink
Use new bpf_map__lookup_elem()
Browse files Browse the repository at this point in the history
Signed-off-by: grantseltzer <grantseltzer@gmail.com>
  • Loading branch information
grantseltzer committed Jun 20, 2022
1 parent 40048ec commit 3d125fa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libbpfgo.go
Expand Up @@ -646,7 +646,7 @@ func (b *BPFMap) GetValue(key unsafe.Pointer) ([]byte, error) {
// number of CPUs
func (b *BPFMap) GetValueReadInto(key unsafe.Pointer, value *[]byte) error {
valuePtr := unsafe.Pointer(&(*value)[0])
errC := C.bpf_map_lookup_elem(b.fd, key, valuePtr)
errC := C.bpf_map__lookup_elem(b.bpfMap, key, C.ulong(b.KeySize()), valuePtr, C.ulong(len(*value)), 0)
if errC != 0 {
return fmt.Errorf("failed to lookup value %v in map %s: %w", key, b.name, syscall.Errno(-errC))
}
Expand Down

0 comments on commit 3d125fa

Please sign in to comment.