| 1 | // Copyright 2018 The gVisor Authors. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package linux |
| 16 | |
| 17 | // Control commands used with semctl, shmctl, and msgctl. |
| 18 | // |
| 19 | // Source: include/uapi/linux/ipc.h. |
| 20 | const ( |
| 21 | IPC_RMID = 0 |
| 22 | IPC_SET = 1 |
| 23 | IPC_STAT = 2 |
| 24 | IPC_INFO = 3 |
| 25 | ) |
| 26 | |
| 27 | // Resource get request flags. |
| 28 | // |
| 29 | // Source: include/uapi/linux/ipc.h |
| 30 | const ( |
| 31 | IPC_CREAT = 00001000 |
| 32 | IPC_EXCL = 00002000 |
| 33 | IPC_NOWAIT = 00004000 |
| 34 | ) |
| 35 | |
| 36 | // IPC flags. |
| 37 | const ( |
| 38 | IPC_PRIVATE = 0 |
| 39 | ) |
| 40 | |
| 41 | // In Linux, amd64 does not enable CONFIG_ARCH_WANT_IPC_PARSE_VERSION, so SysV |
| 42 | // IPC unconditionally uses the "new" 64-bit structures that are needed for |
| 43 | // features like 32-bit UIDs. |
| 44 | |
| 45 | // IPCPerm is equivalent to struct ipc64_perm. |
| 46 | // |
| 47 | // +marshal |
| 48 | type IPCPerm struct { |
| 49 | Key uint32 |
| 50 | UID uint32 |
| 51 | GID uint32 |
| 52 | CUID uint32 |
| 53 | CGID uint32 |
| 54 | Mode uint16 |
| 55 | _ uint16 |
| 56 | Seq uint16 |
| 57 | _ uint16 |
| 58 | _ uint32 |
| 59 | unused1 uint64 |
| 60 | unused2 uint64 |
| 61 | } |