-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
syscall: migrate new UDP send/recv API to internal/syscall/unix
CL 331490 and friends added new API to package syscall. This was a mistake that we need to fix before Go 1.18 is released. Change-Id: I697c9a4fa649d564822f585dc163df5ab9e5ae08 Reviewed-on: https://go-review.googlesource.com/c/go/+/361216 Trust: Josh Bleecher Snyder <[email protected]> Run-TryBot: Josh Bleecher Snyder <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
- Loading branch information
Showing
9 changed files
with
87 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build aix || darwin || dragonfly || freebsd || linux || netbsd || openbsd || solaris | ||
|
||
package unix | ||
|
||
import ( | ||
"syscall" | ||
_ "unsafe" | ||
) | ||
|
||
//go:linkname RecvfromInet4 syscall.recvfromInet4 | ||
//go:noescape | ||
func RecvfromInet4(fd int, p []byte, flags int, from *syscall.SockaddrInet4) (int, error) | ||
|
||
//go:linkname RecvfromInet6 syscall.recvfromInet6 | ||
//go:noescape | ||
func RecvfromInet6(fd int, p []byte, flags int, from *syscall.SockaddrInet6) (n int, err error) | ||
|
||
//go:linkname SendtoInet4 syscall.sendtoInet4 | ||
//go:noescape | ||
func SendtoInet4(fd int, p []byte, flags int, to syscall.SockaddrInet4) (err error) | ||
|
||
//go:linkname SendtoInet6 syscall.sendtoInet6 | ||
//go:noescape | ||
func SendtoInet6(fd int, p []byte, flags int, to syscall.SockaddrInet6) (err error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
//go:build js | ||
|
||
package unix | ||
|
||
import ( | ||
"syscall" | ||
_ "unsafe" | ||
) | ||
|
||
func RecvfromInet4(fd int, p []byte, flags int, from *syscall.SockaddrInet4) (int, error) { | ||
return 0, syscall.ENOSYS | ||
} | ||
|
||
func RecvfromInet6(fd int, p []byte, flags int, from *syscall.SockaddrInet6) (n int, err error) { | ||
return 0, syscall.ENOSYS | ||
} | ||
|
||
func SendtoInet4(fd int, p []byte, flags int, to syscall.SockaddrInet4) (err error) { | ||
return syscall.ENOSYS | ||
} | ||
|
||
func SendtoInet6(fd int, p []byte, flags int, to syscall.SockaddrInet6) (err error) { | ||
return syscall.ENOSYS | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// Copyright 2021 The Go Authors. All rights reserved. | ||
// Use of this source code is governed by a BSD-style | ||
// license that can be found in the LICENSE file. | ||
|
||
package windows | ||
|
||
import ( | ||
"syscall" | ||
_ "unsafe" | ||
) | ||
|
||
//go:linkname WSASendtoInet4 syscall.wsaSendtoInet4 | ||
//go:noescape | ||
func WSASendtoInet4(s syscall.Handle, bufs *syscall.WSABuf, bufcnt uint32, sent *uint32, flags uint32, to syscall.SockaddrInet4, overlapped *syscall.Overlapped, croutine *byte) (err error) | ||
|
||
//go:linkname WSASendtoInet6 syscall.wsaSendtoInet6 | ||
//go:noescape | ||
func WSASendtoInet6(s syscall.Handle, bufs *syscall.WSABuf, bufcnt uint32, sent *uint32, flags uint32, to syscall.SockaddrInet6, overlapped *syscall.Overlapped, croutine *byte) (err error) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters