The Design and Implementation of the FreeBSD Operating System, Second Edition
Now available: The Design and Implementation of the FreeBSD Operating System (Second Edition)


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]

FreeBSD/Linux Kernel Cross Reference
sys/sys/aio.h

Version: -  FREEBSD  -  FREEBSD-12-STABLE  -  FREEBSD-12-0  -  FREEBSD-11-STABLE  -  FREEBSD-11-2  -  FREEBSD-11-1  -  FREEBSD-11-0  -  FREEBSD-10-STABLE  -  FREEBSD-10-4  -  FREEBSD-10-3  -  FREEBSD-10-2  -  FREEBSD-10-1  -  FREEBSD-10-0  -  FREEBSD-9-STABLE  -  FREEBSD-9-3  -  FREEBSD-9-2  -  FREEBSD-9-1  -  FREEBSD-9-0  -  FREEBSD-8-STABLE  -  FREEBSD-8-4  -  FREEBSD-8-3  -  FREEBSD-8-2  -  FREEBSD-8-1  -  FREEBSD-8-0  -  FREEBSD-7-STABLE  -  FREEBSD-7-4  -  FREEBSD-7-3  -  FREEBSD-7-2  -  FREEBSD-7-1  -  FREEBSD-7-0  -  FREEBSD-6-STABLE  -  FREEBSD-6-4  -  FREEBSD-6-3  -  FREEBSD-6-2  -  FREEBSD-6-1  -  FREEBSD-6-0  -  FREEBSD-5-STABLE  -  FREEBSD-5-5  -  FREEBSD-5-4  -  FREEBSD-5-3  -  FREEBSD-5-2  -  FREEBSD-5-1  -  FREEBSD-5-0  -  FREEBSD-4-STABLE  -  FREEBSD-3-STABLE  -  FREEBSD22  -  linux-2.6  -  linux-2.4.22  -  MK83  -  MK84  -  PLAN9  -  DFBSD  -  NETBSD  -  NETBSD5  -  NETBSD4  -  NETBSD3  -  NETBSD20  -  OPENBSD  -  xnu-517  -  xnu-792  -  xnu-792.6.70  -  xnu-1228  -  xnu-1456.1.26  -  xnu-1699.24.8  -  xnu-2050.18.24  -  OPENSOLARIS  -  minix-3-1-1 
SearchContext: -  none  -  3  -  10 

    1 /*-
    2  * Copyright (c) 1997 John S. Dyson.  All rights reserved.
    3  *
    4  * Redistribution and use in source and binary forms, with or without
    5  * modification, are permitted provided that the following conditions
    6  * are met:
    7  * 1. Redistributions of source code must retain the above copyright
    8  *    notice, this list of conditions and the following disclaimer.
    9  * 2. John S. Dyson's name may not be used to endorse or promote products
   10  *    derived from this software without specific prior written permission.
   11  *
   12  * DISCLAIMER:  This code isn't warranted to do anything useful.  Anything
   13  * bad that happens because of using this software isn't the responsibility
   14  * of the author.  This software is distributed AS-IS.
   15  *
   16  * $FreeBSD: releng/10.4/sys/sys/aio.h 251526 2013-06-08 13:27:57Z glebius $
   17  */
   18 
   19 #ifndef _SYS_AIO_H_
   20 #define _SYS_AIO_H_
   21 
   22 #include <sys/types.h>
   23 #include <sys/signal.h>
   24 
   25 /*
   26  * Returned by aio_cancel:
   27  */
   28 #define AIO_CANCELED            0x1
   29 #define AIO_NOTCANCELED         0x2
   30 #define AIO_ALLDONE             0x3
   31 
   32 /*
   33  * LIO opcodes
   34  */
   35 #define LIO_NOP                 0x0
   36 #define LIO_WRITE               0x1
   37 #define LIO_READ                0x2
   38 #ifdef _KERNEL
   39 #define LIO_SYNC                0x3
   40 #define LIO_MLOCK               0x4
   41 #endif
   42 
   43 /*
   44  * LIO modes
   45  */
   46 #define LIO_NOWAIT              0x0
   47 #define LIO_WAIT                0x1
   48 
   49 /*
   50  * Maximum number of allowed LIO operations
   51  */
   52 #define AIO_LISTIO_MAX          16
   53 
   54 /*
   55  * Private members for aiocb -- don't access
   56  * directly.
   57  */
   58 struct __aiocb_private {
   59         long    status;
   60         long    error;
   61         void    *kernelinfo;
   62 };
   63 
   64 /*
   65  * I/O control block
   66  */
   67 typedef struct aiocb {
   68         int     aio_fildes;             /* File descriptor */
   69         off_t   aio_offset;             /* File offset for I/O */
   70         volatile void *aio_buf;         /* I/O buffer in process space */
   71         size_t  aio_nbytes;             /* Number of bytes for I/O */
   72         int     __spare__[2];
   73         void    *__spare2__;
   74         int     aio_lio_opcode;         /* LIO opcode */
   75         int     aio_reqprio;            /* Request priority -- ignored */
   76         struct  __aiocb_private _aiocb_private;
   77         struct  sigevent aio_sigevent;  /* Signal to deliver */
   78 } aiocb_t;
   79 
   80 #ifndef _KERNEL
   81 
   82 struct timespec;
   83 
   84 __BEGIN_DECLS
   85 /*
   86  * Asynchronously read from a file
   87  */
   88 int     aio_read(struct aiocb *);
   89 
   90 /*
   91  * Asynchronously write to file
   92  */
   93 int     aio_write(struct aiocb *);
   94 
   95 /*
   96  * List I/O Asynchronously/synchronously read/write to/from file
   97  *      "lio_mode" specifies whether or not the I/O is synchronous.
   98  *      "acb_list" is an array of "nacb_listent" I/O control blocks.
   99  *      when all I/Os are complete, the optional signal "sig" is sent.
  100  */
  101 int     lio_listio(int, struct aiocb * const [], int, struct sigevent *);
  102 
  103 /*
  104  * Get completion status
  105  *      returns EINPROGRESS until I/O is complete.
  106  *      this routine does not block.
  107  */
  108 int     aio_error(const struct aiocb *);
  109 
  110 /*
  111  * Finish up I/O, releasing I/O resources and returns the value
  112  *      that would have been associated with a synchronous I/O request.
  113  *      This routine must be called once and only once for each
  114  *      I/O control block who has had I/O associated with it.
  115  */
  116 ssize_t aio_return(struct aiocb *);
  117 
  118 /*
  119  * Cancel I/O
  120  */
  121 int     aio_cancel(int, struct aiocb *);
  122 
  123 /*
  124  * Suspend until all specified I/O or timeout is complete.
  125  */
  126 int     aio_suspend(const struct aiocb * const[], int, const struct timespec *);
  127 
  128 /*
  129  * Asynchronous mlock
  130  */
  131 int     aio_mlock(struct aiocb *);
  132 
  133 #ifdef __BSD_VISIBLE
  134 int     aio_waitcomplete(struct aiocb **, struct timespec *);
  135 #endif
  136 
  137 int     aio_fsync(int op, struct aiocb *aiocbp);
  138 __END_DECLS
  139 
  140 #else
  141 
  142 /* Forward declarations for prototypes below. */
  143 struct socket;
  144 struct sockbuf;
  145 
  146 extern void (*aio_swake)(struct socket *, struct sockbuf *);
  147 
  148 #endif
  149 
  150 #endif

Cache object: b3914fd7a39fcc172a55cb46f9cb12aa


[ source navigation ] [ diff markup ] [ identifier search ] [ freetext search ] [ file search ] [ list types ] [ track identifier ]


This page is part of the FreeBSD/Linux Linux Kernel Cross-Reference, and was automatically generated using a modified version of the LXR engine.