//go:build linux

package aio

import "github.com/brickingsoft/rio/pkg/liburing"

func (op *Operation) Name() string {
	switch op.code {
	case liburing.IORING_OP_NOP:
		return "nop"
	case liburing.IORING_OP_READV:
		return "readv"
	case liburing.IORING_OP_WRITEV:
		return "writev"
	case liburing.IORING_OP_FSYNC:
		return "fsync"
	case liburing.IORING_OP_READ_FIXED:
		return "read_fixed"
	case liburing.IORING_OP_WRITE_FIXED:
		return "write_fixed"
	case liburing.IORING_OP_POLL_ADD:
		return "poll_add"
	case liburing.IORING_OP_POLL_REMOVE:
		return "poll_remove"
	case liburing.IORING_OP_SYNC_FILE_RANGE:
		return "sync_file_range"
	case liburing.IORING_OP_SENDMSG:
		return "sendmsg"
	case liburing.IORING_OP_RECVMSG:
		return "recvmsg"
	case liburing.IORING_OP_TIMEOUT:
		return "op_f_timeout"
	case liburing.IORING_OP_TIMEOUT_REMOVE:
		return "timeout_remove"
	case liburing.IORING_OP_ACCEPT:
		return "accept"
	case liburing.IORING_OP_ASYNC_CANCEL:
		return "async_cancel"
	case liburing.IORING_OP_LINK_TIMEOUT:
		return "link_timeout"
	case liburing.IORING_OP_CONNECT:
		return "connect"
	case liburing.IORING_OP_FALLOCATE:
		return "fallocate"
	case liburing.IORING_OP_OPENAT:
		return "openat"
	case liburing.IORING_OP_CLOSE:
		return "close"
	case liburing.IORING_OP_FILES_UPDATE:
		return "files_update"
	case liburing.IORING_OP_STATX:
		return "statx"
	case liburing.IORING_OP_READ:
		return "read"
	case liburing.IORING_OP_WRITE:
		return "write"
	case liburing.IORING_OP_FADVISE:
		return "fadvise"
	case liburing.IORING_OP_MADVISE:
		return "madvise"
	case liburing.IORING_OP_SEND:
		return "send"
	case liburing.IORING_OP_RECV:
		return "recv"
	case liburing.IORING_OP_OPENAT2:
		return "openat2"
	case liburing.IORING_OP_EPOLL_CTL:
		return "epollctl"
	case liburing.IORING_OP_SPLICE:
		return "splice"
	case liburing.IORING_OP_PROVIDE_BUFFERS:
		return "provide_buffers"
	case liburing.IORING_OP_REMOVE_BUFFERS:
		return "remove_buffers"
	case liburing.IORING_OP_TEE:
		return "tee"
	case liburing.IORING_OP_SHUTDOWN:
		return "shutdown"
	case liburing.IORING_OP_RENAMEAT:
		return "renameat"
	case liburing.IORING_OP_UNLINKAT:
		return "unlinkat"
	case liburing.IORING_OP_MKDIRAT:
		return "mkdirat"
	case liburing.IORING_OP_SYMLINKAT:
		return "symlinkat"
	case liburing.IORING_OP_LINKAT:
		return "linkat"
	case liburing.IORING_OP_MSG_RING:
		return "msgring"
	case liburing.IORING_OP_FSETXATTR:
		return "fsetxattr"
	case liburing.IORING_OP_SETXATTR:
		return "setxattr"
	case liburing.IORING_OP_FGETXATTR:
		return "fgetxattr"
	case liburing.IORING_OP_GETXATTR:
		return "getxattr"
	case liburing.IORING_OP_SOCKET:
		return "socket"
	case liburing.IORING_OP_URING_CMD:
		return "uringcmd"
	case liburing.IORING_OP_SEND_ZC:
		return "sendzc"
	case liburing.IORING_OP_SENDMSG_ZC:
		return "sendmsgzc"
	case liburing.IORING_OP_READ_MULTISHOT:
		return "read_multishot"
	case liburing.IORING_OP_WAITID:
		return "wait_id"
	case liburing.IORING_OP_FUTEX_WAIT:
		return "futex_wait"
	case liburing.IORING_OP_FUTEX_WAKE:
		return "futex_wake"
	case liburing.IORING_OP_FUTEX_WAITV:
		return "futex_waitv"
	case liburing.IORING_OP_FIXED_FD_INSTALL:
		return "fixed_fd_install"
	case liburing.IORING_OP_FTRUNCATE:
		return "ftuncate"
	case liburing.IORING_OP_BIND:
		return "bind"
	case liburing.IORING_OP_LISTEN:
		return "listen"
	case liburing.IORING_OP_RECV_ZC:
		return "recvzc"
	case liburing.IORING_OP_EPOLL_WAIT:
		return "epollwait"
	case liburing.IORING_OP_READV_FIXED:
		return "readv_fixed"
	case liburing.IORING_OP_WRITEV_FIXED:
		return "writev_fixed"
	default:
		return "unknown"
	}
}
