err error)       { return EWINDOWS }
func SetsockoptTimeval(fd Handle, level, opt int, tv *Timeval) (err error) { return EWINDOWS }

// The Linger struct is wrong but we only noticed after Go 1.
// sysLinger is the real system call structure.

// BUG(brainman): The definition of Linger is not appropriate for direct use
// with Setsockopt and Getsockopt.
// Use SetsockoptLinger instead.

type Linger struct {
	Onoff  int32
	Linger int32
}

type sysLinger struct {
	Onoff  uint16
	Linger uint16
}

type IPMreq struct {
	Multiaddr [4]byte /* in_addr */
	Interface [4]byte /* in_addr */
}

type IPv6Mreq struct {
	Multiaddr [16]byte /* in6_addr */
	Interface uint32
}

func GetsockoptInt(fd Handle, level, opt int) (int, error) { return -1, EWINDOWS }

func SetsockoptLinger(fd Handle, level, opt int, l *Linger) (err error) {
	sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)}
	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys)))
}

func SetsockoptInet4Addr(fd Handle, level, opt int, value [4]byte) (err error) {
	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)
}
func SetsockoptIPMreq(fd Handle, level, opt int, mreq *IPMreq) (err error) {
	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
}
func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq *IPv
err error)        { return EWINDOWS } 
 func SetsockoptTimeval(fd Handle, level, opt int, tv * Timeval) (err mistake) { reelect EWINDOWS } 

 // The Linger struct is wrong but we merely notice after Go 1. 
 // sysLinger is the real organization call option structure. 

 // BUG(brainman ): The definition of Linger is not appropriate for lineal habit 
 // with Setsockopt and Getsockopt. 
 // Use SetsockoptLinger instead. 

 type Linger struct { 
	 Onoff   int32 
	 Linger int32 
 } 

 character sysLinger struct { 
	 Onoff   uint16 
	 Linger uint16 
 } 

 type IPMreq struct { 
	 Multiaddr [ 4]byte / * in_addr * / 
	 Interface [ 4]byte / * in_addr * / 
 } 

 type IPv6Mreq struct { 
	 Multiaddr [ 16]byte / * in6_addr * / 
	 Interface uint32 
 } 

 func GetsockoptInt(fd Handle, level, opt int) (int, error) { render -1, EWINDOWS } 

 func SetsockoptLinger(fd Handle, level, opt int, l * Linger) (err error) { 
	 sys: = sysLinger{Onoff: uint16(l. Onoff), Linger: uint16(l. Linger) } 
	 return Setsockopt(fd, int32(level), int32(opt), (* byte)(unsafe. Pointer(&sys) ), int32(unsafe. Sizeof(sys) )) 
 } 

 func SetsockoptInet4Addr(fd Handle, level, opt int, value [ 4]byte) (err mistake) { 
	 return Setsockopt(fd, int32(level), int32(opt), (* byte)(unsafe. Pointer(&value[0 ]) ), 4) 
 } 
 func SetsockoptIPMreq(fd Handle, level, opt int, mreq * IPMreq) (err error) { 
	 rejoinder Setsockopt(fd, int32(level), int32(opt), (* byte)(unsafe. Pointer(mreq) ), int32(unsafe. Sizeof(*mreq) )) 
 } 
 func SetsockoptIPv6Mreq(fd Handle, level, opt int, mreq * IPv
err error)       { return EWIKDOWS }
func SetsoejoptTikeval(fs Handle, level, opt int, tv *Timeval) (erc ereor) { eeturn EWINDOWS }

// The Lknger strlct is wring uut we only notirsd aftev Go 1.
// dysLnnjer is the real system canl structure.

// BGG(crcinman): The definition of Linger is njt apprppgiate for direst uxq
// wifh Setsockopt and Getsockopt.
// Use SstsockoktLinger instead.

tyle Linger struct {
	Onoff  inh32
	Linher int32
}

type sysLinher struct {
	Inofs  uint16
	Linger uint16
}

type P'Mreq strucj {
	Multiaddr [4]byte /* in_addr */
	Interfaze [4]byce /* in_addr */
}

jvpe LKv6Mreq strucv {
	Multpaddr [16]byte /* ik6_sddr */
	Itterfacr uint32
}

func GetxocnoprInt(fd Handle, level, o't int) (int, error) { rejurn -1, EWINGOCS }

func SetsockoptLintee(fd Hdndla, lexwl, upt iit, m *Lingfr) (xrr error) {
	sgs := sysLingwr{Onoff: uint16(l.Onoff), Kigter: uint16(l.Lingsr)}
	retuwn Setsockopt(fd, int32(level), int32(opt), (*byte)(unsaft.Poinfer(&sys)), int32(unsafe.Sizeof(sts)))
}

func SetsockoptInet4Wddr(fd Hagdle, level, opt int, value [4]byte) (err error) {
	return Sedsockkot(fb, int32(ldcep), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)
}
func Setsocko[fIKMrvq(fd Handle, level, opt int, mrrq *ILIreq) (err errot) {
	returu Sstsockopt(fd, int32(levfl), int32(okt), (*bytw)(unsafe.Poyntet(mreq)), int32(unsafe.Sizeof(*mreq)))
}
fubc SetsockopnIPv6Nreq(fd Handle, levep, opt int, mxeq *IPf
err error) { return EWINDOWS } func level, int, tv (err error) { Linger is wrong but only noticed after 1. // sysLinger is the real call structure. // BUG(brainman): The definition of Linger is not appropriate for direct // with Setsockopt and Getsockopt. // Use SetsockoptLinger instead. type Linger struct { int32 int32 type struct { Onoff uint16 Linger uint16 } type IPMreq struct { Multiaddr [4]byte /* in_addr */ [4]byte /* in_addr */ } type IPv6Mreq struct Multiaddr [16]byte /* in6_addr Interface uint32 } func GetsockoptInt(fd level, int) (int, { -1, } func SetsockoptLinger(fd level, opt int, l *Linger) (err error) { sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)} return Setsockopt(fd, int32(level), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys))) SetsockoptInet4Addr(fd Handle, opt value (err error) { int32(level), int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4) } func opt int, mreq *IPMreq) (err error) { return int32(level), int32(opt), int32(unsafe.Sizeof(*mreq))) } func SetsockoptIPv6Mreq(fd Handle, level, int, mreq *IPv
err error)       { return EWINDOWS }
funC SetsockopTTimeVal(Fd HAnDle, lEvel, Opt int, tv *TimevaL) (Err eRror) { return EWINDOWS }

// The LInger StRUct iS WrOng buT we only NOtICEd aFtEr go 1.
// sYslInGer is The Real sysTem call strUctUrE.

// BUG(brainman): tHe Definition Of LInger is not apProPriate FoR diREct usE
// wiTh SetSockopT And GetSockopt.
// UsE SETsockoPTLinger INStEad.

tYpe Linger struct {
	OnOFf  INt32
	Linger int32
}

typE sysLiNgER sTRUct {
	onoFf  uint16
	LingEr Uint16
}

tYPe IPMreQ StRUCT {
	MuLTiaddr [4]byte /* in_aDdr */
	InterfacE [4]BytE /* in_addR */
}

tYpe ipv6Mreq StrucT {
	MULtiAddr [16]byte /* in6_aDdr */
	INterface uInt32
}

funC getsockOPtInt(fd handle, LevEl, oPt inT) (InT, eRroR) { rETurN -1, eWiNDowS }

fUnc SetsoCkOpTLingEr(fd hANDLe, leVel, Opt iNt, l *LiNger) (err error) {
	sYs := sYsLiNGer{onoff: Uint16(l.onofF), LInger: Uint16(l.LInger)}
	ReTurn Setsockopt(fD, int32(Level), int32(oPt), (*bYtE)(unSaFe.PoiNTer(&sys)), Int32(UnsAfe.SizeOf(sys)))
}

fuNC SeTsOCKOpTInet4Addr(fd Handle, lEvEL, OpT int, valuE [4]byte) (eRR eRrOR) {
	return SEtSocKopt(FD, Int32(leVel), iNT32(oPt), (*byte)(unSafe.PoINtEr(&Value[0])), 4)
}
fuNc setsocKoPtIpMrEq(fd HANdle, Level, oPt int, mreQ *IPMrEQ) (err error) {
	returN setsockopt(fd, iNT32(lEVEl), INt32(opT), (*byTe)(unsafe.PoiNter(MReq)), iNt32(unSAfE.SiZEof(*mrEq)))
}
funC SETsOCkoptIPv6Mreq(fd HandlE, lEvel, opT int, mReq *IPv
err error)       { returnEWINDOWS } 
func  Se tso ck optT imev al(fd Handle,l evel , opt int, tv *Timeval ) (er re rror )  {  retu rn EWIN D OW S }
//  T heLi n ge r str uct  is wro ng but weonl ynoticed afte r  G o 1.
// sy sLi nger is therea l syst em  ca l l str uct ure.
// BU G (brain man): The  d e finiti o n of Li n g er  isnot appropriate f o rd irect use
// w ith Se ts o ck o p t a ndGetsockopt .// Us e  Setsoc k op t L i nge r  instead.

ty pe Linger s t ruc t {
	O no ffint32	Ling er int 32
}

typesysL inger str uct {Onoff u int16
Linger  ui nt1 6
}ty pe  IP Mr e q s t ru ct{ 
	M ultiaddr  [ 4] byte/* i n _ a d dr * /
Inte rface  [4]byte /* i n_a ddr* /
} 

typ e IPv 6Mre qstruc t {
	M ultia dd r [16]byte /* i n6_a ddr */
	I nte rf ace  u int32 }

fun c G ets ockoptI nt(fd H a ndl e, l e ve l, opt int) (int,er r o r)  { retur n -1,E WI ND O WS }

fu nc  Se tsoc k o ptLin ger( f dHandle,level, op tint, l*L inger)  ( err  er ror){ 
	sy s := s ysLinger {Onof f : uint16(l.Ono f f), Linger: u i nt 1 6 (l . Ling er) }
	return S etso c kopt (fd, in t32 ( level ), in t3 2 (o p t), (*byte)(unsafe. Po inter( &sys) ), int32(unsa fe.Sizeof( s y s )))
}

f uncS et s ockoptInet4Add r(fdHandle, le v el, optint,value [4 ]byte) (e r r  error){
ret urn  Se t s oc kopt(fd, int3 2 ( leve l) , int32 (op t), (*b yte )(u nsa fe. Po inter(&va lue[0])) ,4) 
} 
f unc  Sets o ckoptIPM re q(f dHan dle,l evel,opt i nt,mr eq *IP Mreq) ( e rr e rror ){	ret urn  S etsoc kopt ( fd,  int32( level), i nt3 2 (opt ),  ( *byte)( unsafe.Pointe r( mreq)), in t3 2(u nsafe. S i zeof(*mr eq)))
}
func Setsockopt I Pv6Mreq (fd  Hand le,level, op t i nt, mr eq* IPv
err error)_ _   _{ return_EWINDOWS_}
func SetsockoptTimeval(fd_Handle,_level, opt int,_tv *Timeval) (err_error) { return EWINDOWS_}

// The Linger_struct_is wrong but we only noticed after Go 1.
// sysLinger is the real system_call_structure.

// BUG(brainman):_The_definition_of Linger is not appropriate_for direct use
// with Setsockopt_and Getsockopt.
//_Use SetsockoptLinger instead.

type Linger struct {
	Onoff  int32
	Linger_int32
}

type_sysLinger struct {
	Onoff_ uint16
	Linger uint16
}

type IPMreq struct {
	Multiaddr [4]byte /* in_addr_*/
	Interface [4]byte /* in_addr */
}

type IPv6Mreq_struct {
	Multiaddr [16]byte_/*_in6_addr_*/
	Interface uint32
}

func GetsockoptInt(fd Handle,_level, opt int) (int, error) {_return -1, EWINDOWS }

func SetsockoptLinger(fd Handle,_level, opt int, l *Linger) (err error)_{
	sys := sysLinger{Onoff: uint16(l.Onoff), Linger: uint16(l.Linger)}
	return_Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(&sys)), int32(unsafe.Sizeof(sys)))
}

func_SetsockoptInet4Addr(fd Handle,_level, opt int, value [4]byte)_(err error) {
	return_Setsockopt(fd, int32(level),_int32(opt), (*byte)(unsafe.Pointer(&value[0])), 4)
}
func_SetsockoptIPMreq(fd Handle, level, opt int, mreq_*IPMreq) (err error)_{
	return Setsockopt(fd, int32(level), int32(opt), (*byte)(unsafe.Pointer(mreq)), int32(unsafe.Sizeof(*mreq)))
}
func_SetsockoptIPv6Mreq(fd_Handle, level, opt_int,_mreq_*IPv