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 / shm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1988-06-26  |  2.0 KB  |  83 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:shm.h    1.3"
  10.  
  11. /*
  12. **    IPC Shared Memory Facility.
  13. */
  14.  
  15. /*
  16. **    Implementation Constants.
  17. */
  18.  
  19.  
  20. #define    SHMLBA    ctob(stoc(1))    /* segment low boundary address multiple */
  21.             /* (SHMLBA must be a power of 2) */
  22.  
  23. /*
  24. **    Permission Definitions.
  25. */
  26.  
  27. #define    SHM_R    0400    /* read permission */
  28. #define    SHM_W    0200    /* write permission */
  29.  
  30. /*
  31. **    ipc_perm Mode Definitions.
  32. */
  33.  
  34. #define    SHM_INIT    01000    /* grow segment on next attach */
  35. #define    SHM_DEST    02000    /* destroy segment when # attached = 0 */
  36.  
  37. /*
  38. **    Message Operation Flags.
  39. */
  40.  
  41. #define    SHM_RDONLY    010000    /* attach read-only (else read-write) */
  42. #define    SHM_RND        020000    /* round attach address to SHMLBA */
  43.  
  44. /*
  45. **    Structure Definitions.
  46. */
  47.  
  48. /*
  49. **    There is a shared mem id data structure for each segment in the system.
  50. */
  51.  
  52. struct shmid_ds {
  53.     struct ipc_perm    shm_perm;    /* operation permission struct */
  54.     int        shm_segsz;    /* size of segment in bytes */
  55.     struct region    *shm_reg;    /* ptr to region structure */
  56.     char        pad[4];        /* for swap compatibility */
  57.     ushort        shm_lpid;    /* pid of last shmop */
  58.     ushort        shm_cpid;    /* pid of creator */
  59.     ushort        shm_nattch;    /* used only for shminfo */
  60.     ushort        shm_cnattch;    /* used only for shminfo */
  61.     time_t        shm_atime;    /* last shmat time */
  62.     time_t        shm_dtime;    /* last shmdt time */
  63.     time_t        shm_ctime;    /* last change time */
  64. };
  65.  
  66. struct    shminfo {
  67.     int    shmmax,        /* max shared memory segment size */
  68.         shmmin,        /* min shared memory segment size */
  69.         shmmni,        /* # of shared memory identifiers */
  70.         shmseg,        /* max attached shared memory      */
  71.                 /* segments per process          */
  72.         shmall;        /* max total shared memory system */
  73.                 /* wide (in clicks)          */
  74. };
  75.  
  76.  
  77. /*
  78.  * Shared memory control operations
  79.  */
  80.  
  81. #define SHM_LOCK    3    /* Lock segment in core */
  82. #define SHM_UNLOCK    4    /* Unlock segment */
  83.