-
Notifications
You must be signed in to change notification settings - Fork 18.8k
Open
Description
This is a proposal to add RawAccept4 function to x/sys/unix for Linux. The implementation may look like this:
func RawAccept4(fd int, rsa *RawSockaddrAny, addrlen *uint32, flags int) (int, error) {
return accept4(fd, rsa, (*_Socklen)(addrlen), flags)
}Background
I did a small change to (*SockaddrALG).sockaddr (CL 527836) and wasn't quite sure it doesn't break anything. So I wrote a test case for AF_ALG functionality (CL 527837) to make sure it's still working, but found out that it's not possible to use unix.Accept with AF_ALG socket, as it sets the second and the third accept4 syscall arguments to non-nil values, and with AF_ALG those needs to be set to nil.
Alternatives
- Use
unix.SYSCALL(unix.ACCEPT4, .... - Add
AcceptWithoutAddr(https://go-review.googlesource.com/c/sys/+/527837/comment/4d5963aa_e794dbd3/). The implementation can look like this:
func AcceptWithoutAddr(fd int) (int, error) {
return accept4(fd, 0, 0, 0)
}Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Incoming