aboutsummaryrefslogtreecommitdiffstats
path: root/vendor/golang.org/x/sys/windows/zsyscall_windows.go
diff options
context:
space:
mode:
authortechknowlogick <techknowlogick@gitea.io>2020-02-20 16:03:34 -0500
committerGitHub <noreply@github.com>2020-02-20 16:03:34 -0500
commit63a6e71ac294d3adaf6086b86efc9953b4a9721f (patch)
treefe08e3a1d321c624b7c257c569de60e6054c9f3a /vendor/golang.org/x/sys/windows/zsyscall_windows.go
parent3c45cf8494fcd29e1a99b0ee6f253808eb607053 (diff)
downloadgitea-63a6e71ac294d3adaf6086b86efc9953b4a9721f.tar.gz
gitea-63a6e71ac294d3adaf6086b86efc9953b4a9721f.zip
update crypto vendors (#10385)
Diffstat (limited to 'vendor/golang.org/x/sys/windows/zsyscall_windows.go')
-rw-r--r--vendor/golang.org/x/sys/windows/zsyscall_windows.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/vendor/golang.org/x/sys/windows/zsyscall_windows.go b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
index 7bed68b2d1..2aa4fa642a 100644
--- a/vendor/golang.org/x/sys/windows/zsyscall_windows.go
+++ b/vendor/golang.org/x/sys/windows/zsyscall_windows.go
@@ -257,6 +257,8 @@ var (
procWSACleanup = modws2_32.NewProc("WSACleanup")
procWSAIoctl = modws2_32.NewProc("WSAIoctl")
procsocket = modws2_32.NewProc("socket")
+ procsendto = modws2_32.NewProc("sendto")
+ procrecvfrom = modws2_32.NewProc("recvfrom")
procsetsockopt = modws2_32.NewProc("setsockopt")
procgetsockopt = modws2_32.NewProc("getsockopt")
procbind = modws2_32.NewProc("bind")
@@ -2873,6 +2875,39 @@ func socket(af int32, typ int32, protocol int32) (handle Handle, err error) {
return
}
+func sendto(s Handle, buf []byte, flags int32, to unsafe.Pointer, tolen int32) (err error) {
+ var _p0 *byte
+ if len(buf) > 0 {
+ _p0 = &buf[0]
+ }
+ r1, _, e1 := syscall.Syscall6(procsendto.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(to), uintptr(tolen))
+ if r1 == socket_error {
+ if e1 != 0 {
+ err = errnoErr(e1)
+ } else {
+ err = syscall.EINVAL
+ }
+ }
+ return
+}
+
+func recvfrom(s Handle, buf []byte, flags int32, from *RawSockaddrAny, fromlen *int32) (n int32, err error) {
+ var _p0 *byte
+ if len(buf) > 0 {
+ _p0 = &buf[0]
+ }
+ r0, _, e1 := syscall.Syscall6(procrecvfrom.Addr(), 6, uintptr(s), uintptr(unsafe.Pointer(_p0)), uintptr(len(buf)), uintptr(flags), uintptr(unsafe.Pointer(from)), uintptr(unsafe.Pointer(fromlen)))
+ n = int32(r0)
+ if n == -1 {
+ if e1 != 0 {
+ err = errnoErr(e1)
+ } else {
+ err = syscall.EINVAL
+ }
+ }
+ return
+}
+
func Setsockopt(s Handle, level int32, optname int32, optval *byte, optlen int32) (err error) {
r1, _, e1 := syscall.Syscall6(procsetsockopt.Addr(), 5, uintptr(s), uintptr(level), uintptr(optname), uintptr(unsafe.Pointer(optval)), uintptr(optlen), 0)
if r1 == socket_error {