shm icon indicating copy to clipboard operation
shm copied to clipboard

possible to show an example how u manage to read and write the shm.Open mem area? just a simple example will do? thx

Open kolinfluence opened this issue 2 years ago • 1 comments

possible to show an example how u manage to read and write the shm.Open mem area? just a simple example will do? thx

kolinfluence avatar Dec 01 '22 00:12 kolinfluence

Been a while since I used this library, I'm guessing you what to memory map it?

fd := file.Fd()
dataSlice, err = unix.Mmap(int(fd), 0, totalSize, unix.PROT_READ|unix.PROT_WRITE, unix.MAP_SHARED)
if err != nil {
    return errors.Wrap(err, " unix.Mmap")
}

xiegeo avatar Dec 03 '22 07:12 xiegeo