chenshijun
2020-06-04 e43f714b49efafd1724b32edb1b09d57ce90f416
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package shm
 
// System call constants.
const (
    //sysShmAt  = 21
    //sysShmCtl = 24
    //sysShmDt  = 22
    //sysShmGet = 23
    sysShmAt                  = 305
    sysShmDt                  = 306
    sysShmGet                 = 307
    sysShmCtl                 = 308
)
 
// Perm is used to pass permission information to IPC operations.
type Perm struct {
    // Key.
    Key int32
    // 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
    // Padding.
    Pad1 uint16
    // Sequence number.
    Seq uint16
    // Padding.
    Pad2 uint16
    // Reserved.
    GlibcReserved1 uint32
    // Reserved.
    GlibcReserved2 uint32
}
 
// IdDs describes shared memory segment.
type IdDs struct {
    // Operation permission struct.
    Perm Perm
    // Size of segment in bytes.
    SegSz uint32
    // Last attach time.
    Atime int32
    // Reserved.
    GlibcReserved1 uint32
    // Last detach time.
    Dtime int32
    // Reserved.
    GlibcReserved2 uint32
    // Last change time.
    Ctime int32
    // Reserved.
    GlibcReserved3 uint32
    // Pid of creator.
    Cpid int32
    // Pid of last shmat/shmdt.
    Lpid int32
    // Number of current attaches.
    Nattch uint32
    // Reserved.
    GlibcReserved4 uint32
    // Reserved.
    GlibcReserved5 uint32
}