mirror of
https://github.com/KusakabeShi/EtherGuard-VPN.git
synced 2025-08-13 17:54:36 +02:00
Use socketcall on x86
This commit is contained in:
30
syscall_linux.go
Normal file
30
syscall_linux.go
Normal file
@ -0,0 +1,30 @@
|
||||
// +build linux,!386
|
||||
|
||||
/* Copyright 2018 Jason A. Donenfeld <Jason@zx2c4.com>. All Rights Reserved.
|
||||
*/
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"golang.org/x/sys/unix"
|
||||
"syscall"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
func sendmsg(fd int, msghdr *unix.Msghdr, flags int) (uintptr, uintptr, syscall.Errno) {
|
||||
return unix.Syscall(
|
||||
unix.SYS_SENDMSG,
|
||||
uintptr(fd),
|
||||
uintptr(unsafe.Pointer(msghdr)),
|
||||
uintptr(flags),
|
||||
)
|
||||
}
|
||||
|
||||
func recvmsg(fd int, msghdr *unix.Msghdr, flags int) (uintptr, uintptr, syscall.Errno) {
|
||||
return unix.Syscall(
|
||||
unix.SYS_RECVMSG,
|
||||
uintptr(fd),
|
||||
uintptr(unsafe.Pointer(msghdr)),
|
||||
uintptr(flags),
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user