Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for linux/loong64 #8

Merged
merged 1 commit into from
Sep 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions shm_linux_loong64.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
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 {
// 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 uint32
// Sequence number.
Seq uint16
// Padding.
Pad1 uint16
// Reserved.
GlibcReserved1 uint64
// Reserved.
GlibcReserved2 uint64
}

// IdDs describes shared memory segment.
type IdDs struct {
// Operation permission struct.
Perm Perm
// Size of segment in bytes.
SegSz uint64
// Last attach time.
Atime int64
// Last detach time.
Dtime int64
// Last change time.
Ctime int64
// Pid of creator.
Cpid int32
// Pid of last shmat/shmdt.
Lpid int32
// Number of current attaches.
Nattch uint64
// Reserved.
GlibcReserved5 uint64
// Reserved.
GlibcReserved6 uint64
}
Loading