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