fcancel(2)


NAME
     fcancel - cancel an asynchronous I/O operation

SYNOPSIS
     #define _MINIX_SOURCE 1

     #include <sys/types.h>
     #include <fcntl.h>

     int fcancel(int *fd, int operation)

DESCRIPTION
     Fcancel cancels an asynchronous I/O operation.  The effect is similar  to
     receiving a signal during a blocking system call, with the exception that
     fwait(2) has to be used to get the result of  the  operation,  just  like
     normal asynchronous I/O operations.

     The first argument to fcancel  specifies  the  file  descriptor  and  the
     second argument (operation) specifies which operation should be canceled.
     Operation takes one of three values defined in <fcntl.h>:

     #define ASIO_READ 0
     #define ASIO_WRITE 1
     #define ASIO_IOCTL 2

     They cancel respectively read, write and ioctl operations.

     If fcancel is performed on a completed asynchronous I/O  operation  whose
     status has not been reported by fwait then fcancel is a no-op.

RETURN VALUES
     fcancel returns 0 upon success and -1 upon failure.

ERRORS

     EBADF
          fd does not refer to an open file descriptor

     EINVAL
          operation has an illegal value, or no asynchronous operation  is  in
          progress for this file descriptor/operation combination

SEE ALSO
     fwait(2).

AUTHOR
     Philip Homburg (philip@cs.vu.nl)