home *** CD-ROM | disk | FTP | other *** search
/ Piper's Pit BBS/FTP: ibm 0010 - 0019 / ibm0010-0019 / ibm0010.tar / ibm0010 / UNIX3862.ZIP / U386-06.ZIP / U386-6.TD0 / usr / include / sys / swap.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.5 KB  |  82 lines

  1. /*    Copyright (c) 1984, 1986, 1987, 1988 AT&T    */
  2. /*      All Rights Reserved      */
  3.  
  4. /*    THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T    */
  5. /*    The copyright notice above does not evidence any       */
  6. /*    actual or intended publication of such source code.    */
  7.  
  8.  
  9. #ident    "@(#)head.sys:swap.h    1.3"
  10.  
  11. /*    The following structure contains the data describing a
  12.  *    swap file.
  13.  */
  14.  
  15. typedef struct swaptab {
  16.     dev_t    st_dev;        /* The swap device.        */
  17.     short    st_flags;    /* Flags defined below.        */
  18.     use_t    *st_ucnt;    /* Ptr to use count array for    */
  19.                 /* pages on swap.        */
  20.     use_t    *st_next;    /* Ptr to next page to start    */
  21.                 /* searching at.        */
  22.     int    st_swplo;    /* First block number on device    */
  23.                 /* to be used for swapping.    */
  24.     int    st_npgs;    /* Number of pages of swap    */
  25.                 /* space on device.        */
  26.     int    st_nfpgs;    /* Nbr of free pages on device.    */
  27.     int    st_pad[2];    /* Round size to 2^n.        */
  28. } swpt_t;
  29.  
  30. #define    ST_INDEL    0x01    /* This file is in the process     */
  31.                 /* of being deleted.  Don't    */
  32.                 /* allocate from it.        */
  33.  
  34.  
  35. extern swpt_t    swaptab[];    /* The table of swap files.    */
  36. extern int    nextswap;;    /* Index into swptab to the    */
  37.                 /* next file to  allocate from.    */
  38. extern int    swapwant;    /* Set non-zero if someone is    */
  39.                 /* waiting for swap space.    */
  40.  
  41. #define    MSFILES    16        /* The maximum number of swap    */
  42.                 /* files which can be allocated.*/
  43.                 /* It is limited by the size of    */
  44.                 /* the dbd_swpi field in the    */
  45.                 /* dbd_t structure.        */
  46.  
  47.  
  48. /*    The following struct is used by the sys3b system call.
  49.  *    If the first argument to the sys3b system call is 3,
  50.  *    then the call pertains to the swap file.  In this case,
  51.  *    the second argument is a pointer to a structure of the
  52.  *    following format which contains the parameters for the
  53.  *    operation to be performed.
  54.  */
  55.  
  56. typedef struct swapint {
  57.     char    si_cmd;        /* One of the command codes    */
  58.                 /* listed below.        */
  59.     char    *si_buf;    /* For an SI_LIST function, this*/
  60.                 /* is a pointer to a buffer of    */
  61.                 /* sizeof(swpt_t)*MSFILES bytes.*/
  62.                 /* For the other cases, it is a    */
  63.                 /* pointer to a pathname of a    */
  64.                 /* swap file.            */
  65.     int    si_swplo;    /* The first block number of the*/
  66.                 /* swap file.  Used only for    */
  67.                 /* SI_ADD and SI_DEL.        */
  68.     int    si_nblks;    /* The size of the swap file in    */
  69.                 /* blocks.  Used only for an    */
  70.                 /* SI_ADD request.        */
  71. } swpi_t;
  72.  
  73. /*    The following are the possible values for si_cmd.
  74.  */
  75.  
  76. #define    SI_LIST        0    /* List the currently active    */
  77.                 /* swap files.            */
  78. #define    SI_ADD        1    /* Add a new swap file.        */
  79. #define    SI_DEL        2    /* Delete one of the currently    */
  80.                 /* active swap files.        */
  81.  
  82.