Blame gnulib-tests/sys_ioctl.in.h

Packit Service fdd496
/* Substitute for and wrapper around <sys/ioctl.h>.
Packit Service fdd496
   Copyright (C) 2008-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, or (at your option)
Packit Service fdd496
   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
#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
Packit Service fdd496
Packit Service fdd496
#if __GNUC__ >= 3
Packit Service fdd496
@PRAGMA_SYSTEM_HEADER@
Packit Service fdd496
#endif
Packit Service fdd496
@PRAGMA_COLUMNS@
Packit Service fdd496
Packit Service fdd496
/* The include_next requires a split double-inclusion guard.  */
Packit Service fdd496
#if @HAVE_SYS_IOCTL_H@
Packit Service fdd496
# @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
Packit Service fdd496
#define _@GUARD_PREFIX@_SYS_IOCTL_H
Packit Service fdd496
Packit Service fdd496
/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
Packit Service fdd496
   but not in <sys/ioctl.h>.
Packit Service fdd496
   But avoid namespace pollution on glibc systems.  */
Packit Service fdd496
#ifndef __GLIBC__
Packit Service fdd496
# include <unistd.h>
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
Packit Service fdd496
Packit Service fdd496
/* The definition of _GL_WARN_ON_USE is copied here.  */
Packit Service fdd496
Packit Service fdd496
Packit Service fdd496
/* Declare overridden functions.  */
Packit Service fdd496
Packit Service fdd496
#if @GNULIB_IOCTL@
Packit Service fdd496
# if @REPLACE_IOCTL@
Packit Service fdd496
#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
Packit Service fdd496
#   undef ioctl
Packit Service fdd496
#   define ioctl rpl_ioctl
Packit Service fdd496
#  endif
Packit Service fdd496
_GL_FUNCDECL_RPL (ioctl, int,
Packit Service fdd496
                  (int fd, int request, ... /* {void *,char *} arg */));
Packit Service fdd496
_GL_CXXALIAS_RPL (ioctl, int,
Packit Service fdd496
                  (int fd, int request, ... /* {void *,char *} arg */));
Packit Service fdd496
# else
Packit Service fdd496
#  if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1
Packit Service fdd496
_GL_FUNCDECL_SYS (ioctl, int,
Packit Service fdd496
                  (int fd, int request, ... /* {void *,char *} arg */));
Packit Service fdd496
#  endif
Packit Service fdd496
_GL_CXXALIAS_SYS (ioctl, int,
Packit Service fdd496
                  (int fd, int request, ... /* {void *,char *} arg */));
Packit Service fdd496
# endif
Packit Service fdd496
_GL_CXXALIASWARN (ioctl);
Packit Service fdd496
#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
Packit Service fdd496
# undef ioctl
Packit Service fdd496
# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
Packit Service fdd496
#elif defined GNULIB_POSIXCHECK
Packit Service fdd496
# undef ioctl
Packit Service fdd496
# if HAVE_RAW_DECL_IOCTL
Packit Service fdd496
_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
Packit Service fdd496
                 "use gnulib module ioctl for portability");
Packit Service fdd496
# endif
Packit Service fdd496
#endif
Packit Service fdd496
Packit Service fdd496
Packit Service fdd496
#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
Packit Service fdd496
#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */