Blame gnulib-tests/test-sys_select.c

Packit Service fdd496
/* Test of <sys/select.h> substitute.
Packit Service fdd496
   Copyright (C) 2007-2017 Free Software Foundation, Inc.
Packit Service fdd496
Packit Service fdd496
   This program is free software: you can redistribute it and/or modify
Packit Service fdd496
   it under the terms of the GNU General Public License as published by
Packit Service fdd496
   the Free Software Foundation; either version 3 of the License, or
Packit Service fdd496
   (at your option) any later version.
Packit Service fdd496
Packit Service fdd496
   This program is distributed in the hope that it will be useful,
Packit Service fdd496
   but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit Service fdd496
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
Packit Service fdd496
   GNU General Public License for more details.
Packit Service fdd496
Packit Service fdd496
   You should have received a copy of the GNU General Public License
Packit Service fdd496
   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
Packit Service fdd496
Packit Service fdd496
/* Written by Bruno Haible <bruno@clisp.org>, 2007.  */
Packit Service fdd496
Packit Service fdd496
#include <config.h>
Packit Service fdd496
Packit Service fdd496
#include <sys/select.h>
Packit Service fdd496
Packit Service fdd496
#include "signature.h"
Packit Service fdd496
Packit Service fdd496
/* The following may be macros without underlying functions, so only
Packit Service fdd496
   check signature if they are not macros.  */
Packit Service fdd496
#ifndef FD_CLR
Packit Service fdd496
SIGNATURE_CHECK (FD_CLR, void, (int, fd_set *));
Packit Service fdd496
#endif
Packit Service fdd496
#ifndef FD_ISSET
Packit Service fdd496
SIGNATURE_CHECK (FD_ISSET, void, (int, fd_set *));
Packit Service fdd496
#endif
Packit Service fdd496
#ifndef FD_SET
Packit Service fdd496
SIGNATURE_CHECK (FD_SET, int, (int, fd_set *));
Packit Service fdd496
#endif
Packit Service fdd496
#ifndef FD_ZERO
Packit Service fdd496
SIGNATURE_CHECK (FD_ZERO, void, (fd_set *));
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
/* Check that the 'struct timeval' type is defined.  */
Packit Service fdd496
struct timeval a;
Packit Service fdd496
Packit Service fdd496
/* Check that a.tv_sec is wide enough to hold a time_t, ignoring
Packit Service fdd496
   signedness issues.  */
Packit Service fdd496
typedef int verify_tv_sec_type[sizeof (time_t) <= sizeof (a.tv_sec) ? 1 : -1];
Packit Service fdd496
Packit Service fdd496
/* Check that sigset_t is defined.  */
Packit Service fdd496
sigset_t t2;
Packit Service fdd496
Packit Service fdd496
int
Packit Service fdd496
main (void)
Packit Service fdd496
{
Packit Service fdd496
  /* Check that FD_ZERO can be used.  This should not yield a warning
Packit Service fdd496
     such as "warning: implicit declaration of function 'memset'".  */
Packit Service fdd496
  fd_set fds;
Packit Service fdd496
  FD_ZERO (&fds);
Packit Service fdd496
Packit Service fdd496
  return 0;
Packit Service fdd496
}