mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-10-30 17:58:14 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			24 lines
		
	
	
		
			441 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			441 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package internal
 | |
| 
 | |
| import (
 | |
| 	"runtime"
 | |
| 	"unsafe"
 | |
| 
 | |
| 	"github.com/cilium/ebpf/internal/unix"
 | |
| )
 | |
| 
 | |
| // BPF wraps SYS_BPF.
 | |
| //
 | |
| // Any pointers contained in attr must use the Pointer type from this package.
 | |
| func BPF(cmd int, attr unsafe.Pointer, size uintptr) (uintptr, error) {
 | |
| 	r1, _, errNo := unix.Syscall(unix.SYS_BPF, uintptr(cmd), uintptr(attr), size)
 | |
| 	runtime.KeepAlive(attr)
 | |
| 
 | |
| 	var err error
 | |
| 	if errNo != 0 {
 | |
| 		err = errNo
 | |
| 	}
 | |
| 
 | |
| 	return r1, err
 | |
| }
 | 
