diff options
Diffstat (limited to 'Lib/plat-linux2')
-rw-r--r-- | Lib/plat-linux2/FCNTL.py | 11 | ||||
-rw-r--r-- | Lib/plat-linux2/IN.py | 72 | ||||
-rw-r--r-- | Lib/plat-linux2/SOCKET.py | 22 | ||||
-rw-r--r-- | Lib/plat-linux2/TERMIOS.py | 192 |
4 files changed, 215 insertions, 82 deletions
diff --git a/Lib/plat-linux2/FCNTL.py b/Lib/plat-linux2/FCNTL.py index f65c4fa..0058aba 100644 --- a/Lib/plat-linux2/FCNTL.py +++ b/Lib/plat-linux2/FCNTL.py @@ -35,12 +35,18 @@ def __STRING(x): return "x" # Included from sys/types.h # Included from linux/types.h -__FD_SETSIZE = 256 -# Included from asm/types.h +# Included from linux/posix_types.h +__FD_SETSIZE = 1024 +def __FDELT(d): return ((d) / __NFDBITS) + + +# Included from asm/posix_types.h def __FD_ZERO(fdsetp): return \ +# Included from asm/types.h + # Included from sys/bitypes.h # Included from gnu/types.h @@ -94,6 +100,7 @@ LOCK_NB = 4 LOCK_UN = 8 F_POSIX = 1 F_FLOCK = 2 +F_BROKEN = 4 FNDELAY = O_NDELAY F_ULOCK = 0 F_LOCK = 1 diff --git a/Lib/plat-linux2/IN.py b/Lib/plat-linux2/IN.py index 86710d1..1f49f01 100644 --- a/Lib/plat-linux2/IN.py +++ b/Lib/plat-linux2/IN.py @@ -36,6 +36,8 @@ def __STRING(x): return "x" # Included from linux/socket.h # Included from asm/socket.h + +# Included from asm/sockios.h FIOSETOWN = 0x8901 SIOCSPGRP = 0x8902 FIOGETOWN = 0x8903 @@ -56,6 +58,7 @@ SO_OOBINLINE = 10 SO_NO_CHECK = 11 SO_PRIORITY = 12 SO_LINGER = 13 +SO_BSDCOMPAT = 14 # Included from linux/sockios.h SIOCADDRT = 0x890B @@ -87,6 +90,8 @@ SIOCGIFSLAVE = 0x8929 SIOCSIFSLAVE = 0x8930 SIOCADDMULTI = 0x8931 SIOCDELMULTI = 0x8932 +SIOCGIFBR = 0x8940 +SIOCSIFBR = 0x8941 OLD_SIOCDARP = 0x8950 OLD_SIOCGARP = 0x8951 OLD_SIOCSARP = 0x8952 @@ -98,11 +103,14 @@ SIOCGRARP = 0x8961 SIOCSRARP = 0x8962 SIOCGIFMAP = 0x8970 SIOCSIFMAP = 0x8971 +SIOCADDDLCI = 0x8980 +SIOCDELDLCI = 0x8981 SIOCDEVPRIVATE = 0x89F0 SIOCPROTOPRIVATE = 0x89E0 # Included from linux/uio.h -MAX_IOVEC = 8 +UIO_MAXIOV = 16 +SCM_RIGHTS = 1 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 @@ -137,6 +145,7 @@ SOMAXCONN = 128 MSG_OOB = 1 MSG_PEEK = 2 MSG_DONTROUTE = 4 +MSG_PROXY = 16 SOL_IP = 0 SOL_IPX = 256 SOL_AX25 = 257 @@ -148,6 +157,7 @@ IP_TOS = 1 IPTOS_LOWDELAY = 0x10 IPTOS_THROUGHPUT = 0x08 IPTOS_RELIABILITY = 0x04 +IPTOS_MINCOST = 0x02 IP_TTL = 2 IP_HDRINCL = 3 IP_OPTIONS = 4 @@ -169,12 +179,18 @@ SOPRI_BACKGROUND = 2 # Included from sys/types.h # Included from linux/types.h -__FD_SETSIZE = 256 -# Included from asm/types.h +# Included from linux/posix_types.h +__FD_SETSIZE = 1024 +def __FDELT(d): return ((d) / __NFDBITS) + + +# Included from asm/posix_types.h def __FD_ZERO(fdsetp): return \ +# Included from asm/types.h + # Included from sys/bitypes.h # Included from pthread/mit/posix.h @@ -204,7 +220,6 @@ IN_CLASSC_HOST = (0xffffffff & ~IN_CLASSC_NET) def IN_MULTICAST(a): return IN_CLASSD(a) IN_MULTICAST_NET = 0xF0000000 -INADDR_NONE = 0xffffffff IN_LOOPBACKNET = 127 INADDR_LOOPBACK = 0x7f000001 INADDR_UNSPEC_GROUP = 0xe0000000 @@ -213,6 +228,55 @@ INADDR_MAX_LOCAL_GROUP = 0xe00000ff # Included from asm/byteorder.h __LITTLE_ENDIAN = 1234 + +# Included from linux/config.h + +# Included from linux/autoconf.h +CONFIG_MODULES = 1 +CONFIG_KERNELD = 1 +CONFIG_NET = 1 +CONFIG_PCI = 1 +CONFIG_SYSVIPC = 1 +CONFIG_BINFMT_AOUT = 1 +CONFIG_BINFMT_ELF = 1 +CONFIG_KERNEL_ELF = 1 +CONFIG_M586 = 1 +CONFIG_BLK_DEV_FD = 1 +CONFIG_BLK_DEV_IDE = 1 +CONFIG_BLK_DEV_IDECD = 1 +CONFIG_INET = 1 +CONFIG_IP_NOSR = 1 +CONFIG_SKB_LARGE = 1 +CONFIG_SCSI = 1 +CONFIG_BLK_DEV_SD = 1 +CONFIG_BLK_DEV_SR = 1 +CONFIG_SCSI_AHA152X = 1 +CONFIG_NETDEVICES = 1 +CONFIG_DUMMY_MODULE = 1 +CONFIG_NET_ETHERNET = 1 +CONFIG_NET_VENDOR_3COM = 1 +CONFIG_EL3 = 1 +CONFIG_EXT2_FS = 1 +CONFIG_FAT_FS_MODULE = 1 +CONFIG_MSDOS_FS_MODULE = 1 +CONFIG_VFAT_FS_MODULE = 1 +CONFIG_PROC_FS = 1 +CONFIG_NFS_FS_MODULE = 1 +CONFIG_ISO9660_FS_MODULE = 1 +CONFIG_SERIAL = 1 +CONFIG_MOUSE = 1 +CONFIG_PSMOUSE = 1 +UTS_SYSNAME = "Linux" +UTS_MACHINE = "unknown" +UTS_NODENAME = "(none)" +UTS_DOMAINNAME = "(none)" +DEF_INITSEG = 0x9000 +DEF_SYSSEG = 0x1000 +DEF_SETUPSEG = 0x9020 +DEF_SYSSIZE = 0x7F00 +NORMAL_VGA = 0xffff +EXTENDED_VGA = 0xfffe +ASK_VGA = 0xfffd def __constant_ntohl(x): return \ def __constant_ntohs(x): return \ diff --git a/Lib/plat-linux2/SOCKET.py b/Lib/plat-linux2/SOCKET.py index 71077c3..90c5406 100644 --- a/Lib/plat-linux2/SOCKET.py +++ b/Lib/plat-linux2/SOCKET.py @@ -33,6 +33,8 @@ def __STRING(x): return "x" # Included from linux/socket.h # Included from asm/socket.h + +# Included from asm/sockios.h FIOSETOWN = 0x8901 SIOCSPGRP = 0x8902 FIOGETOWN = 0x8903 @@ -53,6 +55,7 @@ SO_OOBINLINE = 10 SO_NO_CHECK = 11 SO_PRIORITY = 12 SO_LINGER = 13 +SO_BSDCOMPAT = 14 # Included from linux/sockios.h SIOCADDRT = 0x890B @@ -84,6 +87,8 @@ SIOCGIFSLAVE = 0x8929 SIOCSIFSLAVE = 0x8930 SIOCADDMULTI = 0x8931 SIOCDELMULTI = 0x8932 +SIOCGIFBR = 0x8940 +SIOCSIFBR = 0x8941 OLD_SIOCDARP = 0x8950 OLD_SIOCGARP = 0x8951 OLD_SIOCSARP = 0x8952 @@ -95,11 +100,14 @@ SIOCGRARP = 0x8961 SIOCSRARP = 0x8962 SIOCGIFMAP = 0x8970 SIOCSIFMAP = 0x8971 +SIOCADDDLCI = 0x8980 +SIOCDELDLCI = 0x8981 SIOCDEVPRIVATE = 0x89F0 SIOCPROTOPRIVATE = 0x89E0 # Included from linux/uio.h -MAX_IOVEC = 8 +UIO_MAXIOV = 16 +SCM_RIGHTS = 1 SOCK_STREAM = 1 SOCK_DGRAM = 2 SOCK_RAW = 3 @@ -134,6 +142,7 @@ SOMAXCONN = 128 MSG_OOB = 1 MSG_PEEK = 2 MSG_DONTROUTE = 4 +MSG_PROXY = 16 SOL_IP = 0 SOL_IPX = 256 SOL_AX25 = 257 @@ -145,6 +154,7 @@ IP_TOS = 1 IPTOS_LOWDELAY = 0x10 IPTOS_THROUGHPUT = 0x08 IPTOS_RELIABILITY = 0x04 +IPTOS_MINCOST = 0x02 IP_TTL = 2 IP_HDRINCL = 3 IP_OPTIONS = 4 @@ -166,12 +176,18 @@ SOPRI_BACKGROUND = 2 # Included from sys/types.h # Included from linux/types.h -__FD_SETSIZE = 256 -# Included from asm/types.h +# Included from linux/posix_types.h +__FD_SETSIZE = 1024 +def __FDELT(d): return ((d) / __NFDBITS) + + +# Included from asm/posix_types.h def __FD_ZERO(fdsetp): return \ +# Included from asm/types.h + # Included from sys/bitypes.h # Included from pthread/mit/posix.h diff --git a/Lib/plat-linux2/TERMIOS.py b/Lib/plat-linux2/TERMIOS.py index 4b17df6..14bb226 100644 --- a/Lib/plat-linux2/TERMIOS.py +++ b/Lib/plat-linux2/TERMIOS.py @@ -33,76 +33,25 @@ def __STRING(x): return "x" # Included from sys/types.h # Included from linux/types.h -__FD_SETSIZE = 256 -# Included from asm/types.h +# Included from linux/posix_types.h +__FD_SETSIZE = 1024 +def __FDELT(d): return ((d) / __NFDBITS) + + +# Included from asm/posix_types.h def __FD_ZERO(fdsetp): return \ +# Included from asm/types.h + # Included from sys/bitypes.h # Included from linux/termios.h # Included from asm/termios.h -TCGETS = 0x5401 -TCSETS = 0x5402 -TCSETSW = 0x5403 -TCSETSF = 0x5404 -TCGETA = 0x5405 -TCSETA = 0x5406 -TCSETAW = 0x5407 -TCSETAF = 0x5408 -TCSBRK = 0x5409 -TCXONC = 0x540A -TCFLSH = 0x540B -TIOCEXCL = 0x540C -TIOCNXCL = 0x540D -TIOCSCTTY = 0x540E -TIOCGPGRP = 0x540F -TIOCSPGRP = 0x5410 -TIOCOUTQ = 0x5411 -TIOCSTI = 0x5412 -TIOCGWINSZ = 0x5413 -TIOCSWINSZ = 0x5414 -TIOCMGET = 0x5415 -TIOCMBIS = 0x5416 -TIOCMBIC = 0x5417 -TIOCMSET = 0x5418 -TIOCGSOFTCAR = 0x5419 -TIOCSSOFTCAR = 0x541A -FIONREAD = 0x541B -TIOCINQ = FIONREAD -TIOCLINUX = 0x541C -TIOCCONS = 0x541D -TIOCGSERIAL = 0x541E -TIOCSSERIAL = 0x541F -TIOCPKT = 0x5420 -FIONBIO = 0x5421 -TIOCNOTTY = 0x5422 -TIOCSETD = 0x5423 -TIOCGETD = 0x5424 -TCSBRKP = 0x5425 -TIOCTTYGSTRUCT = 0x5426 -FIONCLEX = 0x5450 -FIOCLEX = 0x5451 -FIOASYNC = 0x5452 -TIOCSERCONFIG = 0x5453 -TIOCSERGWILD = 0x5454 -TIOCSERSWILD = 0x5455 -TIOCGLCKTRMIOS = 0x5456 -TIOCSLCKTRMIOS = 0x5457 -TIOCSERGSTRUCT = 0x5458 -TIOCSERGETLSR = 0x5459 -TIOCSERGETMULTI = 0x545A -TIOCSERSETMULTI = 0x545B -TIOCPKT_DATA = 0 -TIOCPKT_FLUSHREAD = 1 -TIOCPKT_FLUSHWRITE = 2 -TIOCPKT_STOP = 4 -TIOCPKT_START = 8 -TIOCPKT_NOSTOP = 16 -TIOCPKT_DOSTOP = 32 -NCC = 8 + +# Included from asm/termbits.h NCCS = 19 VINTR = 0 VQUIT = 1 @@ -121,7 +70,6 @@ VDISCARD = 13 VWERASE = 14 VLNEXT = 15 VEOL2 = 16 -INIT_C_CC = "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" IGNBRK = 0000001 BRKINT = 0000002 IGNPAR = 0000004 @@ -201,6 +149,7 @@ CBAUDEX = 0010000 B57600 = 0010001 B115200 = 0010002 B230400 = 0010003 +B460800 = 0010004 CIBAUD = 002003600000 CRTSCTS = 020000000000 ISIG = 0000001 @@ -218,6 +167,105 @@ ECHOKE = 0004000 FLUSHO = 0010000 PENDIN = 0040000 IEXTEN = 0100000 +TCOOFF = 0 +TCOON = 1 +TCIOFF = 2 +TCION = 3 +TCIFLUSH = 0 +TCOFLUSH = 1 +TCIOFLUSH = 2 +TCSANOW = 0 +TCSADRAIN = 1 +TCSAFLUSH = 2 + +# Included from asm/ioctls.h + +# Included from asm/ioctl.h +_IOC_NRBITS = 8 +_IOC_TYPEBITS = 8 +_IOC_SIZEBITS = 14 +_IOC_DIRBITS = 2 +_IOC_NRMASK = ((1 << _IOC_NRBITS)-1) +_IOC_TYPEMASK = ((1 << _IOC_TYPEBITS)-1) +_IOC_SIZEMASK = ((1 << _IOC_SIZEBITS)-1) +_IOC_DIRMASK = ((1 << _IOC_DIRBITS)-1) +_IOC_NRSHIFT = 0 +_IOC_TYPESHIFT = (_IOC_NRSHIFT+_IOC_NRBITS) +_IOC_SIZESHIFT = (_IOC_TYPESHIFT+_IOC_TYPEBITS) +_IOC_DIRSHIFT = (_IOC_SIZESHIFT+_IOC_SIZEBITS) +def _IOC_DIR(nr): return (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) + +def _IOC_TYPE(nr): return (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) + +def _IOC_NR(nr): return (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) + +def _IOC_SIZE(nr): return (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) + +IOCSIZE_MASK = (_IOC_SIZEMASK << _IOC_SIZESHIFT) +IOCSIZE_SHIFT = (_IOC_SIZESHIFT) +TCGETS = 0x5401 +TCSETS = 0x5402 +TCSETSW = 0x5403 +TCSETSF = 0x5404 +TCGETA = 0x5405 +TCSETA = 0x5406 +TCSETAW = 0x5407 +TCSETAF = 0x5408 +TCSBRK = 0x5409 +TCXONC = 0x540A +TCFLSH = 0x540B +TIOCEXCL = 0x540C +TIOCNXCL = 0x540D +TIOCSCTTY = 0x540E +TIOCGPGRP = 0x540F +TIOCSPGRP = 0x5410 +TIOCOUTQ = 0x5411 +TIOCSTI = 0x5412 +TIOCGWINSZ = 0x5413 +TIOCSWINSZ = 0x5414 +TIOCMGET = 0x5415 +TIOCMBIS = 0x5416 +TIOCMBIC = 0x5417 +TIOCMSET = 0x5418 +TIOCGSOFTCAR = 0x5419 +TIOCSSOFTCAR = 0x541A +FIONREAD = 0x541B +TIOCINQ = FIONREAD +TIOCLINUX = 0x541C +TIOCCONS = 0x541D +TIOCGSERIAL = 0x541E +TIOCSSERIAL = 0x541F +TIOCPKT = 0x5420 +FIONBIO = 0x5421 +TIOCNOTTY = 0x5422 +TIOCSETD = 0x5423 +TIOCGETD = 0x5424 +TCSBRKP = 0x5425 +TIOCTTYGSTRUCT = 0x5426 +FIONCLEX = 0x5450 +FIOCLEX = 0x5451 +FIOASYNC = 0x5452 +TIOCSERCONFIG = 0x5453 +TIOCSERGWILD = 0x5454 +TIOCSERSWILD = 0x5455 +TIOCGLCKTRMIOS = 0x5456 +TIOCSLCKTRMIOS = 0x5457 +TIOCSERGSTRUCT = 0x5458 +TIOCSERGETLSR = 0x5459 +TIOCSERGETMULTI = 0x545A +TIOCSERSETMULTI = 0x545B +TIOCMIWAIT = 0x545C +TIOCGICOUNT = 0x545D +TIOCPKT_DATA = 0 +TIOCPKT_FLUSHREAD = 1 +TIOCPKT_FLUSHWRITE = 2 +TIOCPKT_STOP = 4 +TIOCPKT_START = 8 +TIOCPKT_NOSTOP = 16 +TIOCPKT_DOSTOP = 32 +TIOCSER_TEMT = 0x01 +NCC = 8 +INIT_C_CC = "\003\034\177\025\004\0\1\0\021\023\032\0\022\017\027\026\0" TIOCM_LE = 0x001 TIOCM_DTR = 0x002 TIOCM_RTS = 0x004 @@ -229,21 +277,19 @@ TIOCM_RNG = 0x080 TIOCM_DSR = 0x100 TIOCM_CD = TIOCM_CAR TIOCM_RI = TIOCM_RNG -TIOCSER_TEMT = 0x01 -TCOOFF = 0 -TCOON = 1 -TCIOFF = 2 -TCION = 3 -TCIFLUSH = 0 -TCOFLUSH = 1 -TCIOFLUSH = 2 -TCSANOW = 0 -TCSADRAIN = 1 -TCSAFLUSH = 2 N_TTY = 0 N_SLIP = 1 N_MOUSE = 2 N_PPP = 3 +N_STRIP = 4 + +# Included from linux/string.h + +# Included from asm/string.h +def COMMON(x): return \ + +def COMMON(x): return \ + def CTRL(ch): return ((ch)&0x1F) IBSHIFT = 16 |