Skip to content

Commit acfd1f3

Browse files
authored
Merge pull request #8 from leavelet/master
Add support for linux/loong64
2 parents 6a6ec14 + b2349a7 commit acfd1f3

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

shm_linux_loong64.go

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
package shm
2+
3+
import (
4+
"syscall"
5+
)
6+
7+
// System call constants.
8+
const (
9+
sysShmAt = syscall.SYS_SHMAT
10+
sysShmCtl = syscall.SYS_SHMCTL
11+
sysShmDt = syscall.SYS_SHMDT
12+
sysShmGet = syscall.SYS_SHMGET
13+
)
14+
15+
// Perm is used to pass permission information to IPC operations.
16+
type Perm struct {
17+
// Key.
18+
Key int32
19+
// Owner's user ID.
20+
Uid uint32
21+
// Owner's group ID.
22+
Gid uint32
23+
// Creator's user ID.
24+
Cuid uint32
25+
// Creator's group ID.
26+
Cgid uint32
27+
// Read/write permission.
28+
Mode uint32
29+
// Sequence number.
30+
Seq uint16
31+
// Padding.
32+
Pad1 uint16
33+
// Reserved.
34+
GlibcReserved1 uint64
35+
// Reserved.
36+
GlibcReserved2 uint64
37+
}
38+
39+
// IdDs describes shared memory segment.
40+
type IdDs struct {
41+
// Operation permission struct.
42+
Perm Perm
43+
// Size of segment in bytes.
44+
SegSz uint64
45+
// Last attach time.
46+
Atime int64
47+
// Last detach time.
48+
Dtime int64
49+
// Last change time.
50+
Ctime int64
51+
// Pid of creator.
52+
Cpid int32
53+
// Pid of last shmat/shmdt.
54+
Lpid int32
55+
// Number of current attaches.
56+
Nattch uint64
57+
// Reserved.
58+
GlibcReserved5 uint64
59+
// Reserved.
60+
GlibcReserved6 uint64
61+
}

0 commit comments

Comments
 (0)