1// Copyright 2011 The Go Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style
3// license that can be found in the LICENSE file.
4
5// +build aix darwin dragonfly freebsd hurd linux netbsd openbsd solaris windows
6
7package poll
8
9import "syscall"
10
11// SetsockoptIPMreq wraps the setsockopt network call with an IPMreq argument.
12func (fd *FD) SetsockoptIPMreq(level, name int, mreq *syscall.IPMreq) error {
13	if err := fd.incref(); err != nil {
14		return err
15	}
16	defer fd.decref()
17	return syscall.SetsockoptIPMreq(fd.Sysfd, level, name, mreq)
18}
19
20// SetsockoptIPv6Mreq wraps the setsockopt network call with an IPv6Mreq argument.
21func (fd *FD) SetsockoptIPv6Mreq(level, name int, mreq *syscall.IPv6Mreq) error {
22	if err := fd.incref(); err != nil {
23		return err
24	}
25	defer fd.decref()
26	return syscall.SetsockoptIPv6Mreq(fd.Sysfd, level, name, mreq)
27}
28