Back to index

glibc  2.9
ioctls-tmpl.c
Go to the documentation of this file.
00001 /* On SVR4, this #define is necessary to make <sys/ioctl.h> define
00002    many of the ioctls.  */
00003 #define BSD_COMP
00004 
00005 #include <sys/types.h>
00006 #include <sys/param.h>
00007 
00008 /* On SunOS 4.1, <sys/ioctl.h> and <sys/termios.h> define some symbols
00009    with different values, but <sys/termios.h> defines some ioctl symbols
00010    not in <sys/ioctl.h>, so we need it.  Our <sys/ioctl.h> should define
00011    them with the values from Sun's <sys/ioctl.h>, not <sys/termios.h>.
00012    So we include <sys/termios.h> and let <sys/ioctl.h> redefine things.
00013    This produces some spurious warnings.  */
00014 
00015 #ifdef HAVE_sys_termios_h
00016 #include <sys/termios.h>
00017 #endif
00018 
00019 /* This causes <sys/ioctl.h> to define some necessary data structure.  */
00020 #ifdef sony_news
00021 #define KANJI
00022 #endif
00023 
00024 #include <sys/ioctl.h>
00025 
00026 #ifdef SIOCGIFCONF
00027 #include <sys/socket.h>
00028 #include <sys/time.h>
00029 #include <net/if.h>
00030 #include <net/route.h>
00031 #if    defined(SIOCGARP) && !defined(ARPOP_REQUEST)
00032 #include <net/if_arp.h>
00033 #endif
00034 #ifdef SIOCGNIT
00035 #ifdef HAVE_net_nit_h
00036 #include <net/nit.h>
00037 #else  /* No net/nit.h.  */
00038 #undef SIOCGNIT
00039 #undef SIOCSNIT
00040 #endif /* net/nit.h.  */
00041 #endif /* SIOCGNIT.  */
00042 #endif /* SIOCGIFCONF.  */
00043 
00044 /* These exist on Sequents.  */
00045 #ifdef SMIOSTATS
00046 #include <sec/sec.h>
00047 #include <sec/sm.h>
00048 #endif
00049 #ifdef SMIOGETREBOOT0
00050 #include <i386/cfg.h>
00051 #endif
00052 #ifdef ZIOCBCMD
00053 #include <zdc/zdc.h>
00054 #endif
00055 
00056 /* These exist under Ultrix, but I figured there may be others.  */
00057 #ifdef DIOCGETPT
00058 #include <ufs/fs.h>         /* for DIOC* */
00059 #endif
00060 #ifdef DEVGETGEOM
00061 #include <sys/devio.h>
00062 #endif
00063 
00064 #ifdef ultrix
00065 /* Ultrix has a conditional include that brings these in; we have to force
00066    their inclusion when we actually compile them.  */
00067 #undef TCGETA
00068 #undef TCSETA
00069 #undef TCSETAW
00070 #undef TCSETAF
00071 #undef TCGETP
00072 #undef TCSANOW
00073 #undef TCSADRAIN
00074 #undef TCSAFLUSH
00075 #ifdef ELSETPID
00076 #include <sys/un.h> /* get sockaddr_un for elcsd.h */
00077 #include <elcsd.h>
00078 #endif
00079 #ifdef DKIOCDOP
00080 #include <sys/dkio.h>
00081 #endif
00082 /* Couldn't find the header where the structures used by these are
00083    defined; it looks like an unbundled LAT package or something.  */
00084 #undef LIOCSOL
00085 #undef LIOCRES
00086 #undef LIOCCMD
00087 #undef LIOCINI
00088 #undef LIOCTTYI
00089 #undef LIOCCONN
00090 /* struct mtop hasn't been in sys/mtio.h since 4.1 */
00091 #undef MTIOCTOP
00092 #undef MTIOCGET
00093 #endif
00094 
00095 #if defined(__osf__) && defined(__alpha__)
00096 #include <sys/ioctl_compat.h>      /* To get TIOCGETP, etc.  */
00097 #include <alpha/pt.h>              /* for DIOC* */
00098 #include <sys/mtio.h>              /* for MTIOC* */
00099 /* The binlog_getstatus structure doesn't seem to be defined.  */
00100 #undef BINLOG_GETSTATUS
00101 /* Can't find `struct ifdata' anywhere.  */
00102 #undef SIOCMANREQ
00103 #undef SIOCGETEVENTS
00104 /* OSF/1 smells an awful lot like Ultrix.  */
00105 #undef TCGETA
00106 #undef TCSETA
00107 #undef TCSETAF
00108 #undef TCSETAW
00109 /* This macro looks screwed in sys/devio.h.  */
00110 #undef DEV_DISKPART
00111 /* This is in sys/dkio.h, but we don't need it.  */
00112 #undef DKIOCACC
00113 #undef DKIOCDOP
00114 #undef DKIOCEXCL
00115 #undef DKIOCGET
00116 #undef DKIOCHDR
00117 /* Introduced by OSF/1 2.0.  */
00118 #undef FIOPIPESTAT
00119 #undef SIOCSRREQR
00120 #undef SIOCSRREQW
00121 #undef SRVC_REQUEST
00122 #endif
00123 
00124 #define       DEFINE(name, value) \
00125   printf("#define %s 0x%.8x\n", (name), (value))
00126 
00127 int
00128 main()
00129 {
00130   REQUESTS
00131 
00132   exit(0);
00133   return 0;
00134 }