// D import file generated from '../../../../libphobos/libdruntime/core/sys/posix/sys/ioctl.d'
module core.sys.posix.sys.ioctl;
import core.stdc.config;
version (Posix)
{
	extern (C) @system nothrow version (linux)
	{
		import core.sys.posix.termios;
		public import core.sys.posix.termios : termio, winsize;

		enum _IOC_NRBITS = 8;
		enum _IOC_TYPEBITS = 8;
		enum _IOC_SIZEBITS = 14;
		enum _IOC_DIRBITS = 2;
		enum _IOC_NRMASK = (1 << _IOC_NRBITS) - 1;
		enum _IOC_TYPEMASK = (1 << _IOC_TYPEBITS) - 1;
		enum _IOC_SIZEMASK = (1 << _IOC_SIZEBITS) - 1;
		enum _IOC_DIRMASK = (1 << _IOC_DIRBITS) - 1;
		enum _IOC_NRSHIFT = 0;
		enum _IOC_TYPESHIFT = _IOC_NRSHIFT + _IOC_NRBITS;
		enum _IOC_SIZESHIFT = _IOC_TYPESHIFT + _IOC_TYPEBITS;
		enum _IOC_DIRSHIFT = _IOC_SIZESHIFT + _IOC_SIZEBITS;
		enum _IOC_NONE = 0;
		enum _IOC_WRITE = 1;
		enum _IOC_READ = 2;
		extern (D) template _IOC(T = typeof(null))
		{
			int _IOC(int dir, int type, int nr)
			{
				return dir << _IOC_DIRSHIFT | type << _IOC_TYPESHIFT | nr << _IOC_NRSHIFT | (is(T == typeof(null)) ? 0 : T.sizeof << _IOC_SIZESHIFT);
			}

		}

		extern (D) int _IO(int type, int nr);

		extern (D) template _IOR(T)
		{
			int _IOR(int type, int nr)
			{
				return _IOC!(T)(_IOC_READ, type, nr);
			}

		}

		extern (D) template _IOW(T)
		{
			int _IOW(int type, int nr)
			{
				return _IOC!(T)(_IOC_WRITE, type, nr);
			}

		}

		extern (D) template _IOWR(T)
		{
			int _IOWR(int type, int nr)
			{
				return _IOC!(T)(_IOC_READ | _IOC_WRITE, type, nr);
			}

		}

		extern (D) int _IOC_DIR(int nr);

		extern (D) int _IOC_TYPE(int nr);

		extern (D) int _IOC_NR(int nr);

		extern (D) int _IOC_SIZE(int nr);

		enum IOC_IN = _IOC_WRITE << _IOC_DIRSHIFT;
		enum IOC_OUT = _IOC_READ << _IOC_DIRSHIFT;
		enum IOC_INOUT = (_IOC_READ | _IOC_WRITE) << _IOC_DIRSHIFT;
		enum IOCSIZE_MASK = _IOC_SIZEMASK << _IOC_DIRSHIFT;
		enum IOCSIZE_SHIFT = _IOC_SIZESHIFT;
		enum TIOCM_LE = 1;
		enum TIOCM_DTR = 2;
		enum TIOCM_RTS = 4;
		enum TIOCM_ST = 8;
		enum TIOCM_SR = 16;
		enum TIOCM_CTS = 32;
		enum TIOCM_CAR = 64;
		enum TIOCM_RNG = 128;
		enum TIOCM_DSR = 256;
		enum TIOCM_CD = TIOCM_CAR;
		enum TIOCM_RI = TIOCM_RNG;
		enum N_TTY = 0;
		enum N_SLIP = 1;
		enum N_MOUSE = 2;
		enum N_PPP = 3;
		enum N_STRIP = 4;
		enum N_AX25 = 5;
		enum N_X25 = 6;
		enum N_6PACK = 7;
		enum N_MASC = 8;
		enum N_R3964 = 9;
		enum N_PROFIBUS_FDL = 10;
		enum N_IRDA = 11;
		enum N_SMSBLOCK = 12;
		enum N_HDLC = 13;
		enum N_SYNC_PPP = 14;
		enum N_HCI = 15;
		enum TCGETS = 21505;
		enum TCSETS = 21506;
		enum TCSETSW = 21507;
		enum TCSETSF = 21508;
		enum TCGETA = 21509;
		enum TCSETA = 21510;
		enum TCSETAW = 21511;
		enum TCSETAF = 21512;
		enum TCSBRK = 21513;
		enum TCXONC = 21514;
		enum TCFLSH = 21515;
		enum TIOCEXCL = 21516;
		enum TIOCNXCL = 21517;
		enum TIOCSCTTY = 21518;
		enum TIOCGPGRP = 21519;
		enum TIOCSPGRP = 21520;
		enum TIOCOUTQ = 21521;
		enum TIOCSTI = 21522;
		enum TIOCGWINSZ = 21523;
		enum TIOCSWINSZ = 21524;
		enum TIOCMGET = 21525;
		enum TIOCMBIS = 21526;
		enum TIOCMBIC = 21527;
		enum TIOCMSET = 21528;
		enum TIOCGSOFTCAR = 21529;
		enum TIOCSSOFTCAR = 21530;
		enum FIONREAD = 21531;
		enum TIOCINQ = FIONREAD;
		enum TIOCLINUX = 21532;
		enum TIOCCONS = 21533;
		enum TIOCGSERIAL = 21534;
		enum TIOCSSERIAL = 21535;
		enum TIOCPKT = 21536;
		enum FIONBIO = 21537;
		enum TIOCNOTTY = 21538;
		enum TIOCSETD = 21539;
		enum TIOCGETD = 21540;
		enum TCSBRKP = 21541;
		enum TIOCSBRK = 21543;
		enum TIOCCBRK = 21544;
		enum TIOCGSID = 21545;
		enum TCGETS2 = _IOR!(termios2)('T', 42);
		enum TCSETS2 = _IOR!(termios2)('T', 43);
		enum TCSETSW2 = _IOW!(termios2)('T', 44);
		enum TCSETSF2 = _IOW!(termios2)('T', 45);
		enum TIOCGRS485 = 21550;
		enum TIOCSRS485 = 21551;
		enum TIOCGPTN = _IOR!(uint)('T', 48);
		enum TIOCSPTLCK = _IOW!(int)('T', 49);
		enum TIOCGDEV = _IOR!(uint)('T', 50);
		enum TCGETX = 21554;
		enum TCSETX = 21555;
		enum TCSETXF = 21556;
		enum TCSETXW = 21557;
		enum TIOCSIG = _IOW!(int)('T', 54);
		enum TIOCVHANGUP = 21559;
		enum FIONCLEX = 21584;
		enum FIOCLEX = 21585;
		enum FIOASYNC = 21586;
		enum TIOCSERCONFIG = 21587;
		enum TIOCSERGWILD = 21588;
		enum TIOCSERSWILD = 21589;
		enum TIOCGLCKTRMIOS = 21590;
		enum TIOCSLCKTRMIOS = 21591;
		enum TIOCSERGSTRUCT = 21592;
		enum TIOCSERGETLSR = 21593;
		enum TIOCSERGETMULTI = 21594;
		enum TIOCSERSETMULTI = 21595;
		enum TIOCMIWAIT = 21596;
		enum TIOCGICOUNT = 21597;
		enum FIOQSIZE = 21600;
		enum TIOCPKT_DATA = 0;
		enum TIOCPKT_FLUSHREAD = 1;
		enum TIOCPKT_FLUSHWRITE = 2;
		enum TIOCPKT_STOP = 4;
		enum TIOCPKT_START = 8;
		enum TIOCPKT_NOSTOP = 16;
		enum TIOCPKT_DOSTOP = 32;
		enum TIOCPKT_IOCTL = 64;
		enum TIOCSER_TEMT = 1;
		enum SIOCADDRT = 35083;
		enum SIOCDELRT = 35084;
		enum SIOCRTMSG = 35085;
		enum SIOCGIFNAME = 35088;
		enum SIOCSIFLINK = 35089;
		enum SIOCGIFCONF = 35090;
		enum SIOCGIFFLAGS = 35091;
		enum SIOCSIFFLAGS = 35092;
		enum SIOCGIFADDR = 35093;
		enum SIOCSIFADDR = 35094;
		enum SIOCGIFDSTADDR = 35095;
		enum SIOCSIFDSTADDR = 35096;
		enum SIOCGIFBRDADDR = 35097;
		enum SIOCSIFBRDADDR = 35098;
		enum SIOCGIFNETMASK = 35099;
		enum SIOCSIFNETMASK = 35100;
		enum SIOCGIFMETRIC = 35101;
		enum SIOCSIFMETRIC = 35102;
		enum SIOCGIFMEM = 35103;
		enum SIOCSIFMEM = 35104;
		enum SIOCGIFMTU = 35105;
		enum SIOCSIFMTU = 35106;
		enum SIOCSIFNAME = 35107;
		enum SIOCSIFHWADDR = 35108;
		enum SIOCGIFENCAP = 35109;
		enum SIOCSIFENCAP = 35110;
		enum SIOCGIFHWADDR = 35111;
		enum SIOCGIFSLAVE = 35113;
		enum SIOCSIFSLAVE = 35120;
		enum SIOCADDMULTI = 35121;
		enum SIOCDELMULTI = 35122;
		enum SIOCGIFINDEX = 35123;
		enum SIOGIFINDEX = SIOCGIFINDEX;
		enum SIOCSIFPFLAGS = 35124;
		enum SIOCGIFPFLAGS = 35125;
		enum SIOCDIFADDR = 35126;
		enum SIOCSIFHWBROADCAST = 35127;
		enum SIOCGIFCOUNT = 35128;
		enum SIOCGIFBR = 35136;
		enum SIOCSIFBR = 35137;
		enum SIOCGIFTXQLEN = 35138;
		enum SIOCSIFTXQLEN = 35139;
		enum SIOCDARP = 35155;
		enum SIOCGARP = 35156;
		enum SIOCSARP = 35157;
		enum SIOCDRARP = 35168;
		enum SIOCGRARP = 35169;
		enum SIOCSRARP = 35170;
		enum SIOCGIFMAP = 35184;
		enum SIOCSIFMAP = 35185;
		enum SIOCADDDLCI = 35200;
		enum SIOCDELDLCI = 35201;
		enum SIOCDEVPRIVATE = 35312;
		enum SIOCPROTOPRIVATE = 35296;
		int ioctl(int __fd, c_ulong __request, ...);
	}
	else
	{
		version (OSX)
		{
			import core.sys.posix.termios;
			import core.sys.posix.sys.time;
			struct winsize
			{
				ushort ws_row;
				ushort ws_col;
				ushort ws_xpixel;
				ushort ws_ypixel;
			}
			struct ttysize
			{
				ushort ts_lines;
				ushort ts_cols;
				ushort ts_xxx;
				ushort ts_yyy;
			}
			int ioctl(int fildes, c_ulong request, ...);
		}
		else
		{
			version (FreeBSD)
			{
				struct fiodgname_arg
				{
					int len;
					void* buf;
				}
				struct winsize
				{
					ushort ws_row;
					ushort ws_col;
					ushort ws_xpixel;
					ushort ws_ypixel;
				}
				int ioctl(int, c_ulong, ...);
			}
			else
			{
				version (Solaris)
				{
					int ioctl(int fildes, int request, ...);
				}
				else
				{
					static assert(false,"Unsupported platform");
				}
			}
		}
	}



}
