|
Packit Service |
a2ae7a |
/* Substitute for and wrapper around <sys/ioctl.h>.
|
|
Packit Service |
a2ae7a |
Copyright (C) 2008-2019 Free Software Foundation, Inc.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is free software; you can redistribute it and/or modify
|
|
Packit Service |
a2ae7a |
it under the terms of the GNU General Public License as published by
|
|
Packit Service |
a2ae7a |
the Free Software Foundation; either version 3, or (at your option)
|
|
Packit Service |
a2ae7a |
any later version.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
This program is distributed in the hope that it will be useful,
|
|
Packit Service |
a2ae7a |
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
Packit Service |
a2ae7a |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
Packit Service |
a2ae7a |
GNU General Public License for more details.
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
You should have received a copy of the GNU General Public License
|
|
Packit Service |
a2ae7a |
along with this program; if not, see <https://www.gnu.org/licenses/>. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#if __GNUC__ >= 3
|
|
Packit Service |
a2ae7a |
@PRAGMA_SYSTEM_HEADER@
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
@PRAGMA_COLUMNS@
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* The include_next requires a split double-inclusion guard. */
|
|
Packit Service |
a2ae7a |
#if @HAVE_SYS_IOCTL_H@
|
|
Packit Service |
a2ae7a |
# @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
|
|
Packit Service |
a2ae7a |
#define _@GUARD_PREFIX@_SYS_IOCTL_H
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
|
|
Packit Service |
a2ae7a |
but not in <sys/ioctl.h>.
|
|
Packit Service |
a2ae7a |
Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
|
|
Packit Service |
a2ae7a |
But avoid namespace pollution on glibc systems. */
|
|
Packit Service |
a2ae7a |
#ifndef __GLIBC__
|
|
Packit Service |
a2ae7a |
# include <unistd.h>
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* The definition of _GL_WARN_ON_USE is copied here. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
/* Declare overridden functions. */
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#if @GNULIB_IOCTL@
|
|
Packit Service |
a2ae7a |
# if @REPLACE_IOCTL@
|
|
Packit Service |
a2ae7a |
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
|
|
Packit Service |
a2ae7a |
# undef ioctl
|
|
Packit Service |
a2ae7a |
# define ioctl rpl_ioctl
|
|
Packit Service |
a2ae7a |
# endif
|
|
Packit Service |
a2ae7a |
_GL_FUNCDECL_RPL (ioctl, int,
|
|
Packit Service |
a2ae7a |
(int fd, int request, ... /* {void *,char *} arg */));
|
|
Packit Service |
a2ae7a |
_GL_CXXALIAS_RPL (ioctl, int,
|
|
Packit Service |
a2ae7a |
(int fd, int request, ... /* {void *,char *} arg */));
|
|
Packit Service |
a2ae7a |
# else
|
|
Packit Service |
a2ae7a |
# if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1
|
|
Packit Service |
a2ae7a |
_GL_FUNCDECL_SYS (ioctl, int,
|
|
Packit Service |
a2ae7a |
(int fd, int request, ... /* {void *,char *} arg */));
|
|
Packit Service |
a2ae7a |
# endif
|
|
Packit Service |
a2ae7a |
_GL_CXXALIAS_SYS (ioctl, int,
|
|
Packit Service |
a2ae7a |
(int fd, int request, ... /* {void *,char *} arg */));
|
|
Packit Service |
a2ae7a |
# endif
|
|
Packit Service |
a2ae7a |
_GL_CXXALIASWARN (ioctl);
|
|
Packit Service |
a2ae7a |
#elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
|
|
Packit Service |
a2ae7a |
# undef ioctl
|
|
Packit Service |
a2ae7a |
# define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
|
|
Packit Service |
a2ae7a |
#elif defined GNULIB_POSIXCHECK
|
|
Packit Service |
a2ae7a |
# undef ioctl
|
|
Packit Service |
a2ae7a |
# if HAVE_RAW_DECL_IOCTL
|
|
Packit Service |
a2ae7a |
_GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
|
|
Packit Service |
a2ae7a |
"use gnulib module ioctl for portability");
|
|
Packit Service |
a2ae7a |
# endif
|
|
Packit Service |
a2ae7a |
#endif
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
|
|
Packit Service |
a2ae7a |
#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
|
|
Packit Service |
a2ae7a |
#endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
|