havelib: Fix for Solaris 11 OpenIndiana and Solaris 11 OmniOS.
[gnulib.git] / lib / sys_ioctl.in.h
blob88b4de715e2321b97394318cadf8e564a05529a7
1 /* Substitute for and wrapper around <sys/ioctl.h>.
2 Copyright (C) 2008-2020 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
7 any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22 @PRAGMA_COLUMNS@
24 /* The include_next requires a split double-inclusion guard. */
25 #if @HAVE_SYS_IOCTL_H@
26 # @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
27 #endif
29 #ifndef _@GUARD_PREFIX@_SYS_IOCTL_H
30 #define _@GUARD_PREFIX@_SYS_IOCTL_H
32 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
33 but not in <sys/ioctl.h>.
34 Haiku declares ioctl() in <unistd.h>, but not in <sys/ioctl.h>.
35 But avoid namespace pollution on glibc systems. */
36 #ifndef __GLIBC__
37 # include <unistd.h>
38 #endif
40 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
42 /* The definition of _GL_WARN_ON_USE is copied here. */
45 /* Declare overridden functions. */
47 #if @GNULIB_IOCTL@
48 # if @REPLACE_IOCTL@
49 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
50 # undef ioctl
51 # define ioctl rpl_ioctl
52 # endif
53 _GL_FUNCDECL_RPL (ioctl, int,
54 (int fd, int request, ... /* {void *,char *} arg */));
55 _GL_CXXALIAS_RPL (ioctl, int,
56 (int fd, int request, ... /* {void *,char *} arg */));
57 # else
58 # if @SYS_IOCTL_H_HAVE_WINSOCK2_H@ || 1
59 _GL_FUNCDECL_SYS (ioctl, int,
60 (int fd, int request, ... /* {void *,char *} arg */));
61 # endif
62 _GL_CXXALIAS_SYS (ioctl, int,
63 (int fd, int request, ... /* {void *,char *} arg */));
64 # endif
65 _GL_CXXALIASWARN (ioctl);
66 #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@
67 # undef ioctl
68 # define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
69 #elif defined GNULIB_POSIXCHECK
70 # undef ioctl
71 # if HAVE_RAW_DECL_IOCTL
72 _GL_WARN_ON_USE (ioctl, "ioctl does not portably work on sockets - "
73 "use gnulib module ioctl for portability");
74 # endif
75 #endif
78 #endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */
79 #endif /* _@GUARD_PREFIX@_SYS_IOCTL_H */