~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/uapi/linux/shm.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/uapi/linux/shm.h (Version linux-6.11.5) and /include/uapi/linux/shm.h (Version linux-4.4.302)


  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux << 
  2 #ifndef _UAPI_LINUX_SHM_H_                          1 #ifndef _UAPI_LINUX_SHM_H_
  3 #define _UAPI_LINUX_SHM_H_                          2 #define _UAPI_LINUX_SHM_H_
  4                                                     3 
  5 #include <linux/ipc.h>                              4 #include <linux/ipc.h>
  6 #include <linux/errno.h>                            5 #include <linux/errno.h>
  7 #include <asm-generic/hugetlb_encode.h>        << 
  8 #ifndef __KERNEL__                                  6 #ifndef __KERNEL__
  9 #include <unistd.h>                                 7 #include <unistd.h>
 10 #endif                                              8 #endif
 11                                                     9 
 12 /*                                                 10 /*
 13  * SHMMNI, SHMMAX and SHMALL are default upper     11  * SHMMNI, SHMMAX and SHMALL are default upper limits which can be
 14  * modified by sysctl. The SHMMAX and SHMALL v     12  * modified by sysctl. The SHMMAX and SHMALL values have been chosen to
 15  * be as large possible without facilitating s     13  * be as large possible without facilitating scenarios where userspace
 16  * causes overflows when adjusting the limits      14  * causes overflows when adjusting the limits via operations of the form
 17  * "retrieve current limit; add X; update limi     15  * "retrieve current limit; add X; update limit". It is therefore not
 18  * advised to make SHMMAX and SHMALL any large     16  * advised to make SHMMAX and SHMALL any larger. These limits are
 19  * suitable for both 32 and 64-bit systems.        17  * suitable for both 32 and 64-bit systems.
 20  */                                                18  */
 21 #define SHMMIN 1                         /* mi     19 #define SHMMIN 1                         /* min shared seg size (bytes) */
 22 #define SHMMNI 4096                      /* ma     20 #define SHMMNI 4096                      /* max num of segs system wide */
 23 #define SHMMAX (ULONG_MAX - (1UL << 24)) /* ma     21 #define SHMMAX (ULONG_MAX - (1UL << 24)) /* max shared seg size (bytes) */
 24 #define SHMALL (ULONG_MAX - (1UL << 24)) /* ma     22 #define SHMALL (ULONG_MAX - (1UL << 24)) /* max shm system wide (pages) */
 25 #define SHMSEG SHMMNI                    /* ma     23 #define SHMSEG SHMMNI                    /* max shared segs per process */
 26                                                    24 
 27 /* Obsolete, used only for backwards compatibi     25 /* Obsolete, used only for backwards compatibility and libc5 compiles */
 28 struct shmid_ds {                                  26 struct shmid_ds {
 29         struct ipc_perm         shm_perm;          27         struct ipc_perm         shm_perm;       /* operation perms */
 30         int                     shm_segsz;         28         int                     shm_segsz;      /* size of segment (bytes) */
 31         __kernel_old_time_t     shm_atime;     !!  29         __kernel_time_t         shm_atime;      /* last attach time */
 32         __kernel_old_time_t     shm_dtime;     !!  30         __kernel_time_t         shm_dtime;      /* last detach time */
 33         __kernel_old_time_t     shm_ctime;     !!  31         __kernel_time_t         shm_ctime;      /* last change time */
 34         __kernel_ipc_pid_t      shm_cpid;          32         __kernel_ipc_pid_t      shm_cpid;       /* pid of creator */
 35         __kernel_ipc_pid_t      shm_lpid;          33         __kernel_ipc_pid_t      shm_lpid;       /* pid of last operator */
 36         unsigned short          shm_nattch;        34         unsigned short          shm_nattch;     /* no. of current attaches */
 37         unsigned short          shm_unused;        35         unsigned short          shm_unused;     /* compatibility */
 38         void                    *shm_unused2;      36         void                    *shm_unused2;   /* ditto - used by DIPC */
 39         void                    *shm_unused3;      37         void                    *shm_unused3;   /* unused */
 40 };                                                 38 };
 41                                                    39 
 42 /* Include the definition of shmid64_ds and sh     40 /* Include the definition of shmid64_ds and shminfo64 */
 43 #include <asm/shmbuf.h>                            41 #include <asm/shmbuf.h>
 44                                                    42 
 45 /*                                             !!  43 /* permission flag for shmget */
 46  * shmget() shmflg values.                     << 
 47  */                                            << 
 48 /* The bottom nine bits are the same as open(2 << 
 49 #define SHM_R           0400    /* or S_IRUGO      44 #define SHM_R           0400    /* or S_IRUGO from <linux/stat.h> */
 50 #define SHM_W           0200    /* or S_IWUGO      45 #define SHM_W           0200    /* or S_IWUGO from <linux/stat.h> */
 51 /* Bits 9 & 10 are IPC_CREAT and IPC_EXCL */   << 
 52 #define SHM_HUGETLB     04000   /* segment wil << 
 53 #define SHM_NORESERVE   010000  /* don't check << 
 54                                                << 
 55 /*                                             << 
 56  * Huge page size encoding when SHM_HUGETLB is << 
 57  * size other than the default is desired.  Se << 
 58  */                                            << 
 59 #define SHM_HUGE_SHIFT  HUGETLB_FLAG_ENCODE_SH << 
 60 #define SHM_HUGE_MASK   HUGETLB_FLAG_ENCODE_MA << 
 61                                                << 
 62 #define SHM_HUGE_64KB   HUGETLB_FLAG_ENCODE_64 << 
 63 #define SHM_HUGE_512KB  HUGETLB_FLAG_ENCODE_51 << 
 64 #define SHM_HUGE_1MB    HUGETLB_FLAG_ENCODE_1M << 
 65 #define SHM_HUGE_2MB    HUGETLB_FLAG_ENCODE_2M << 
 66 #define SHM_HUGE_8MB    HUGETLB_FLAG_ENCODE_8M << 
 67 #define SHM_HUGE_16MB   HUGETLB_FLAG_ENCODE_16 << 
 68 #define SHM_HUGE_32MB   HUGETLB_FLAG_ENCODE_32 << 
 69 #define SHM_HUGE_256MB  HUGETLB_FLAG_ENCODE_25 << 
 70 #define SHM_HUGE_512MB  HUGETLB_FLAG_ENCODE_51 << 
 71 #define SHM_HUGE_1GB    HUGETLB_FLAG_ENCODE_1G << 
 72 #define SHM_HUGE_2GB    HUGETLB_FLAG_ENCODE_2G << 
 73 #define SHM_HUGE_16GB   HUGETLB_FLAG_ENCODE_16 << 
 74                                                    46 
 75 /*                                             !!  47 /* mode for attach */
 76  * shmat() shmflg values                       << 
 77  */                                            << 
 78 #define SHM_RDONLY      010000  /* read-only a     48 #define SHM_RDONLY      010000  /* read-only access */
 79 #define SHM_RND         020000  /* round attac     49 #define SHM_RND         020000  /* round attach address to SHMLBA boundary */
 80 #define SHM_REMAP       040000  /* take-over r     50 #define SHM_REMAP       040000  /* take-over region on attach */
 81 #define SHM_EXEC        0100000 /* execution a     51 #define SHM_EXEC        0100000 /* execution access */
 82                                                    52 
 83 /* super user shmctl commands */                   53 /* super user shmctl commands */
 84 #define SHM_LOCK        11                         54 #define SHM_LOCK        11
 85 #define SHM_UNLOCK      12                         55 #define SHM_UNLOCK      12
 86                                                    56 
 87 /* ipcs ctl commands */                            57 /* ipcs ctl commands */
 88 #define SHM_STAT        13                     !!  58 #define SHM_STAT        13
 89 #define SHM_INFO        14                     !!  59 #define SHM_INFO        14
 90 #define SHM_STAT_ANY    15                     << 
 91                                                    60 
 92 /* Obsolete, used only for backwards compatibi     61 /* Obsolete, used only for backwards compatibility */
 93 struct  shminfo {                                  62 struct  shminfo {
 94         int shmmax;                                63         int shmmax;
 95         int shmmin;                                64         int shmmin;
 96         int shmmni;                                65         int shmmni;
 97         int shmseg;                                66         int shmseg;
 98         int shmall;                                67         int shmall;
 99 };                                                 68 };
100                                                    69 
101 struct shm_info {                                  70 struct shm_info {
102         int used_ids;                              71         int used_ids;
103         __kernel_ulong_t shm_tot;       /* tot     72         __kernel_ulong_t shm_tot;       /* total allocated shm */
104         __kernel_ulong_t shm_rss;       /* tot     73         __kernel_ulong_t shm_rss;       /* total resident shm */
105         __kernel_ulong_t shm_swp;       /* tot     74         __kernel_ulong_t shm_swp;       /* total swapped shm */
106         __kernel_ulong_t swap_attempts;            75         __kernel_ulong_t swap_attempts;
107         __kernel_ulong_t swap_successes;           76         __kernel_ulong_t swap_successes;
108 };                                                 77 };
109                                                    78 
110                                                    79 
111 #endif /* _UAPI_LINUX_SHM_H_ */                    80 #endif /* _UAPI_LINUX_SHM_H_ */
112                                                    81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php