linux/include/uapi/linux/shm.h

/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_SHM_H_
#define _UAPI_LINUX_SHM_H_

#include <linux/ipc.h>
#include <linux/errno.h>
#include <asm-generic/hugetlb_encode.h>
#ifndef __KERNEL__
#include <unistd.h>
#endif

/*
 * SHMMNI, SHMMAX and SHMALL are default upper limits which can be
 * modified by sysctl. The SHMMAX and SHMALL values have been chosen to
 * be as large possible without facilitating scenarios where userspace
 * causes overflows when adjusting the limits via operations of the form
 * "retrieve current limit; add X; update limit". It is therefore not
 * advised to make SHMMAX and SHMALL any larger. These limits are
 * suitable for both 32 and 64-bit systems.
 */
#define SHMMIN
#define SHMMNI
#define SHMMAX
#define SHMALL
#define SHMSEG

/* Obsolete, used only for backwards compatibility and libc5 compiles */
struct shmid_ds {};

/* Include the definition of shmid64_ds and shminfo64 */
#include <asm/shmbuf.h>

/*
 * shmget() shmflg values.
 */
/* The bottom nine bits are the same as open(2) mode flags */
#define SHM_R
#define SHM_W
/* Bits 9 & 10 are IPC_CREAT and IPC_EXCL */
#define SHM_HUGETLB
#define SHM_NORESERVE

/*
 * Huge page size encoding when SHM_HUGETLB is specified, and a huge page
 * size other than the default is desired.  See hugetlb_encode.h
 */
#define SHM_HUGE_SHIFT
#define SHM_HUGE_MASK

#define SHM_HUGE_64KB
#define SHM_HUGE_512KB
#define SHM_HUGE_1MB
#define SHM_HUGE_2MB
#define SHM_HUGE_8MB
#define SHM_HUGE_16MB
#define SHM_HUGE_32MB
#define SHM_HUGE_256MB
#define SHM_HUGE_512MB
#define SHM_HUGE_1GB
#define SHM_HUGE_2GB
#define SHM_HUGE_16GB

/*
 * shmat() shmflg values
 */
#define SHM_RDONLY
#define SHM_RND
#define SHM_REMAP
#define SHM_EXEC

/* super user shmctl commands */
#define SHM_LOCK
#define SHM_UNLOCK

/* ipcs ctl commands */
#define SHM_STAT
#define SHM_INFO
#define SHM_STAT_ANY

/* Obsolete, used only for backwards compatibility */
struct	shminfo {};

struct shm_info {};


#endif /* _UAPI_LINUX_SHM_H_ */