const ioctls = Tuple{String,Char,Int64,Int64,Any}[
   ("TCGETS", 'T', 1, 0, Any[("c_iflag", UInt32, 0), ("c_oflag", UInt32, 4), ("c_cflag", UInt32, 8), ("c_lflag", UInt32, 12), ("c_line", UInt8, 16)])
   ("TCSETS", 'T', 2, 0, nothing)
   ("TCSETSW", 'T', 3, 0, nothing)
   ("TCSETSF", 'T', 4, 0, nothing)
   ("TCGETA", 'T', 5, 0, nothing)
   ("TCSETA", 'T', 6, 0, nothing)
   ("TCSETAW", 'T', 7, 0, nothing)
   ("TCSETAF", 'T', 8, 0, nothing)
   ("TCSBRK", 'T', 9, 0, nothing)
   ("TCXONC", 'T', 10, 0, nothing)
   ("TCFLSH", 'T', 11, 0, nothing)
   ("TIOCEXCL", 'T', 12, 0, nothing)
   ("TIOCNXCL", 'T', 13, 0, nothing)
   ("TIOCSCTTY", 'T', 14, 0, nothing)
   ("TIOCGPGRP", 'T', 15, 0, nothing)
   ("TIOCSPGRP", 'T', 16, 0, nothing)
   ("TIOCOUTQ", 'T', 17, 0, nothing)
   ("TIOCSTI", 'T', 18, 0, nothing)
   ("TIOCGWINSZ", 'T', 19, 0, Any[("ws_row", UInt16, 0), ("ws_col", UInt16, 2), ("ws_xpixel", UInt16, 4), ("ws_ypixel", UInt16, 6)])
   ("TIOCSWINSZ", 'T', 20, 0, nothing)
   ("TIOCMGET", 'T', 21, 0, nothing)
   ("TIOCMBIS", 'T', 22, 0, nothing)
   ("TIOCMBIC", 'T', 23, 0, nothing)
   ("TIOCMSET", 'T', 24, 0, nothing)
   ("TIOCGSOFTCAR", 'T', 25, 0, nothing)
   ("TIOCSSOFTCAR", 'T', 26, 0, nothing)
   ("FIONREAD", 'T', 27, 0, nothing)
   ("TIOCLINUX", 'T', 28, 0, nothing)
   ("TIOCCONS", 'T', 29, 0, nothing)
   ("TIOCGSERIAL", 'T', 30, 0, nothing)
   ("TIOCSSERIAL", 'T', 31, 0, nothing)
   ("TIOCPKT", 'T', 32, 0, nothing)
   ("FIONBIO", 'T', 33, 0, nothing)
   ("TIOCNOTTY", 'T', 34, 0, nothing)
   ("TIOCSETD", 'T', 35, 0, nothing)
   ("TIOCGETD", 'T', 36, 0, nothing)
   ("TCSBRKP", 'T', 37, 0, nothing)
   ("TIOCSBRK", 'T', 39, 0, nothing)
   ("TIOCCBRK", 'T', 40, 0, nothing)
   ("TIOCGSID", 'T', 41, 0, nothing)
   ("TCGETS2", 'T', 42, 0, Any[("c_iflag", UInt32, 0), ("c_oflag", UInt32, 4), ("c_cflag", UInt32, 8), ("c_lflag", UInt32, 12), ("c_line", UInt8, 16), ("c_ispeed", UInt32, 36), ("c_ospeed", UInt32, 40)])
   ("TCSETS2", 'T', 43, 0, Any[("c_iflag", UInt32, 0), ("c_oflag", UInt32, 4), ("c_cflag", UInt32, 8), ("c_lflag", UInt32, 12), ("c_line", UInt8, 16), ("c_ispeed", UInt32, 36), ("c_ospeed", UInt32, 40)])
   ("TCSETSW2", 'T', 44, 0, Any[("c_iflag", UInt32, 0), ("c_oflag", UInt32, 4), ("c_cflag", UInt32, 8), ("c_lflag", UInt32, 12), ("c_line", UInt8, 16), ("c_ispeed", UInt32, 36), ("c_ospeed", UInt32, 40)])
   ("TCSETSF2", 'T', 45, 0, Any[("c_iflag", UInt32, 0), ("c_oflag", UInt32, 4), ("c_cflag", UInt32, 8), ("c_lflag", UInt32, 12), ("c_line", UInt8, 16), ("c_ispeed", UInt32, 36), ("c_ospeed", UInt32, 40)])
   ("TIOCGRS485", 'T', 46, 0, nothing)
   ("TIOCSRS485", 'T', 47, 0, nothing)
   ("TIOCGPTN", 'T', 48, 0, nothing)
   ("TIOCSPTLCK", 'T', 49, 0, nothing)
   ("TIOCGDEV", 'T', 50, 0, nothing)
   ("TCGETX", 'T', 50, 0, nothing)
   ("TCSETX", 'T', 51, 0, nothing)
   ("TCSETXF", 'T', 52, 0, nothing)
   ("TCSETXW", 'T', 53, 0, nothing)
   ("TIOCSIG", 'T', 54, 0, nothing)
   ("TIOCVHANGUP", 'T', 55, 0, nothing)
   ("TIOCGPKT", 'T', 56, 0, nothing)
   ("TIOCGPTLCK", 'T', 57, 0, nothing)
   ("TIOCGEXCL", 'T', 64, 0, nothing)
   ("FIONCLEX", 'T', 80, 0, nothing)
   ("FIOCLEX", 'T', 81, 0, nothing)
   ("FIOASYNC", 'T', 82, 0, nothing)
   ("TIOCSERCONFIG", 'T', 83, 0, nothing)
   ("TIOCSERGWILD", 'T', 84, 0, nothing)
   ("TIOCSERSWILD", 'T', 85, 0, nothing)
   ("TIOCGLCKTRMIOS", 'T', 86, 0, nothing)
   ("TIOCSLCKTRMIOS", 'T', 87, 0, nothing)
   ("TIOCSERGSTRUCT", 'T', 88, 0, nothing)
   ("TIOCSERGETLSR", 'T', 89, 0, nothing)
   ("TIOCSERGETMULTI", 'T', 90, 0, nothing)
   ("TIOCSERSETMULTI", 'T', 91, 0, nothing)
   ("TIOCMIWAIT", 'T', 92, 0, nothing)
   ("TIOCGICOUNT", 'T', 93, 0, nothing)
   ("FIOQSIZE", 'T', 96, 0, nothing)
   ("USBDEVFS_CONTROL", 'U', 0, 0, Any[("bRequestType", UInt8, 0), ("bRequest", UInt8, 1), ("wValue", UInt16, 2), ("wIndex", UInt16, 4), ("wLength", UInt16, 6), ("timeout", UInt32, 8), ("data", Ptr{Void}, 16)])
   ("USBDEVFS_CONTROL32", 'U', 0, 0, nothing)
   ("USBDEVFS_BULK32", 'U', 2, 0, nothing)
   ("USBDEVFS_BULK", 'U', 2, 0, Any[("ep", UInt32, 0), ("len", UInt32, 4), ("timeout", UInt32, 8), ("data", Ptr{Void}, 16)])
   ("USBDEVFS_RESETEP", 'U', 3, 0, nothing)
   ("USBDEVFS_SETINTERFACE", 'U', 4, 0, Any[("interface", UInt32, 0), ("altsetting", UInt32, 4)])
   ("USBDEVFS_SETCONFIGURATION", 'U', 5, 0, nothing)
   ("USBDEVFS_GETDRIVER", 'U', 8, 0, Any[("interface", UInt32, 0)])
   ("USBDEVFS_SUBMITURB", 'U', 10, 0, Any[("type", UInt8, 0), ("endpoint", UInt8, 1), ("status", Int32, 4), ("flags", UInt32, 8), ("buffer", Ptr{Void}, 16), ("buffer_length", Int32, 24), ("actual_length", Int32, 28), ("start_frame", Int32, 32), ("error_count", Int32, 40), ("signr", UInt32, 44), ("usercontext", Ptr{Void}, 48)])
   ("USBDEVFS_SUBMITURB32", 'U', 10, 0, nothing)
   ("USBDEVFS_DISCARDURB", 'U', 11, 0, nothing)
   ("USBDEVFS_REAPURB32", 'U', 12, 0, nothing)
   ("USBDEVFS_REAPURB", 'U', 12, 0, nothing)
   ("USBDEVFS_REAPURBNDELAY", 'U', 13, 0, nothing)
   ("USBDEVFS_REAPURBNDELAY32", 'U', 13, 0, nothing)
   ("USBDEVFS_DISCSIGNAL", 'U', 14, 0, Any[("signr", UInt32, 0), ("context", Ptr{Void}, 8)])
   ("USBDEVFS_DISCSIGNAL32", 'U', 14, 0, nothing)
   ("USBDEVFS_CLAIMINTERFACE", 'U', 15, 0, nothing)
   ("USBDEVFS_RELEASEINTERFACE", 'U', 16, 0, nothing)
   ("USBDEVFS_CONNECTINFO", 'U', 17, 0, Any[("devnum", UInt32, 0), ("slow", UInt8, 4)])
   ("USBDEVFS_IOCTL32", 'U', 18, 0, nothing)
   ("USBDEVFS_IOCTL", 'U', 18, 0, Any[("ifno", Int32, 0), ("ioctl_code", Int32, 4), ("data", Ptr{Void}, 8)])
   ("USBDEVFS_HUB_PORTINFO", 'U', 19, 0, Any[("nports", UInt8, 0)])
   ("USBDEVFS_RESET", 'U', 20, 0, nothing)
   ("USBDEVFS_CLEAR_HALT", 'U', 21, 0, nothing)
   ("USBDEVFS_DISCONNECT", 'U', 22, 0, nothing)
   ("USBDEVFS_CONNECT", 'U', 23, 0, nothing)
   ("USBDEVFS_CLAIM_PORT", 'U', 24, 0, nothing)
   ("USBDEVFS_RELEASE_PORT", 'U', 25, 0, nothing)
   ("USBDEVFS_GET_CAPABILITIES", 'U', 26, 0, nothing)
   ("USBDEVFS_DISCONNECT_CLAIM", 'U', 27, 0, Any[("interface", UInt32, 0), ("flags", UInt32, 4)])
   ("USBDEVFS_ALLOC_STREAMS", 'U', 28, 0, Any[("num_streams", UInt32, 0), ("num_eps", UInt32, 4)])
   ("USBDEVFS_FREE_STREAMS", 'U', 29, 0, Any[("num_streams", UInt32, 0), ("num_eps", UInt32, 4)])
   ("USBDEVFS_DROP_PRIVILEGES", 'U', 30, 0, nothing)
]
