annotate lib/sys_ioctl.in.h @ 10615:be40ec1f7b03

New module 'sys_ioctl'.
author Bruno Haible <bruno@clisp.org>
date Fri, 10 Oct 2008 04:25:28 +0200
parents
children 8668b19a7032
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
10615
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
1 /* Substitute for and wrapper around <sys/ioctl.h>.
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
2 Copyright (C) 2008 Free Software Foundation, Inc.
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
3
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
6 the Free Software Foundation; either version 2, or (at your option)
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
7 any later version.
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
8
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
12 GNU General Public License for more details.
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
13
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
15 along with this program; if not, write to the Free Software Foundation,
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
16 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
17
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
18 #ifndef _GL_SYS_IOCTL_H
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
19
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
20 @PRAGMA_SYSTEM_HEADER@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
21
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
22 /* The include_next requires a split double-inclusion guard. */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
23 #if @HAVE_SYS_IOCTL_H@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
24 # @INCLUDE_NEXT@ @NEXT_SYS_IOCTL_H@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
25 #endif
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
26
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
27 #ifndef _GL_SYS_IOCTL_H
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
28 #define _GL_SYS_IOCTL_H
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
29
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
30 /* AIX 5.1 and Solaris 10 declare ioctl() in <unistd.h> and in <stropts.h>,
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
31 but not in <sys/ioctl.h>. */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
32 #include <unistd.h>
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
33
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
34 /* The definition of GL_LINK_WARNING is copied here. */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
35
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
36
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
37 /* Declare overridden functions. */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
38
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
39 #ifdef __cplusplus
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
40 extern "C" {
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
41 #endif
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
42
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
43
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
44 #if @GNULIB_IOCTL@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
45 # if @SYS_IOCTL_H_HAVE_WINSOCK2_H@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
46 # undef ioctl
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
47 # define ioctl rpl_ioctl
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
48 extern int ioctl (int fd, int request, ... /* {void *,char *} arg */);
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
49 # endif
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
50 #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H@
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
51 # undef ioctl
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
52 # define ioctl ioctl_used_without_requesting_gnulib_module_ioctl
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
53 #elif defined GNULIB_POSIXCHECK
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
54 # undef ioctl
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
55 # define ioctl(f,c,a) \
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
56 (GL_LINK_WARNING ("ioctl does not portably work on sockets - " \
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
57 "use gnulib module ioctl for portability"), \
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
58 ioctl (f, c, a))
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
59 #endif
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
60
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
61
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
62 #ifdef __cplusplus
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
63 }
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
64 #endif
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
65
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
66
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
67 #endif /* _GL_SYS_IOCTL_H */
be40ec1f7b03 New module 'sys_ioctl'.
Bruno Haible <bruno@clisp.org>
parents:
diff changeset
68 #endif /* _GL_SYS_IOCTL_H */