home *** CD-ROM | disk | FTP | other *** search
/ Otherware / Otherware_1_SB_Development.iso / amiga / os / bsdss4.tz / bsdss4 / bsdss / server / sys / shm.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  4.7 KB  |  129 lines

  1. /* 
  2.  * Mach Operating System
  3.  * Copyright (c) 1992 Carnegie Mellon University
  4.  * All Rights Reserved.
  5.  * 
  6.  * Permission to use, copy, modify and distribute this software and its
  7.  * documentation is hereby granted, provided that both the copyright
  8.  * notice and this permission notice appear in all copies of the
  9.  * software, derivative works or modified versions, and any portions
  10.  * thereof, and that both notices appear in supporting documentation.
  11.  * 
  12.  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
  13.  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
  14.  * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
  15.  * 
  16.  * Carnegie Mellon requests users of this software to return to
  17.  * 
  18.  *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
  19.  *  School of Computer Science
  20.  *  Carnegie Mellon University
  21.  *  Pittsburgh PA 15213-3890
  22.  * 
  23.  * any improvements or extensions that they make and grant Carnegie Mellon 
  24.  * the rights to redistribute these changes.
  25.  */
  26. /*
  27.  * HISTORY
  28.  * $Log:    shm.h,v $
  29.  * Revision 2.1  92/04/21  17:17:08  rwd
  30.  * BSDSS
  31.  * 
  32.  *
  33.  */
  34.  
  35. /*
  36.  * Copyright (c) 1988 University of Utah.
  37.  * Copyright (c) 1990 The Regents of the University of California.
  38.  * All rights reserved.
  39.  *
  40.  * This code is derived from software contributed to Berkeley by
  41.  * the Systems Programming Group of the University of Utah Computer
  42.  * Science Department.
  43.  *
  44.  * Redistribution and use in source and binary forms, with or without
  45.  * modification, are permitted provided that the following conditions
  46.  * are met:
  47.  * 1. Redistributions of source code must retain the above copyright
  48.  *    notice, this list of conditions and the following disclaimer.
  49.  * 2. Redistributions in binary form must reproduce the above copyright
  50.  *    notice, this list of conditions and the following disclaimer in the
  51.  *    documentation and/or other materials provided with the distribution.
  52.  * 3. All advertising materials mentioning features or use of this software
  53.  *    must display the following acknowledgement:
  54.  *    This product includes software developed by the University of
  55.  *    California, Berkeley and its contributors.
  56.  * 4. Neither the name of the University nor the names of its contributors
  57.  *    may be used to endorse or promote products derived from this software
  58.  *    without specific prior written permission.
  59.  *
  60.  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
  61.  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  62.  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  63.  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
  64.  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  65.  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  66.  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  67.  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  68.  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  69.  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  70.  * SUCH DAMAGE.
  71.  *
  72.  *    @(#)shm.h    7.2 (Berkeley) 2/5/91
  73.  */
  74.  
  75. /*
  76.  * SVID compatible shm.h file
  77.  */
  78. #ifndef _SHM_H_
  79. #define _SHM_H_
  80.  
  81. #ifdef KERNEL
  82. #include <sys/ipc.h>
  83. #else
  84. #include <sys/ipc.h>
  85. #endif
  86.  
  87. struct shmid_ds {
  88.     struct    ipc_perm shm_perm;    /* operation perms */
  89.     int    shm_segsz;        /* size of segment (bytes) */
  90.     ushort    shm_cpid;        /* pid, creator */
  91.     ushort    shm_lpid;        /* pid, last operation */
  92.     short    shm_nattch;        /* no. of current attaches */
  93.     time_t    shm_atime;        /* last attach time */
  94.     time_t    shm_dtime;        /* last detach time */
  95.     time_t    shm_ctime;        /* last change time */
  96.     void    *shm_handle;        /* internal handle for shm segment */
  97. };
  98.  
  99. /*
  100.  * System 5 style catch-all structure for shared memory constants that
  101.  * might be of interest to user programs.  Do we really want/need this?
  102.  */
  103. struct    shminfo {
  104.     int    shmmax;        /* max shared memory segment size (bytes) */
  105.     int    shmmin;        /* min shared memory segment size (bytes) */
  106.     int    shmmni;        /* max number of shared memory identifiers */
  107.     int    shmseg;        /* max shared memory segments per process */
  108.     int    shmall;        /* max amount of shared memory (pages) */
  109. };
  110.  
  111. /* internal "mode" bits */
  112. #define    SHM_ALLOC    01000    /* segment is allocated */
  113. #define    SHM_DEST    02000    /* segment will be destroyed on last detach */
  114.  
  115. /* SVID required constants (same values as system 5) */
  116. #define    SHM_RDONLY    010000    /* read-only access */
  117. #define    SHM_RND        020000    /* round attach address to SHMLBA boundary */
  118.  
  119. /* implementation constants */
  120. #define    SHMLBA        CLBYTES    /* segment low boundary address multiple */
  121. #define    SHMMMNI        512    /* maximum value for shminfo.shmmni */
  122.  
  123. #ifdef KERNEL
  124. struct    shmid_ds    *shmsegs;
  125. struct    shminfo        shminfo;
  126. #endif
  127.  
  128. #endif /* !_SHM_H_ */
  129.