-
Notifications
You must be signed in to change notification settings - Fork 19
/
shm_darwin.go
55 lines (51 loc) · 940 Bytes
/
shm_darwin.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
package shm
import (
"syscall"
)
// System call constants.
const (
sysShmAt = syscall.SYS_SHMAT
sysShmCtl = syscall.SYS_SHMCTL
sysShmDt = syscall.SYS_SHMDT
sysShmGet = syscall.SYS_SHMGET
)
// Perm is used to pass permission information to IPC operations.
type Perm struct {
// Owner's user ID.
Uid uint32
// Owner's group ID.
Gid uint32
// Creator's user ID.
Cuid uint32
// Creator's group ID.
Cgid uint32
// Read/write permission.
Mode uint16
// Sequence number.
Seq uint16
// Key.
Key int32
}
// IdDs describes shared memory segment.
type IdDs struct {
// Operation permission struct.
Perm Perm
// Size of segment in bytes.
SegSz uint64
// Pid of last shmat/shmdt.
Lpid int32
// Pid of creator.
Cpid int32
// Number of current attaches.
Nattch uint16
// Padding.
PadCgo0 [2]byte
// Padding.
PadCgo1 [8]byte
// Padding.
PadCgo2 [8]byte
// Padding.
PadCgo3 [8]byte
// Padding.
PadCgo4 [8]byte
}