home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 15 / 15.iso / s / s053 / 8.ddi / usr / include / sys / asyncsys.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-12-08  |  3.3 KB  |  80 lines

  1. /*    Copyright (c) 1990 UNIX System Laboratories, Inc.    */
  2. /*    Copyright (c) 1984, 1986, 1987, 1988, 1989, 1990 AT&T    */
  3. /*      All Rights Reserved      */
  4.  
  5. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF         */
  6. /*    UNIX System Laboratories, Inc.                         */
  7. /*    The copyright notice above does not evidence any       */
  8. /*    actual or intended publication of such source code.    */
  9.  
  10. #ifndef _SYS_ASYNCSYS_H
  11. #define _SYS_ASYNCSYS_H
  12.  
  13. #ident    "@(#)/usr/include/sys/asyncsys.h.sl 1.1 4.0 12/08/90 44715 AT&T-USL"
  14.  
  15. /*
  16. **    Structure used by library routines, aread.c, awrite.c,
  17. **    and asyncio.c to pass async request parameters 
  18. **    to syscall async().
  19. */
  20.  
  21. typedef    struct asyncop {
  22.     int        a_syscall;    /* syscall to be done asynchronously       */
  23.     int        a_sysarg[MAXSYSARGS];    /* syscall arguments             */
  24.     ushort        a_flags;    /* the flags defined below           */
  25.     int        a_error;    /* error code; the field is used to save  */
  26.                     /* error encountered in processing the    */
  27.                     /* async() system call. It is not for     */
  28.                     /* any error found in the actual system   */
  29.                     /* call run asynchronously because the    */
  30.                     /* aioop struct may be reused after       */
  31.                     /* returning from async() call.          */
  32.     off_t        a_offset;    /* relative offset in bytes               */
  33.     pcparms_t    a_pri;        /* syscall priority               */
  34.     ecb_t        a_ecb;        /* ecb for event notification            */
  35. } asyncop_t;
  36.  
  37. #ifdef _KERNEL
  38. /*
  39. **    Structure used to pass asynchronous system call
  40. **    request from user process to server
  41. **
  42. **    Note, ar_fflink and ar_fblink must be the first two fields in this
  43. **    structure or the list manipulation routines will break.
  44. */
  45.  
  46. typedef struct aioreq {
  47.     struct    aioreq    *ar_fflink;    /* file async request forward link       */
  48.     struct    aioreq    *ar_fblink;    /* file async request backward link      */
  49.     struct    aioreq    *ar_sflink;    /* aioserver request forward link       */
  50.     struct    aioreq    *ar_sblink;    /* aioserver request backward link      */
  51.     proc_t         *ar_procp;    /* proc requests the async sys call       */
  52.     struct    sysent    *ar_syscallp;    /* sys call to do asynchronously       */
  53.     int        ar_args[MAXSYSARGS];/* args to async sys call               */
  54.     daddr_t        ar_ulimit;    /* client's ulimit               */
  55.     file_t        *ar_ofilep;    /* original file table entry           */
  56.     file_t        ar_aiofile;    /* file table entry server will use       */
  57.     pcparms_t    ar_pri;        /* system call priority           */
  58.     ecb_t        ar_ecb;        /* ecb specified by the user          */
  59.     evkev_t        *ar_evkevp;    /* ptr to kernel allocated evkev struct,  */
  60.                     /* null if no event to be posted       */
  61.     proc_t        *ar_serverp;    /* procp of server acting on this       */
  62.                     /* request. Null if on request queue       */
  63. } aioreq_t;
  64.  
  65. extern    short     naioproc;        /* # of async requests allowed per  */
  66.                     /* process                */
  67. extern    int     min_aio_servers;    /* min # of aio servers to make at  */
  68. extern  int     max_aio_servers;    /* max # of servers allowed         */
  69. extern    int     aio_server_timeout;    /* # of seconds server should wait  */
  70. extern    int     aio_size;        /* # of aio request structs in pool */
  71. extern    aioreq_t aio[];            /* pool of aio request structs      */
  72. extern    proc_t     *aiodaemonp;        /* aiodaemon's process table pointer*/
  73.  
  74. extern    void     aiodaemon();        /* aiodaemon entry point        */
  75. extern    void     stop_aio();        /* stop outstanding async call         */
  76. extern    void     aioinit();        /* initialize aio linked lists        */    
  77. #endif
  78.  
  79. #endif    /* _SYS_ASYNCSYS_H */
  80.