go-sysvipc icon indicating copy to clipboard operation
go-sysvipc copied to clipboard

Make flexibility about ipc_perm.mode's type by each OS

Open heat1024 opened this issue 2 years ago • 0 comments

This PR fix some mode type to C.__mode_t from C.ushort.

Because some OS version got diffrente type of ipc_perm.mode.

for example, I got error like this on previous master version

/go/pkg/mod/github.com/teepark/[email protected]/msg.go:101:4: cannot use _Ctype_ushort(mqi.Perms.Mode & 511) (type _Ctype_ushort) as type _Ctype_uint in field value
/go/pkg/mod/github.com/teepark/[email protected]/sem.go:186:4: cannot use _Ctype_ushort(ssi.Perms.Mode & 511) (type _Ctype_ushort) as type _Ctype_uint in field value
/go/pkg/mod/github.com/teepark/[email protected]/shm.go:85:4: cannot use _Ctype_ushort(info.Perms.Mode & 511) (type _Ctype_ushort) as type _Ctype_uint in field value

The error occurs because, the OS of golang:latest container's ipc_perm.mode is uint but current code is specified by ushort.

So, for OS type-specific flexibility, I think it shoud use the __mode_t type.

heat1024 avatar Sep 13 '22 04:09 heat1024