Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


shm.h
001: /* Copyright (C) 1995, 1996, 1997, 2000, 2002, 2004, 2009
002:    Free Software Foundation, Inc.
003:    This file is part of the GNU C Library.
004: 
005:    The GNU C Library is free software; you can redistribute it and/or
006:    modify it under the terms of the GNU Lesser General Public
007:    License as published by the Free Software Foundation; either
008:    version 2.1 of the License, or (at your option) any later version.
009: 
010:    The GNU C Library is distributed in the hope that it will be useful,
011:    but WITHOUT ANY WARRANTY; without even the implied warranty of
012:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:    Lesser General Public License for more details.
014: 
015:    You should have received a copy of the GNU Lesser General Public
016:    License along with the GNU C Library; if not, write to the Free
017:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
018:    02111-1307 USA.  */
019: 
020: #ifndef _SYS_SHM_H
021: # error "Never include <bits/shm.h> directly; use <sys/shm.h> instead."
022: #endif
023: 
024: #include <bits/types.h>
025: 
026: /* Permission flag for shmget.  */
027: #define SHM_R           0400            /* or S_IRUGO from <linux/stat.h> */
028: #define SHM_W           0200            /* or S_IWUGO from <linux/stat.h> */
029: 
030: /* Flags for `shmat'.  */
031: #define SHM_RDONLY      010000          /* attach read-only else read-write */
032: #define SHM_RND         020000          /* round attach address to SHMLBA */
033: #define SHM_REMAP       040000          /* take-over region on attach */
034: #define SHM_EXEC        0100000         /* execution access */
035: 
036: /* Commands for `shmctl'.  */
037: #define SHM_LOCK        11              /* lock segment (root only) */
038: #define SHM_UNLOCK      12              /* unlock segment (root only) */
039: 
040: __BEGIN_DECLS
041: 
042: /* Segment low boundary address multiple.  */
043: #define SHMLBA          (__getpagesize ())
044: extern int __getpagesize (void) __THROW __attribute__ ((__const__));
045: 
046: 
047: /* Type to count number of attaches.  */
048: typedef unsigned long int shmatt_t;
049: 
050: /* Data structure describing a shared memory segment.  */
051: struct shmid_ds
052:   {
053:     struct ipc_perm shm_perm;           /* operation permission struct */
054:     size_t shm_segsz;                   /* size of segment in bytes */
055:     __time_t shm_atime;                 /* time of last shmat() */
056: #if __WORDSIZE == 32
057:     unsigned long int __unused1;
058: #endif
059:     __time_t shm_dtime;                 /* time of last shmdt() */
060: #if __WORDSIZE == 32
061:     unsigned long int __unused2;
062: #endif
063:     __time_t shm_ctime;                 /* time of last change by shmctl() */
064: #if __WORDSIZE == 32
065:     unsigned long int __unused3;
066: #endif
067:     __pid_t shm_cpid;                   /* pid of creator */
068:     __pid_t shm_lpid;                   /* pid of last shmop */
069:     shmatt_t shm_nattch;                /* number of current attaches */
070:     unsigned long int __unused4;
071:     unsigned long int __unused5;
072:   };
073: 
074: #ifdef __USE_MISC
075: 
076: /* ipcs ctl commands */
077: # define SHM_STAT       13
078: # define SHM_INFO       14
079: 
080: /* shm_mode upper byte flags */
081: # define SHM_DEST       01000   /* segment will be destroyed on last detach */
082: # define SHM_LOCKED     02000   /* segment will not be swapped */
083: # define SHM_HUGETLB    04000   /* segment is mapped via hugetlb */
084: # define SHM_NORESERVE  010000  /* don't check for reservations */
085: 
086: struct  shminfo
087:   {
088:     unsigned long int shmmax;
089:     unsigned long int shmmin;
090:     unsigned long int shmmni;
091:     unsigned long int shmseg;
092:     unsigned long int shmall;
093:     unsigned long int __unused1;
094:     unsigned long int __unused2;
095:     unsigned long int __unused3;
096:     unsigned long int __unused4;
097:   };
098: 
099: struct shm_info
100:   {
101:     int used_ids;
102:     unsigned long int shm_tot;  /* total allocated shm */
103:     unsigned long int shm_rss;  /* total resident shm */
104:     unsigned long int shm_swp;  /* total swapped shm */
105:     unsigned long int swap_attempts;
106:     unsigned long int swap_successes;
107:   };
108: 
109: #endif /* __USE_MISC */
110: 
111: __END_DECLS
112: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/