|
Packit |
c22fc9 |
/*
|
|
Packit |
c22fc9 |
* Soft: Keepalived is a failover program for the LVS project
|
|
Packit |
c22fc9 |
* <www.linuxvirtualserver.org>. It monitor & manipulate
|
|
Packit |
c22fc9 |
* a loadbalanced server pool using multi-layer checks.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* Part: old_socket.h include file.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* Author: Alexandre Cassen, <acassen@linux-vs.org>
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* This program is distributed in the hope that it will be useful,
|
|
Packit |
c22fc9 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit |
c22fc9 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
Packit |
c22fc9 |
* See the GNU General Public License for more details.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* This program is free software; you can redistribute it and/or
|
|
Packit |
c22fc9 |
* modify it under the terms of the GNU General Public License
|
|
Packit |
c22fc9 |
* as published by the Free Software Foundation; either version
|
|
Packit |
c22fc9 |
* 2 of the License, or (at your option) any later version.
|
|
Packit |
c22fc9 |
*
|
|
Packit |
c22fc9 |
* Copyright (C) 2001-2016 Alexandre Cassen, <acassen@gmail.com>
|
|
Packit |
c22fc9 |
*/
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#ifndef _OLD_SOCKET_H
|
|
Packit |
c22fc9 |
#define _OLD_SOCKET_H 1
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#include "config.h"
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#if !HAVE_DECL_SOCK_NONBLOCK || !HAVE_DECL_SOCK_CLOEXEC
|
|
Packit |
c22fc9 |
#include <stdbool.h>
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* Kernels < 2.6.27 and glibc < 2.9 don't support the SOCK_CLOEXEC or SOCK_NONBLOCK options */
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* We need to know if SOCK_NONBLOCK is desired */
|
|
Packit |
c22fc9 |
#if !HAVE_DECL_SOCK_NONBLOCK
|
|
Packit |
c22fc9 |
#define SOCK_NONBLOCK 04000
|
|
Packit |
c22fc9 |
#endif
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
/* SOCK_CLOEXEC is always wanted, so we don't want to set if it is not defined */
|
|
Packit |
c22fc9 |
#if !HAVE_DECL_SOCK_CLOEXEC
|
|
Packit |
c22fc9 |
#define SOCK_CLOEXEC 0
|
|
Packit |
c22fc9 |
#endif
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
extern bool set_sock_flags(int fd, int cmd, long flags);
|
|
Packit |
c22fc9 |
#endif
|
|
Packit |
c22fc9 |
|
|
Packit |
c22fc9 |
#endif
|