package main
import (
"fmt"
"log"
"os"
"syscall"
"unsafe"
)
type zn_iocb struct {
/* these are internal to the kernel/libc. */
aio_data uint64
aio_key uint32
aio_reserved1 uint32
/* common fields */
aio_lio_opcode uint16 /* see IOCB_CMD_ above */
aio_reqprio int16
aio_fildes uint32
aio_buf uint64
aio_nbytes uint64
aio_offset int64
/* extra parameters */
aio_reserved2 uint64
aio_flags uint32
aio_resfd uint32
} /* 64 bytes */
type zn_io_event struct {
data uint64 /* the data field from the iocb */
obj uint64 /* what iocb this event came from */
res int64 /* result code for this event */
res2 int64 /* secondary result */
}
type zn_timespec struct {
tv_sec uint64 /* seconds */
tv_nsec uint64 /* nanoseconds */
}
const (
AlignSize = 4096
IOCB_CMD_PREAD uint16 = 0
IOCB_CMD_PWRITE uint16 = 1
IOCB_CMD_FSYNC uint16 = 2
IOCB_CMD_FDSYNC
go语言实现的AIO调用测试代码
最新推荐文章于 2023-03-20 17:52:20 发布