aboutsummaryrefslogtreecommitdiff
path: root/syscall_linux.go
blob: 340354470827d7cf7b648ee521bfcc305b4c8c03 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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),
	)
}