Blame src/microhttpd/sysfdsetsize.c

Packit 875988
/*
Packit 875988
  This file is part of libmicrohttpd
Packit 875988
  Copyright (C) 2015 Karlson2k (Evgeny Grin)
Packit 875988
Packit 875988
  This library is free software; you can redistribute it and/or
Packit 875988
  modify it under the terms of the GNU Lesser General Public
Packit 875988
  License as published by the Free Software Foundation; either
Packit 875988
  version 2.1 of the License, or (at your option) any later version.
Packit 875988
Packit 875988
  This library is distributed in the hope that it will be useful,
Packit 875988
  but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 875988
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 875988
  Lesser General Public License for more details.
Packit 875988
Packit 875988
  You should have received a copy of the GNU Lesser General Public
Packit 875988
  License along with this library; if not, write to the Free Software
Packit 875988
  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
Packit 875988
*/
Packit 875988
Packit 875988
/**
Packit 875988
 * @file microhttpd/sysfdsetsize.c
Packit 875988
 * @brief  Helper for obtaining FD_SETSIZE system default value
Packit 875988
 * @author Karlson2k (Evgeny Grin)
Packit 875988
 */
Packit 875988
Packit 875988
Packit 875988
#include "MHD_config.h"
Packit 875988
Packit 875988
#ifdef FD_SETSIZE
Packit 875988
/* FD_SETSIZE was defined before system headers. */
Packit 875988
/* To get system value of FD_SETSIZE, undefine FD_SETSIZE
Packit 875988
   here. */
Packit 875988
#undef FD_SETSIZE
Packit 875988
#endif /* FD_SETSIZE */
Packit 875988
Packit 875988
#include <stdlib.h>
Packit 875988
#if defined(__VXWORKS__) || defined(__vxworks) || defined(OS_VXWORKS)
Packit 875988
#include <sockLib.h>
Packit 875988
#endif /* OS_VXWORKS */
Packit 875988
#if HAVE_SYS_SELECT_H
Packit 875988
#include <sys/select.h>
Packit 875988
#endif /* HAVE_SYS_SELECT_H */
Packit 875988
#if HAVE_SYS_TYPES_H
Packit 875988
#include <sys/types.h>
Packit 875988
#endif /* HAVE_SYS_TYPES_H */
Packit 875988
#if HAVE_SYS_TIME_H
Packit 875988
#include <sys/time.h>
Packit 875988
#endif /* HAVE_SYS_TIME_H */
Packit 875988
#if HAVE_TIME_H
Packit 875988
#include <time.h>
Packit 875988
#endif /* HAVE_TIME_H */
Packit 875988
#ifdef HAVE_UNISTD_H
Packit 875988
#include <unistd.h>
Packit 875988
#endif /* HAVE_UNISTD_H */
Packit 875988
#if HAVE_SYS_SOCKET_H
Packit 875988
#include <sys/socket.h>
Packit 875988
#endif /* HAVE_SYS_SOCKET_H */
Packit 875988
Packit 875988
#if defined(_WIN32) && !defined(__CYGWIN__)
Packit 875988
#ifndef WIN32_LEAN_AND_MEAN
Packit 875988
#define WIN32_LEAN_AND_MEAN 1
Packit 875988
#endif /* !WIN32_LEAN_AND_MEAN */
Packit 875988
#include <winsock2.h>
Packit 875988
#endif /* _WIN32 && !__CYGWIN__ */
Packit 875988
Packit 875988
#ifndef FD_SETSIZE
Packit 875988
#error FD_SETSIZE must be defined in system headers
Packit 875988
#endif /* !FD_SETSIZE */
Packit 875988
Packit 875988
#include "sysfdsetsize.h"
Packit 875988
Packit 875988
/**
Packit 875988
 * Get system default value of FD_SETSIZE
Packit 875988
 * @return system default value of FD_SETSIZE
Packit 875988
 */
Packit 875988
int
Packit 875988
get_system_fdsetsize_value (void)
Packit 875988
{
Packit 875988
  return FD_SETSIZE;
Packit 875988
}