MCPcopy
hub / github.com/cilium/ebpf / bytes

Method bytes

struct_ops.go:51–56  ·  view source on GitHub ↗

bytes returns the portion of `buf` corresponding to the member.

(buf []byte)

Source from the content-addressed store, hash-verified

49
50// bytes returns the portion of `buf` corresponding to the member.
51func (ml *structOpsMemberLayout) bytes(buf []byte) ([]byte, error) {
52 if ml.off < 0 || ml.off+ml.size > len(buf) {
53 return nil, fmt.Errorf("member %q: value buffer too small", ml.member.Name)
54 }
55 return buf[ml.off : ml.off+ml.size], nil
56}
57
58// structOpsFuncPtrMember returns an error unless m is a func pointer member.
59func structOpsFuncPtrMember(m btf.Member) error {

Callers 2

structOpsPopulateValueFunction · 0.80
structOpsCopyMemberBytesFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected