blob: ab319f28d1ff26156fca64dff81306063208a5ed [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _UAPI_LINUX_SHM_H_
20#define _UAPI_LINUX_SHM_H_
21#include <linux/ipc.h>
22#include <linux/errno.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023#include <unistd.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070024#define SHMMIN 1
25#define SHMMNI 4096
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070026#define SHMMAX (ULONG_MAX - (1UL << 24))
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070027#define SHMALL (ULONG_MAX - (1UL << 24))
Ben Cheng655a7c02013-10-16 16:09:24 -070028#define SHMSEG SHMMNI
Elliott Hughes7c59f3f2016-08-16 18:14:26 -070029struct __kernel_legacy_shmid_ds {
30 struct __kernel_legacy_ipc_perm shm_perm;
Tao Baod7db5942015-01-28 10:07:51 -080031 int shm_segsz;
32 __kernel_time_t shm_atime;
33 __kernel_time_t shm_dtime;
34 __kernel_time_t shm_ctime;
Tao Baod7db5942015-01-28 10:07:51 -080035 __kernel_ipc_pid_t shm_cpid;
36 __kernel_ipc_pid_t shm_lpid;
37 unsigned short shm_nattch;
38 unsigned short shm_unused;
Tao Baod7db5942015-01-28 10:07:51 -080039 void * shm_unused2;
40 void * shm_unused3;
Ben Cheng655a7c02013-10-16 16:09:24 -070041};
42#include <asm/shmbuf.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070043#define SHM_R 0400
44#define SHM_W 0200
45#define SHM_RDONLY 010000
46#define SHM_RND 020000
Ben Cheng655a7c02013-10-16 16:09:24 -070047#define SHM_REMAP 040000
48#define SHM_EXEC 0100000
49#define SHM_LOCK 11
50#define SHM_UNLOCK 12
Ben Cheng655a7c02013-10-16 16:09:24 -070051#define SHM_STAT 13
52#define SHM_INFO 14
53struct shminfo {
Tao Baod7db5942015-01-28 10:07:51 -080054 int shmmax;
Tao Baod7db5942015-01-28 10:07:51 -080055 int shmmin;
56 int shmmni;
57 int shmseg;
58 int shmall;
Ben Cheng655a7c02013-10-16 16:09:24 -070059};
60struct shm_info {
Tao Baod7db5942015-01-28 10:07:51 -080061 int used_ids;
62 __kernel_ulong_t shm_tot;
Tao Baod7db5942015-01-28 10:07:51 -080063 __kernel_ulong_t shm_rss;
64 __kernel_ulong_t shm_swp;
65 __kernel_ulong_t swap_attempts;
66 __kernel_ulong_t swap_successes;
Ben Cheng655a7c02013-10-16 16:09:24 -070067};
68#endif