diff --git a/tools/utils/shm/shm_syscall.go b/tools/utils/shm/shm_syscall.go index 3a7aa53c9..4e0eb8154 100644 --- a/tools/utils/shm/shm_syscall.go +++ b/tools/utils/shm/shm_syscall.go @@ -114,7 +114,11 @@ func (self *syscall_based_mmap) Write(b []byte) (int, error) { } func (self *syscall_based_mmap) WriteWithSize(b []byte) error { - return write_with_size(self.f, b) + szbuf := []byte{0, 0, 0, 0} + binary.BigEndian.PutUint32(szbuf, uint32(len(b))) + copy(self.Slice(), szbuf) + copy(self.Slice()[4:], b) + return nil } func (self *syscall_based_mmap) ReadWithSize() ([]byte, error) {