From 06eaf7232e9a920468c0f8d74dcf2fe8b555501c Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 14:24:36 +0200 Subject: Adding upstream version 1:10.11.6. Signed-off-by: Daniel Baumann --- include/my_net.h | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 include/my_net.h (limited to 'include/my_net.h') diff --git a/include/my_net.h b/include/my_net.h new file mode 100644 index 00000000..f56ae09a --- /dev/null +++ b/include/my_net.h @@ -0,0 +1,80 @@ +/* Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; version 2 of the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335 USA */ + +/* + This file is also used to make handling of sockets and ioctl() + portable across systems. + +*/ + +#ifndef _my_net_h +#define _my_net_h + +C_MODE_START + +#include +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +#ifdef HAVE_NETINET_IN_H +#include +#endif +#ifdef HAVE_ARPA_INET_H +#include +#endif +#if defined(HAVE_POLL_H) +#include +#elif defined(HAVE_SYS_POLL_H) +#include +#endif /* defined(HAVE_POLL_H) */ +#ifdef HAVE_SYS_IOCTL_H +#include +#endif + +#if !defined(_WIN32) +#include +#include +#include +#if !defined(alpha_linux_port) +#include +#endif +#endif + +#if defined(_WIN32) +#define O_NONBLOCK 1 /* For emulation of fcntl() */ + +/* + SHUT_RDWR is called SD_BOTH in windows and + is defined to 2 in winsock2.h + #define SD_BOTH 0x02 +*/ +#define SHUT_RDWR 0x02 +#else +#include /* getaddrinfo() & co */ +#endif + +/* + On OSes which don't have the in_addr_t, we guess that using uint32 + is the best possible choice. We guess this from the fact that on + HP-UX64bit & FreeBSD64bit & Solaris64bit, in_addr_t is equivalent to + uint32. And on Linux32bit too. +*/ +#ifndef HAVE_IN_ADDR_T +#define in_addr_t uint32 +#endif + + +C_MODE_END +#endif -- cgit v1.2.3