1 /* asyn_cancel() - cancel an asynch operation Author: Kees J. Bot
6 int asyn_cancel(asynchio_t
*asyn
, int fd
, int op
)
7 /* Cancel an asynchronous operation if one is in progress. (This is easy with
8 * select(2), because no operation is actually happening.)
13 if ((unsigned) fd
>= FD_SETSIZE
) { errno
= EBADF
; return -1; }
14 afd
= &asyn
->asyn_afd
[fd
];
16 if (afd
->afd_state
[op
] == WAITING
) {
17 afd
->afd_state
[op
]= IDLE
;
18 FD_CLR(fd
, &asyn
->asyn_fdset
[SEL_READ
]);