remove extra mkfs.1
[minix.git] / lib / libasyn / asyn_cancel.c
blob664c17bd77980f001e6dd4bd51c50e020f8baf4a
1 /* asyn_cancel() - cancel an asynch operation Author: Kees J. Bot
2 * 7 Jul 1997
3 */
4 #include "asyn.h"
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.)
9 */
11 asynfd_t *afd;
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]);
20 return 0;