1
0
Fork 0
mirror of https://github.com/ii64/gouring.git synced 2025-03-29 01:27:20 +01:00
gouring/hdr_extra.go
2023-04-17 18:38:30 +07:00

39 lines
952 B
Go

package gouring
import (
"unsafe"
)
/*
* GetBigCqe
*
* If the ring is initialized with IORING_SETUP_CQE32, then this field
* contains 16-bytes of padding, doubling the size of the CQE.
*/
func (cqe *IoUringCqe) GetBigCqe() unsafe.Pointer {
return unsafe.Add(unsafe.Pointer(cqe), SizeofIoUringCqe)
}
/*
* GetOps
*
* Get io_uring probe ops
*/
func (probe *IoUringProbe) GetOps() unsafe.Pointer {
return unsafe.Add(unsafe.Pointer(probe), SizeofIoUringProbe)
}
func (probe *IoUringProbe) GetOpAt(index int) *IoUringProbeOp {
return (*IoUringProbeOp)(unsafe.Add(probe.GetOps(), SizeofIoUringProbeOp*uintptr(index)))
}
/*
* GetBufs
*
* Get io_uring buf_ring bufs
*/
func (bring *IoUringBufRing) GetBufs() unsafe.Pointer {
return unsafe.Add(unsafe.Pointer(bring), SizeofIoUringBufRing)
}
func (bring *IoUringBufRing) GetBufAt(index int) *IoUringBuf {
return (*IoUringBuf)(unsafe.Add(bring.GetBufs(), SizeofIoUringBuf*uintptr(index)))
}