Skip to content

Commit

Permalink
clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
peano88 committed Dec 18, 2020
1 parent ae01620 commit 3523b28
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions msgsnd.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,39 +18,6 @@ func Msgsnd(qid uint, msg *Msgbuf, flags uint) error {
return MsgsndPrepared(qid, len(msg.Mtext), buffer, flags)
}


// if len(msg.Mtext) > msgmax {
// return fmt.Errorf("mtext is too large, %d > %d", len(msg.Mtext), msgmax)
// }

// buf := make([]byte, uintSize+msgmax)
// buffer := bytes.NewBuffer(buf)
// buffer.Reset()
// var err error
// switch uintSize {
// case 4:
// err = binary.Write(buffer, binary.LittleEndian, uint32(msg.Mtype))
// case 8:
// err = binary.Write(buffer, binary.LittleEndian, uint64(msg.Mtype))
// }
// if err != nil {
// return fmt.Errorf("Can't write binary: %v", err)
// }
// buffer.Write(msg.Mtext)
// _, _, errno := syscall.Syscall6(syscall.SYS_MSGSND,
// uintptr(qid),
// uintptr(unsafe.Pointer(&buf[0])),
// uintptr(len(msg.Mtext)),
// uintptr(flags),
// 0,
// 0,
// )
// if errno != 0 {
// return errno
// }
// return nil
// }

// PrepareMsg creates a buffer containing the message to send
func PrepareMsg(msg *Msgbuf) (*bytes.Buffer, error) {
if len(msg.Mtext) > msgmax {
Expand Down

0 comments on commit 3523b28

Please sign in to comment.