Skip to content

unix: Implement RecvmsgAnon to not return Sockaddr #254

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
11 changes: 11 additions & 0 deletions unix/syscall_unix.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,17 @@ func Recvmsg(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, from
return
}

// RecvmsgAnon is like Recvmsg but does not return the sender address.
func RecvmsgAnon(fd int, p, oob []byte, flags int) (n, oobn int, recvflags int, err error) {
var iov [1]Iovec
if len(p) > 0 {
iov[0].Base = &p[0]
iov[0].SetLen(len(p))
}
n, oobn, recvflags, err = recvmsgRaw(fd, iov[:], oob, flags, nil)
return
}

// RecvmsgBuffers receives a message from a socket using the recvmsg system
// call. This function is equivalent to Recvmsg, but non-control data read is
// scattered into the buffers slices.
Expand Down