// Code generated by cmd/cgo; DO NOT EDIT.

//line /usr/lib/go/src/net/cgo_unix_cgo.go:1:1
// Copyright 2022 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

//go:build cgo && !netgo && unix && !darwin

package net

/*
#define _GNU_SOURCE 1

#cgo CFLAGS: -fno-stack-protector
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netdb.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

#ifndef EAI_NODATA
#define EAI_NODATA -5
#endif

// If nothing else defined EAI_ADDRFAMILY, make sure it has a value.
#ifndef EAI_ADDRFAMILY
#define EAI_ADDRFAMILY -9
#endif

// If nothing else defined EAI_OVERFLOW, make sure it has a value.
#ifndef EAI_OVERFLOW
#define EAI_OVERFLOW -12
#endif
*/
import _ "unsafe"
import "unsafe"

const (
	_C_AF_INET        = ( /*line :39:22*/_Ciconst_AF_INET /*line :39:30*/)
	_C_AF_INET6       = ( /*line :40:22*/_Ciconst_AF_INET6 /*line :40:31*/)
	_C_AF_UNSPEC      = ( /*line :41:22*/_Ciconst_AF_UNSPEC /*line :41:32*/)
	_C_EAI_ADDRFAMILY = ( /*line :42:22*/_Ciconst_EAI_ADDRFAMILY /*line :42:37*/)
	_C_EAI_AGAIN      = ( /*line :43:22*/_Ciconst_EAI_AGAIN /*line :43:32*/)
	_C_EAI_NODATA     = ( /*line :44:22*/_Ciconst_EAI_NODATA /*line :44:33*/)
	_C_EAI_NONAME     = ( /*line :45:22*/_Ciconst_EAI_NONAME /*line :45:33*/)
	_C_EAI_SERVICE    = ( /*line :46:22*/_Ciconst_EAI_SERVICE /*line :46:34*/)
	_C_EAI_OVERFLOW   = ( /*line :47:22*/_Ciconst_EAI_OVERFLOW /*line :47:35*/)
	_C_EAI_SYSTEM     = ( /*line :48:22*/_Ciconst_EAI_SYSTEM /*line :48:33*/)
	_C_IPPROTO_TCP    = ( /*line :49:22*/_Ciconst_IPPROTO_TCP /*line :49:34*/)
	_C_IPPROTO_UDP    = ( /*line :50:22*/_Ciconst_IPPROTO_UDP /*line :50:34*/)
	_C_SOCK_DGRAM     = ( /*line :51:22*/_Ciconst_SOCK_DGRAM /*line :51:33*/)
	_C_SOCK_STREAM    = ( /*line :52:22*/_Ciconst_SOCK_STREAM /*line :52:34*/)
)

type (
	_C_char            =  /*line :56:23*/_Ctype_char /*line :56:29*/
	_C_uchar           =  /*line :57:23*/_Ctype_uchar /*line :57:30*/
	_C_int             =  /*line :58:23*/_Ctype_int /*line :58:28*/
	_C_uint            =  /*line :59:23*/_Ctype_uint /*line :59:29*/
	_C_socklen_t       =  /*line :60:23*/_Ctype_socklen_t /*line :60:34*/
	_C_struct_addrinfo =  /*line :61:23*/_Ctype_struct_addrinfo /*line :61:40*/
	_C_struct_sockaddr =  /*line :62:23*/_Ctype_struct_sockaddr /*line :62:40*/
)

func _C_malloc(n uintptr) unsafe.Pointer { return ( /*line :65:51*/_Cfunc__CMalloc /*line :65:58*/)( /*line :65:60*/_Ctype_size_t /*line :65:68*/(n)) }
func _C_free(p unsafe.Pointer)           { func() { _cgo0 := /*line :66:51*/p; _cgoCheckPointer(_cgo0, nil); /*line :66:53*/_Cfunc_free(_cgo0); }() }

func _C_ai_addr(ai *_C_struct_addrinfo) **_C_struct_sockaddr { return &ai.ai_addr }
func _C_ai_family(ai *_C_struct_addrinfo) *_C_int            { return &ai.ai_family }
func _C_ai_flags(ai *_C_struct_addrinfo) *_C_int             { return &ai.ai_flags }
func _C_ai_next(ai *_C_struct_addrinfo) **_C_struct_addrinfo { return &ai.ai_next }
func _C_ai_protocol(ai *_C_struct_addrinfo) *_C_int          { return &ai.ai_protocol }
func _C_ai_socktype(ai *_C_struct_addrinfo) *_C_int          { return &ai.ai_socktype }

func _C_freeaddrinfo(ai *_C_struct_addrinfo) {
	func() { _cgo0 := /*line :76:17*/ai; _cgoCheckPointer(_cgo0, nil); /*line :76:20*/_Cfunc_freeaddrinfo(_cgo0); }()
}

func _C_gai_strerror(eai _C_int) string {
	return ( /*line :80:9*/_Cfunc_GoString /*line :80:18*/)(( /*line :80:20*/_Cfunc_gai_strerror /*line :80:33*/)(eai))
}

func _C_getaddrinfo(hostname, servname *_C_char, hints *_C_struct_addrinfo, res **_C_struct_addrinfo) (int, error) {
	x, err := func() (_Ctype_int, error){ var _cgo0 *_Ctype_char = /*line :84:26*/hostname; var _cgo1 *_Ctype_char = /*line :84:36*/servname; _cgo2 := /*line :84:46*/hints; _cgo3 := /*line :84:53*/res; _cgoCheckPointer(_cgo2, nil); _cgoCheckPointer(_cgo3, nil); return /*line :84:57*/_C2func_getaddrinfo(_cgo0, _cgo1, _cgo2, _cgo3); }()
	return int(x), err
}
