| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 1 | /**************************************************************************** | 
|  | 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_SEM_H | 
|  | 20 | #define _UAPI_LINUX_SEM_H | 
|  | 21 | #include <linux/ipc.h> | 
|  | 22 | #define SEM_UNDO 0x1000 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 23 | #define GETPID 11 | 
|  | 24 | #define GETVAL 12 | 
|  | 25 | #define GETALL 13 | 
|  | 26 | #define GETNCNT 14 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 27 | #define GETZCNT 15 | 
|  | 28 | #define SETVAL 16 | 
|  | 29 | #define SETALL 17 | 
|  | 30 | #define SEM_STAT 18 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 31 | #define SEM_INFO 19 | 
| Christopher Ferris | 76a1d45 | 2018-06-27 14:12:29 -0700 | [diff] [blame] | 32 | #define SEM_STAT_ANY 20 | 
| Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 33 | struct __kernel_legacy_semid_ds { | 
|  | 34 | struct __kernel_legacy_ipc_perm sem_perm; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 35 | __kernel_time_t sem_otime; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 36 | __kernel_time_t sem_ctime; | 
|  | 37 | struct sem * sem_base; | 
|  | 38 | struct sem_queue * sem_pending; | 
|  | 39 | struct sem_queue * * sem_pending_last; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 40 | struct sem_undo * undo; | 
|  | 41 | unsigned short sem_nsems; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 42 | }; | 
|  | 43 | #include <asm/sembuf.h> | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 44 | struct sembuf { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 45 | unsigned short sem_num; | 
|  | 46 | short sem_op; | 
|  | 47 | short sem_flg; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 48 | }; | 
| Elliott Hughes | 497ad30 | 2017-05-18 15:05:26 -0700 | [diff] [blame] | 49 | union __kernel_legacy_semun { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 50 | int val; | 
| Elliott Hughes | 7c59f3f | 2016-08-16 18:14:26 -0700 | [diff] [blame] | 51 | struct __kernel_legacy_semid_ds __user * buf; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 52 | unsigned short __user * array; | 
|  | 53 | struct seminfo __user * __buf; | 
|  | 54 | void __user * __pad; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 55 | }; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 56 | struct seminfo { | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 57 | int semmap; | 
|  | 58 | int semmni; | 
|  | 59 | int semmns; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 60 | int semmnu; | 
|  | 61 | int semmsl; | 
|  | 62 | int semopm; | 
|  | 63 | int semume; | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 64 | int semusz; | 
|  | 65 | int semvmx; | 
|  | 66 | int semaem; | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 67 | }; | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 68 | #define SEMMNI 32000 | 
|  | 69 | #define SEMMSL 32000 | 
| Tao Bao | d7db594 | 2015-01-28 10:07:51 -0800 | [diff] [blame] | 70 | #define SEMMNS (SEMMNI * SEMMSL) | 
| Christopher Ferris | 05d08e9 | 2016-02-04 13:16:38 -0800 | [diff] [blame] | 71 | #define SEMOPM 500 | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 72 | #define SEMVMX 32767 | 
|  | 73 | #define SEMAEM SEMVMX | 
|  | 74 | #define SEMUME SEMOPM | 
|  | 75 | #define SEMMNU SEMMNS | 
| Ben Cheng | 655a7c0 | 2013-10-16 16:09:24 -0700 | [diff] [blame] | 76 | #define SEMMAP SEMMNS | 
|  | 77 | #define SEMUSZ 20 | 
|  | 78 | #endif |