mirror of
https://github.com/ii64/gouring.git
synced 2024-11-22 15:06:42 +01:00
setup: fix ring fd not set
Signed-off-by: Nugraha <richiisei@gmail.com>
This commit is contained in:
parent
793e0b8cbd
commit
aa6bf08729
1 changed files with 8 additions and 8 deletions
16
setup.go
16
setup.go
|
@ -5,11 +5,11 @@ import (
|
||||||
"unsafe"
|
"unsafe"
|
||||||
)
|
)
|
||||||
|
|
||||||
func io_uring_queue_init(entries uint32, ring *IoUring, flags uint32) error {
|
// func io_uring_queue_init(entries uint32, ring *IoUring, flags uint32) error {
|
||||||
p := new(IoUringParams)
|
// p := new(IoUringParams)
|
||||||
p.Flags = flags
|
// p.Flags = flags
|
||||||
return io_uring_queue_init_params(entries, ring, p)
|
// return io_uring_queue_init_params(entries, ring, p)
|
||||||
}
|
// }
|
||||||
|
|
||||||
func io_uring_queue_init_params(entries uint32, ring *IoUring, p *IoUringParams) error {
|
func io_uring_queue_init_params(entries uint32, ring *IoUring, p *IoUringParams) error {
|
||||||
fd, err := io_uring_setup(entries, p)
|
fd, err := io_uring_setup(entries, p)
|
||||||
|
@ -46,11 +46,11 @@ func (ring *IoUring) io_uring_queue_exit() {
|
||||||
func io_uring_queue_mmap(fd int, p *IoUringParams, ring *IoUring) error {
|
func io_uring_queue_mmap(fd int, p *IoUringParams, ring *IoUring) error {
|
||||||
err := io_uring_mmap(fd, p, &ring.Sq, &ring.Cq)
|
err := io_uring_mmap(fd, p, &ring.Sq, &ring.Cq)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ring.Flags = p.Flags
|
|
||||||
ring.RingFd = ring.EnterRingFd
|
|
||||||
ring.IntFlags = 0
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
ring.Flags = p.Flags
|
||||||
|
ring.RingFd, ring.EnterRingFd = int32(fd), int32(fd)
|
||||||
|
ring.IntFlags = 0
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue