summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-07-22 21:50:43 (GMT)
committerGuido van Rossum <guido@python.org>1996-07-22 21:50:43 (GMT)
commit77c29a17342c66dc603660230dd47f6fd07a44c9 (patch)
treedd7d9e247e1fcac0c36fe54f72267e41c1c3fe1f /Lib
parent56b6fa98b6202e94b8965ea5bcc4c78c0aab8683 (diff)
downloadcpython-77c29a17342c66dc603660230dd47f6fd07a44c9.zip
cpython-77c29a17342c66dc603660230dd47f6fd07a44c9.tar.gz
cpython-77c29a17342c66dc603660230dd47f6fd07a44c9.tar.bz2
This is needed for users of Linux 2.x
Diffstat (limited to 'Lib')
-rwxr-xr-xLib/linux2/FCNTL.py101
-rwxr-xr-xLib/linux2/IN.py239
-rwxr-xr-xLib/linux2/SOCKET.py183
-rwxr-xr-xLib/linux2/TERMIOS.py270
-rwxr-xr-xLib/linux2/regen11
-rw-r--r--Lib/plat-linux2/FCNTL.py101
-rw-r--r--Lib/plat-linux2/IN.py239
-rw-r--r--Lib/plat-linux2/SOCKET.py183
-rw-r--r--Lib/plat-linux2/TERMIOS.py270
-rwxr-xr-xLib/plat-linux2/regen11
10 files changed, 1608 insertions, 0 deletions
diff --git a/Lib/linux2/FCNTL.py b/Lib/linux2/FCNTL.py
new file mode 100755
index 0000000..f65c4fa
--- /dev/null
+++ b/Lib/linux2/FCNTL.py
@@ -0,0 +1,101 @@
+# Generated by h2py from /usr/include/sys/fcntl.h
+
+# Included from fcntl.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from gnu/types.h
+_GNU_TYPES_H = 1
+__FDSET_LONGS = 8
+def __FD_ZERO(fdsetp): return \
+
+__FD_SETSIZE = 256
+def __FDELT(d): return ((d) / __NFDBITS)
+
+def __FDMASK(d): return (1 << ((d) % __NFDBITS))
+
+def __FD_ZERO(set): return \
+
+
+# Included from linux/fcntl.h
+
+# Included from asm/fcntl.h
+O_ACCMODE = 0003
+O_RDONLY = 00
+O_WRONLY = 01
+O_RDWR = 02
+O_CREAT = 0100
+O_EXCL = 0200
+O_NOCTTY = 0400
+O_TRUNC = 01000
+O_APPEND = 02000
+O_NONBLOCK = 04000
+O_NDELAY = O_NONBLOCK
+O_SYNC = 010000
+FASYNC = 020000
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 5
+F_SETLK = 6
+F_SETLKW = 7
+F_SETOWN = 8
+F_GETOWN = 9
+FD_CLOEXEC = 1
+F_RDLCK = 0
+F_WRLCK = 1
+F_UNLCK = 2
+F_EXLCK = 4
+F_SHLCK = 8
+LOCK_SH = 1
+LOCK_EX = 2
+LOCK_NB = 4
+LOCK_UN = 8
+F_POSIX = 1
+F_FLOCK = 2
+FNDELAY = O_NDELAY
+F_ULOCK = 0
+F_LOCK = 1
+F_TLOCK = 2
+F_TEST = 3
diff --git a/Lib/linux2/IN.py b/Lib/linux2/IN.py
new file mode 100755
index 0000000..86710d1
--- /dev/null
+++ b/Lib/linux2/IN.py
@@ -0,0 +1,239 @@
+# Generated by h2py from /usr/include/netinet/in.h
+_NETINET_IN_H = 1
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/socket.h
+
+# Included from linux/socket.h
+
+# Included from asm/socket.h
+FIOSETOWN = 0x8901
+SIOCSPGRP = 0x8902
+FIOGETOWN = 0x8903
+SIOCGPGRP = 0x8904
+SIOCATMARK = 0x8905
+SIOCGSTAMP = 0x8906
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_TYPE = 3
+SO_ERROR = 4
+SO_DONTROUTE = 5
+SO_BROADCAST = 6
+SO_SNDBUF = 7
+SO_RCVBUF = 8
+SO_KEEPALIVE = 9
+SO_OOBINLINE = 10
+SO_NO_CHECK = 11
+SO_PRIORITY = 12
+SO_LINGER = 13
+
+# Included from linux/sockios.h
+SIOCADDRT = 0x890B
+SIOCDELRT = 0x890C
+SIOCGIFNAME = 0x8910
+SIOCSIFLINK = 0x8911
+SIOCGIFCONF = 0x8912
+SIOCGIFFLAGS = 0x8913
+SIOCSIFFLAGS = 0x8914
+SIOCGIFADDR = 0x8915
+SIOCSIFADDR = 0x8916
+SIOCGIFDSTADDR = 0x8917
+SIOCSIFDSTADDR = 0x8918
+SIOCGIFBRDADDR = 0x8919
+SIOCSIFBRDADDR = 0x891a
+SIOCGIFNETMASK = 0x891b
+SIOCSIFNETMASK = 0x891c
+SIOCGIFMETRIC = 0x891d
+SIOCSIFMETRIC = 0x891e
+SIOCGIFMEM = 0x891f
+SIOCSIFMEM = 0x8920
+SIOCGIFMTU = 0x8921
+SIOCSIFMTU = 0x8922
+SIOCSIFHWADDR = 0x8924
+SIOCGIFENCAP = 0x8925
+SIOCSIFENCAP = 0x8926
+SIOCGIFHWADDR = 0x8927
+SIOCGIFSLAVE = 0x8929
+SIOCSIFSLAVE = 0x8930
+SIOCADDMULTI = 0x8931
+SIOCDELMULTI = 0x8932
+OLD_SIOCDARP = 0x8950
+OLD_SIOCGARP = 0x8951
+OLD_SIOCSARP = 0x8952
+SIOCDARP = 0x8953
+SIOCGARP = 0x8954
+SIOCSARP = 0x8955
+SIOCDRARP = 0x8960
+SIOCGRARP = 0x8961
+SIOCSRARP = 0x8962
+SIOCGIFMAP = 0x8970
+SIOCSIFMAP = 0x8971
+SIOCDEVPRIVATE = 0x89F0
+SIOCPROTOPRIVATE = 0x89E0
+
+# Included from linux/uio.h
+MAX_IOVEC = 8
+SOCK_STREAM = 1
+SOCK_DGRAM = 2
+SOCK_RAW = 3
+SOCK_RDM = 4
+SOCK_SEQPACKET = 5
+SOCK_PACKET = 10
+AF_UNSPEC = 0
+AF_UNIX = 1
+AF_INET = 2
+AF_AX25 = 3
+AF_IPX = 4
+AF_APPLETALK = 5
+AF_NETROM = 6
+AF_BRIDGE = 7
+AF_AAL5 = 8
+AF_X25 = 9
+AF_INET6 = 10
+AF_MAX = 12
+PF_UNSPEC = AF_UNSPEC
+PF_UNIX = AF_UNIX
+PF_INET = AF_INET
+PF_AX25 = AF_AX25
+PF_IPX = AF_IPX
+PF_APPLETALK = AF_APPLETALK
+PF_NETROM = AF_NETROM
+PF_BRIDGE = AF_BRIDGE
+PF_AAL5 = AF_AAL5
+PF_X25 = AF_X25
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+SOMAXCONN = 128
+MSG_OOB = 1
+MSG_PEEK = 2
+MSG_DONTROUTE = 4
+SOL_IP = 0
+SOL_IPX = 256
+SOL_AX25 = 257
+SOL_ATALK = 258
+SOL_NETROM = 259
+SOL_TCP = 6
+SOL_UDP = 17
+IP_TOS = 1
+IPTOS_LOWDELAY = 0x10
+IPTOS_THROUGHPUT = 0x08
+IPTOS_RELIABILITY = 0x04
+IP_TTL = 2
+IP_HDRINCL = 3
+IP_OPTIONS = 4
+IP_MULTICAST_IF = 32
+IP_MULTICAST_TTL = 33
+IP_MULTICAST_LOOP = 34
+IP_ADD_MEMBERSHIP = 35
+IP_DROP_MEMBERSHIP = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
+IPX_TYPE = 1
+TCP_NODELAY = 1
+TCP_MAXSEG = 2
+SOPRI_INTERACTIVE = 0
+SOPRI_NORMAL = 1
+SOPRI_BACKGROUND = 2
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from pthread/mit/posix.h
+
+# Included from pthread/mit/types.h
+
+# Included from pthread/mit/xtypes.h
+
+# Included from pthread/mit/sys/types.h
+IMPLINK_IP = 155
+IMPLINK_LOWEXPER = 156
+IMPLINK_HIGHEXPER = 158
+
+# Included from linux/in.h
+__SOCK_SIZE__ = 16
+IN_CLASSA_NET = 0xff000000
+IN_CLASSA_NSHIFT = 24
+IN_CLASSA_HOST = (0xffffffff & ~IN_CLASSA_NET)
+IN_CLASSA_MAX = 128
+IN_CLASSB_NET = 0xffff0000
+IN_CLASSB_NSHIFT = 16
+IN_CLASSB_HOST = (0xffffffff & ~IN_CLASSB_NET)
+IN_CLASSB_MAX = 65536
+IN_CLASSC_NET = 0xffffff00
+IN_CLASSC_NSHIFT = 8
+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
+INADDR_ALLHOSTS_GROUP = 0xe0000001
+INADDR_MAX_LOCAL_GROUP = 0xe00000ff
+
+# Included from asm/byteorder.h
+__LITTLE_ENDIAN = 1234
+def __constant_ntohl(x): return \
+
+def __constant_ntohs(x): return \
+
+def __htonl(x): return __ntohl(x)
+
+def __htons(x): return __ntohs(x)
+
+def __constant_htonl(x): return __constant_ntohl(x)
+
+def __constant_htons(x): return __constant_ntohs(x)
+
+def ntohl(x): return \
+
+def ntohs(x): return \
+
+def htonl(x): return \
+
+def htons(x): return \
+
+def LOOPBACK(x): return (((x) & htonl(0xff000000)) == htonl(0x7f000000))
+
+def MULTICAST(x): return (((x) & htonl(0xf0000000)) == htonl(0xe0000000))
+
diff --git a/Lib/linux2/SOCKET.py b/Lib/linux2/SOCKET.py
new file mode 100755
index 0000000..71077c3
--- /dev/null
+++ b/Lib/linux2/SOCKET.py
@@ -0,0 +1,183 @@
+# Generated by h2py from /usr/include/sys/socket.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from linux/socket.h
+
+# Included from asm/socket.h
+FIOSETOWN = 0x8901
+SIOCSPGRP = 0x8902
+FIOGETOWN = 0x8903
+SIOCGPGRP = 0x8904
+SIOCATMARK = 0x8905
+SIOCGSTAMP = 0x8906
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_TYPE = 3
+SO_ERROR = 4
+SO_DONTROUTE = 5
+SO_BROADCAST = 6
+SO_SNDBUF = 7
+SO_RCVBUF = 8
+SO_KEEPALIVE = 9
+SO_OOBINLINE = 10
+SO_NO_CHECK = 11
+SO_PRIORITY = 12
+SO_LINGER = 13
+
+# Included from linux/sockios.h
+SIOCADDRT = 0x890B
+SIOCDELRT = 0x890C
+SIOCGIFNAME = 0x8910
+SIOCSIFLINK = 0x8911
+SIOCGIFCONF = 0x8912
+SIOCGIFFLAGS = 0x8913
+SIOCSIFFLAGS = 0x8914
+SIOCGIFADDR = 0x8915
+SIOCSIFADDR = 0x8916
+SIOCGIFDSTADDR = 0x8917
+SIOCSIFDSTADDR = 0x8918
+SIOCGIFBRDADDR = 0x8919
+SIOCSIFBRDADDR = 0x891a
+SIOCGIFNETMASK = 0x891b
+SIOCSIFNETMASK = 0x891c
+SIOCGIFMETRIC = 0x891d
+SIOCSIFMETRIC = 0x891e
+SIOCGIFMEM = 0x891f
+SIOCSIFMEM = 0x8920
+SIOCGIFMTU = 0x8921
+SIOCSIFMTU = 0x8922
+SIOCSIFHWADDR = 0x8924
+SIOCGIFENCAP = 0x8925
+SIOCSIFENCAP = 0x8926
+SIOCGIFHWADDR = 0x8927
+SIOCGIFSLAVE = 0x8929
+SIOCSIFSLAVE = 0x8930
+SIOCADDMULTI = 0x8931
+SIOCDELMULTI = 0x8932
+OLD_SIOCDARP = 0x8950
+OLD_SIOCGARP = 0x8951
+OLD_SIOCSARP = 0x8952
+SIOCDARP = 0x8953
+SIOCGARP = 0x8954
+SIOCSARP = 0x8955
+SIOCDRARP = 0x8960
+SIOCGRARP = 0x8961
+SIOCSRARP = 0x8962
+SIOCGIFMAP = 0x8970
+SIOCSIFMAP = 0x8971
+SIOCDEVPRIVATE = 0x89F0
+SIOCPROTOPRIVATE = 0x89E0
+
+# Included from linux/uio.h
+MAX_IOVEC = 8
+SOCK_STREAM = 1
+SOCK_DGRAM = 2
+SOCK_RAW = 3
+SOCK_RDM = 4
+SOCK_SEQPACKET = 5
+SOCK_PACKET = 10
+AF_UNSPEC = 0
+AF_UNIX = 1
+AF_INET = 2
+AF_AX25 = 3
+AF_IPX = 4
+AF_APPLETALK = 5
+AF_NETROM = 6
+AF_BRIDGE = 7
+AF_AAL5 = 8
+AF_X25 = 9
+AF_INET6 = 10
+AF_MAX = 12
+PF_UNSPEC = AF_UNSPEC
+PF_UNIX = AF_UNIX
+PF_INET = AF_INET
+PF_AX25 = AF_AX25
+PF_IPX = AF_IPX
+PF_APPLETALK = AF_APPLETALK
+PF_NETROM = AF_NETROM
+PF_BRIDGE = AF_BRIDGE
+PF_AAL5 = AF_AAL5
+PF_X25 = AF_X25
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+SOMAXCONN = 128
+MSG_OOB = 1
+MSG_PEEK = 2
+MSG_DONTROUTE = 4
+SOL_IP = 0
+SOL_IPX = 256
+SOL_AX25 = 257
+SOL_ATALK = 258
+SOL_NETROM = 259
+SOL_TCP = 6
+SOL_UDP = 17
+IP_TOS = 1
+IPTOS_LOWDELAY = 0x10
+IPTOS_THROUGHPUT = 0x08
+IPTOS_RELIABILITY = 0x04
+IP_TTL = 2
+IP_HDRINCL = 3
+IP_OPTIONS = 4
+IP_MULTICAST_IF = 32
+IP_MULTICAST_TTL = 33
+IP_MULTICAST_LOOP = 34
+IP_ADD_MEMBERSHIP = 35
+IP_DROP_MEMBERSHIP = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
+IPX_TYPE = 1
+TCP_NODELAY = 1
+TCP_MAXSEG = 2
+SOPRI_INTERACTIVE = 0
+SOPRI_NORMAL = 1
+SOPRI_BACKGROUND = 2
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from pthread/mit/posix.h
+
+# Included from pthread/mit/types.h
+
+# Included from pthread/mit/xtypes.h
+
+# Included from pthread/mit/sys/types.h
diff --git a/Lib/linux2/TERMIOS.py b/Lib/linux2/TERMIOS.py
new file mode 100755
index 0000000..4b17df6
--- /dev/null
+++ b/Lib/linux2/TERMIOS.py
@@ -0,0 +1,270 @@
+# Generated by h2py from /usr/include/termios.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# 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
+NCCS = 19
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VTIME = 5
+VMIN = 6
+VSWTC = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VEOL = 11
+VREPRINT = 12
+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
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0000000
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0000000
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0000000
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0000000
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0000000
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0000000
+FF1 = 0100000
+CBAUD = 0010017
+B0 = 0000000
+B50 = 0000001
+B75 = 0000002
+B110 = 0000003
+B134 = 0000004
+B150 = 0000005
+B200 = 0000006
+B300 = 0000007
+B600 = 0000010
+B1200 = 0000011
+B1800 = 0000012
+B2400 = 0000013
+B4800 = 0000014
+B9600 = 0000015
+B19200 = 0000016
+B38400 = 0000017
+EXTA = B19200
+EXTB = B38400
+CSIZE = 0000060
+CS5 = 0000000
+CS6 = 0000020
+CS7 = 0000040
+CS8 = 0000060
+CSTOPB = 0000100
+CREAD = 0000200
+PARENB = 0000400
+PARODD = 0001000
+HUPCL = 0002000
+CLOCAL = 0004000
+CBAUDEX = 0010000
+B57600 = 0010001
+B115200 = 0010002
+B230400 = 0010003
+CIBAUD = 002003600000
+CRTSCTS = 020000000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+TOSTOP = 0000400
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+FLUSHO = 0010000
+PENDIN = 0040000
+IEXTEN = 0100000
+TIOCM_LE = 0x001
+TIOCM_DTR = 0x002
+TIOCM_RTS = 0x004
+TIOCM_ST = 0x008
+TIOCM_SR = 0x010
+TIOCM_CTS = 0x020
+TIOCM_CAR = 0x040
+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
+def CTRL(ch): return ((ch)&0x1F)
+
+IBSHIFT = 16
+CNUL = 0
+CDEL = 0177
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = ord('#')
+CKILL = ord('@')
+CEOT = 04
+CEOL = 0
+CEOL2 = 0
+CEOF = 4
+CSTART = 021
+CSTOP = 023
+CSWTCH = 032
+NSWTCH = 0
+CSUSP = CTRL(ord('Z'))
+CDSUSP = CTRL(ord('Y'))
+CRPRNT = CTRL(ord('R'))
+CFLUSH = CTRL(ord('O'))
+CWERASE = CTRL(ord('W'))
+CLNEXT = CTRL(ord('V'))
diff --git a/Lib/linux2/regen b/Lib/linux2/regen
new file mode 100755
index 0000000..d8dbc04
--- /dev/null
+++ b/Lib/linux2/regen
@@ -0,0 +1,11 @@
+#! /bin/sh
+case `uname` in
+Linux*) ;;
+*) echo Probably not on a Linux system 1>&2
+ exit 1;;
+esac
+set -v
+h2py /usr/include/sys/fcntl.h
+h2py /usr/include/sys/socket.h
+h2py -i '(u_long)' /usr/include/netinet/in.h
+h2py /usr/include/termios.h
diff --git a/Lib/plat-linux2/FCNTL.py b/Lib/plat-linux2/FCNTL.py
new file mode 100644
index 0000000..f65c4fa
--- /dev/null
+++ b/Lib/plat-linux2/FCNTL.py
@@ -0,0 +1,101 @@
+# Generated by h2py from /usr/include/sys/fcntl.h
+
+# Included from fcntl.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from gnu/types.h
+_GNU_TYPES_H = 1
+__FDSET_LONGS = 8
+def __FD_ZERO(fdsetp): return \
+
+__FD_SETSIZE = 256
+def __FDELT(d): return ((d) / __NFDBITS)
+
+def __FDMASK(d): return (1 << ((d) % __NFDBITS))
+
+def __FD_ZERO(set): return \
+
+
+# Included from linux/fcntl.h
+
+# Included from asm/fcntl.h
+O_ACCMODE = 0003
+O_RDONLY = 00
+O_WRONLY = 01
+O_RDWR = 02
+O_CREAT = 0100
+O_EXCL = 0200
+O_NOCTTY = 0400
+O_TRUNC = 01000
+O_APPEND = 02000
+O_NONBLOCK = 04000
+O_NDELAY = O_NONBLOCK
+O_SYNC = 010000
+FASYNC = 020000
+F_DUPFD = 0
+F_GETFD = 1
+F_SETFD = 2
+F_GETFL = 3
+F_SETFL = 4
+F_GETLK = 5
+F_SETLK = 6
+F_SETLKW = 7
+F_SETOWN = 8
+F_GETOWN = 9
+FD_CLOEXEC = 1
+F_RDLCK = 0
+F_WRLCK = 1
+F_UNLCK = 2
+F_EXLCK = 4
+F_SHLCK = 8
+LOCK_SH = 1
+LOCK_EX = 2
+LOCK_NB = 4
+LOCK_UN = 8
+F_POSIX = 1
+F_FLOCK = 2
+FNDELAY = O_NDELAY
+F_ULOCK = 0
+F_LOCK = 1
+F_TLOCK = 2
+F_TEST = 3
diff --git a/Lib/plat-linux2/IN.py b/Lib/plat-linux2/IN.py
new file mode 100644
index 0000000..86710d1
--- /dev/null
+++ b/Lib/plat-linux2/IN.py
@@ -0,0 +1,239 @@
+# Generated by h2py from /usr/include/netinet/in.h
+_NETINET_IN_H = 1
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/socket.h
+
+# Included from linux/socket.h
+
+# Included from asm/socket.h
+FIOSETOWN = 0x8901
+SIOCSPGRP = 0x8902
+FIOGETOWN = 0x8903
+SIOCGPGRP = 0x8904
+SIOCATMARK = 0x8905
+SIOCGSTAMP = 0x8906
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_TYPE = 3
+SO_ERROR = 4
+SO_DONTROUTE = 5
+SO_BROADCAST = 6
+SO_SNDBUF = 7
+SO_RCVBUF = 8
+SO_KEEPALIVE = 9
+SO_OOBINLINE = 10
+SO_NO_CHECK = 11
+SO_PRIORITY = 12
+SO_LINGER = 13
+
+# Included from linux/sockios.h
+SIOCADDRT = 0x890B
+SIOCDELRT = 0x890C
+SIOCGIFNAME = 0x8910
+SIOCSIFLINK = 0x8911
+SIOCGIFCONF = 0x8912
+SIOCGIFFLAGS = 0x8913
+SIOCSIFFLAGS = 0x8914
+SIOCGIFADDR = 0x8915
+SIOCSIFADDR = 0x8916
+SIOCGIFDSTADDR = 0x8917
+SIOCSIFDSTADDR = 0x8918
+SIOCGIFBRDADDR = 0x8919
+SIOCSIFBRDADDR = 0x891a
+SIOCGIFNETMASK = 0x891b
+SIOCSIFNETMASK = 0x891c
+SIOCGIFMETRIC = 0x891d
+SIOCSIFMETRIC = 0x891e
+SIOCGIFMEM = 0x891f
+SIOCSIFMEM = 0x8920
+SIOCGIFMTU = 0x8921
+SIOCSIFMTU = 0x8922
+SIOCSIFHWADDR = 0x8924
+SIOCGIFENCAP = 0x8925
+SIOCSIFENCAP = 0x8926
+SIOCGIFHWADDR = 0x8927
+SIOCGIFSLAVE = 0x8929
+SIOCSIFSLAVE = 0x8930
+SIOCADDMULTI = 0x8931
+SIOCDELMULTI = 0x8932
+OLD_SIOCDARP = 0x8950
+OLD_SIOCGARP = 0x8951
+OLD_SIOCSARP = 0x8952
+SIOCDARP = 0x8953
+SIOCGARP = 0x8954
+SIOCSARP = 0x8955
+SIOCDRARP = 0x8960
+SIOCGRARP = 0x8961
+SIOCSRARP = 0x8962
+SIOCGIFMAP = 0x8970
+SIOCSIFMAP = 0x8971
+SIOCDEVPRIVATE = 0x89F0
+SIOCPROTOPRIVATE = 0x89E0
+
+# Included from linux/uio.h
+MAX_IOVEC = 8
+SOCK_STREAM = 1
+SOCK_DGRAM = 2
+SOCK_RAW = 3
+SOCK_RDM = 4
+SOCK_SEQPACKET = 5
+SOCK_PACKET = 10
+AF_UNSPEC = 0
+AF_UNIX = 1
+AF_INET = 2
+AF_AX25 = 3
+AF_IPX = 4
+AF_APPLETALK = 5
+AF_NETROM = 6
+AF_BRIDGE = 7
+AF_AAL5 = 8
+AF_X25 = 9
+AF_INET6 = 10
+AF_MAX = 12
+PF_UNSPEC = AF_UNSPEC
+PF_UNIX = AF_UNIX
+PF_INET = AF_INET
+PF_AX25 = AF_AX25
+PF_IPX = AF_IPX
+PF_APPLETALK = AF_APPLETALK
+PF_NETROM = AF_NETROM
+PF_BRIDGE = AF_BRIDGE
+PF_AAL5 = AF_AAL5
+PF_X25 = AF_X25
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+SOMAXCONN = 128
+MSG_OOB = 1
+MSG_PEEK = 2
+MSG_DONTROUTE = 4
+SOL_IP = 0
+SOL_IPX = 256
+SOL_AX25 = 257
+SOL_ATALK = 258
+SOL_NETROM = 259
+SOL_TCP = 6
+SOL_UDP = 17
+IP_TOS = 1
+IPTOS_LOWDELAY = 0x10
+IPTOS_THROUGHPUT = 0x08
+IPTOS_RELIABILITY = 0x04
+IP_TTL = 2
+IP_HDRINCL = 3
+IP_OPTIONS = 4
+IP_MULTICAST_IF = 32
+IP_MULTICAST_TTL = 33
+IP_MULTICAST_LOOP = 34
+IP_ADD_MEMBERSHIP = 35
+IP_DROP_MEMBERSHIP = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
+IPX_TYPE = 1
+TCP_NODELAY = 1
+TCP_MAXSEG = 2
+SOPRI_INTERACTIVE = 0
+SOPRI_NORMAL = 1
+SOPRI_BACKGROUND = 2
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from pthread/mit/posix.h
+
+# Included from pthread/mit/types.h
+
+# Included from pthread/mit/xtypes.h
+
+# Included from pthread/mit/sys/types.h
+IMPLINK_IP = 155
+IMPLINK_LOWEXPER = 156
+IMPLINK_HIGHEXPER = 158
+
+# Included from linux/in.h
+__SOCK_SIZE__ = 16
+IN_CLASSA_NET = 0xff000000
+IN_CLASSA_NSHIFT = 24
+IN_CLASSA_HOST = (0xffffffff & ~IN_CLASSA_NET)
+IN_CLASSA_MAX = 128
+IN_CLASSB_NET = 0xffff0000
+IN_CLASSB_NSHIFT = 16
+IN_CLASSB_HOST = (0xffffffff & ~IN_CLASSB_NET)
+IN_CLASSB_MAX = 65536
+IN_CLASSC_NET = 0xffffff00
+IN_CLASSC_NSHIFT = 8
+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
+INADDR_ALLHOSTS_GROUP = 0xe0000001
+INADDR_MAX_LOCAL_GROUP = 0xe00000ff
+
+# Included from asm/byteorder.h
+__LITTLE_ENDIAN = 1234
+def __constant_ntohl(x): return \
+
+def __constant_ntohs(x): return \
+
+def __htonl(x): return __ntohl(x)
+
+def __htons(x): return __ntohs(x)
+
+def __constant_htonl(x): return __constant_ntohl(x)
+
+def __constant_htons(x): return __constant_ntohs(x)
+
+def ntohl(x): return \
+
+def ntohs(x): return \
+
+def htonl(x): return \
+
+def htons(x): return \
+
+def LOOPBACK(x): return (((x) & htonl(0xff000000)) == htonl(0x7f000000))
+
+def MULTICAST(x): return (((x) & htonl(0xf0000000)) == htonl(0xe0000000))
+
diff --git a/Lib/plat-linux2/SOCKET.py b/Lib/plat-linux2/SOCKET.py
new file mode 100644
index 0000000..71077c3
--- /dev/null
+++ b/Lib/plat-linux2/SOCKET.py
@@ -0,0 +1,183 @@
+# Generated by h2py from /usr/include/sys/socket.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from linux/socket.h
+
+# Included from asm/socket.h
+FIOSETOWN = 0x8901
+SIOCSPGRP = 0x8902
+FIOGETOWN = 0x8903
+SIOCGPGRP = 0x8904
+SIOCATMARK = 0x8905
+SIOCGSTAMP = 0x8906
+SOL_SOCKET = 1
+SO_DEBUG = 1
+SO_REUSEADDR = 2
+SO_TYPE = 3
+SO_ERROR = 4
+SO_DONTROUTE = 5
+SO_BROADCAST = 6
+SO_SNDBUF = 7
+SO_RCVBUF = 8
+SO_KEEPALIVE = 9
+SO_OOBINLINE = 10
+SO_NO_CHECK = 11
+SO_PRIORITY = 12
+SO_LINGER = 13
+
+# Included from linux/sockios.h
+SIOCADDRT = 0x890B
+SIOCDELRT = 0x890C
+SIOCGIFNAME = 0x8910
+SIOCSIFLINK = 0x8911
+SIOCGIFCONF = 0x8912
+SIOCGIFFLAGS = 0x8913
+SIOCSIFFLAGS = 0x8914
+SIOCGIFADDR = 0x8915
+SIOCSIFADDR = 0x8916
+SIOCGIFDSTADDR = 0x8917
+SIOCSIFDSTADDR = 0x8918
+SIOCGIFBRDADDR = 0x8919
+SIOCSIFBRDADDR = 0x891a
+SIOCGIFNETMASK = 0x891b
+SIOCSIFNETMASK = 0x891c
+SIOCGIFMETRIC = 0x891d
+SIOCSIFMETRIC = 0x891e
+SIOCGIFMEM = 0x891f
+SIOCSIFMEM = 0x8920
+SIOCGIFMTU = 0x8921
+SIOCSIFMTU = 0x8922
+SIOCSIFHWADDR = 0x8924
+SIOCGIFENCAP = 0x8925
+SIOCSIFENCAP = 0x8926
+SIOCGIFHWADDR = 0x8927
+SIOCGIFSLAVE = 0x8929
+SIOCSIFSLAVE = 0x8930
+SIOCADDMULTI = 0x8931
+SIOCDELMULTI = 0x8932
+OLD_SIOCDARP = 0x8950
+OLD_SIOCGARP = 0x8951
+OLD_SIOCSARP = 0x8952
+SIOCDARP = 0x8953
+SIOCGARP = 0x8954
+SIOCSARP = 0x8955
+SIOCDRARP = 0x8960
+SIOCGRARP = 0x8961
+SIOCSRARP = 0x8962
+SIOCGIFMAP = 0x8970
+SIOCSIFMAP = 0x8971
+SIOCDEVPRIVATE = 0x89F0
+SIOCPROTOPRIVATE = 0x89E0
+
+# Included from linux/uio.h
+MAX_IOVEC = 8
+SOCK_STREAM = 1
+SOCK_DGRAM = 2
+SOCK_RAW = 3
+SOCK_RDM = 4
+SOCK_SEQPACKET = 5
+SOCK_PACKET = 10
+AF_UNSPEC = 0
+AF_UNIX = 1
+AF_INET = 2
+AF_AX25 = 3
+AF_IPX = 4
+AF_APPLETALK = 5
+AF_NETROM = 6
+AF_BRIDGE = 7
+AF_AAL5 = 8
+AF_X25 = 9
+AF_INET6 = 10
+AF_MAX = 12
+PF_UNSPEC = AF_UNSPEC
+PF_UNIX = AF_UNIX
+PF_INET = AF_INET
+PF_AX25 = AF_AX25
+PF_IPX = AF_IPX
+PF_APPLETALK = AF_APPLETALK
+PF_NETROM = AF_NETROM
+PF_BRIDGE = AF_BRIDGE
+PF_AAL5 = AF_AAL5
+PF_X25 = AF_X25
+PF_INET6 = AF_INET6
+PF_MAX = AF_MAX
+SOMAXCONN = 128
+MSG_OOB = 1
+MSG_PEEK = 2
+MSG_DONTROUTE = 4
+SOL_IP = 0
+SOL_IPX = 256
+SOL_AX25 = 257
+SOL_ATALK = 258
+SOL_NETROM = 259
+SOL_TCP = 6
+SOL_UDP = 17
+IP_TOS = 1
+IPTOS_LOWDELAY = 0x10
+IPTOS_THROUGHPUT = 0x08
+IPTOS_RELIABILITY = 0x04
+IP_TTL = 2
+IP_HDRINCL = 3
+IP_OPTIONS = 4
+IP_MULTICAST_IF = 32
+IP_MULTICAST_TTL = 33
+IP_MULTICAST_LOOP = 34
+IP_ADD_MEMBERSHIP = 35
+IP_DROP_MEMBERSHIP = 36
+IP_DEFAULT_MULTICAST_TTL = 1
+IP_DEFAULT_MULTICAST_LOOP = 1
+IP_MAX_MEMBERSHIPS = 20
+IPX_TYPE = 1
+TCP_NODELAY = 1
+TCP_MAXSEG = 2
+SOPRI_INTERACTIVE = 0
+SOPRI_NORMAL = 1
+SOPRI_BACKGROUND = 2
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# Included from sys/bitypes.h
+
+# Included from pthread/mit/posix.h
+
+# Included from pthread/mit/types.h
+
+# Included from pthread/mit/xtypes.h
+
+# Included from pthread/mit/sys/types.h
diff --git a/Lib/plat-linux2/TERMIOS.py b/Lib/plat-linux2/TERMIOS.py
new file mode 100644
index 0000000..4b17df6
--- /dev/null
+++ b/Lib/plat-linux2/TERMIOS.py
@@ -0,0 +1,270 @@
+# Generated by h2py from /usr/include/termios.h
+
+# Included from features.h
+_FEATURES_H = 1
+_GNU_SOURCE = 1
+__USE_ANSI = 1
+__FAVOR_BSD = 1
+_BSD_SOURCE = 1
+_SVID_SOURCE = 1
+_POSIX_SOURCE = 1
+_POSIX_C_SOURCE = 2
+__USE_POSIX = 1
+__USE_POSIX2 = 1
+__USE_MISC = 1
+__USE_BSD = 1
+__USE_SVID = 1
+__USE_GNU = 1
+__GNU_LIBRARY__ = 1
+
+# Included from sys/cdefs.h
+_SYS_CDEFS_H = 1
+def __P(args): return args
+
+def __P(args): return args
+
+def __P(args): return ()
+
+def __STRING(x): return #x
+
+def __STRING(x): return "x"
+
+
+# Included from sys/types.h
+
+# Included from linux/types.h
+__FD_SETSIZE = 256
+
+# Included from asm/types.h
+def __FD_ZERO(fdsetp): return \
+
+
+# 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
+NCCS = 19
+VINTR = 0
+VQUIT = 1
+VERASE = 2
+VKILL = 3
+VEOF = 4
+VTIME = 5
+VMIN = 6
+VSWTC = 7
+VSTART = 8
+VSTOP = 9
+VSUSP = 10
+VEOL = 11
+VREPRINT = 12
+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
+PARMRK = 0000010
+INPCK = 0000020
+ISTRIP = 0000040
+INLCR = 0000100
+IGNCR = 0000200
+ICRNL = 0000400
+IUCLC = 0001000
+IXON = 0002000
+IXANY = 0004000
+IXOFF = 0010000
+IMAXBEL = 0020000
+OPOST = 0000001
+OLCUC = 0000002
+ONLCR = 0000004
+OCRNL = 0000010
+ONOCR = 0000020
+ONLRET = 0000040
+OFILL = 0000100
+OFDEL = 0000200
+NLDLY = 0000400
+NL0 = 0000000
+NL1 = 0000400
+CRDLY = 0003000
+CR0 = 0000000
+CR1 = 0001000
+CR2 = 0002000
+CR3 = 0003000
+TABDLY = 0014000
+TAB0 = 0000000
+TAB1 = 0004000
+TAB2 = 0010000
+TAB3 = 0014000
+XTABS = 0014000
+BSDLY = 0020000
+BS0 = 0000000
+BS1 = 0020000
+VTDLY = 0040000
+VT0 = 0000000
+VT1 = 0040000
+FFDLY = 0100000
+FF0 = 0000000
+FF1 = 0100000
+CBAUD = 0010017
+B0 = 0000000
+B50 = 0000001
+B75 = 0000002
+B110 = 0000003
+B134 = 0000004
+B150 = 0000005
+B200 = 0000006
+B300 = 0000007
+B600 = 0000010
+B1200 = 0000011
+B1800 = 0000012
+B2400 = 0000013
+B4800 = 0000014
+B9600 = 0000015
+B19200 = 0000016
+B38400 = 0000017
+EXTA = B19200
+EXTB = B38400
+CSIZE = 0000060
+CS5 = 0000000
+CS6 = 0000020
+CS7 = 0000040
+CS8 = 0000060
+CSTOPB = 0000100
+CREAD = 0000200
+PARENB = 0000400
+PARODD = 0001000
+HUPCL = 0002000
+CLOCAL = 0004000
+CBAUDEX = 0010000
+B57600 = 0010001
+B115200 = 0010002
+B230400 = 0010003
+CIBAUD = 002003600000
+CRTSCTS = 020000000000
+ISIG = 0000001
+ICANON = 0000002
+XCASE = 0000004
+ECHO = 0000010
+ECHOE = 0000020
+ECHOK = 0000040
+ECHONL = 0000100
+NOFLSH = 0000200
+TOSTOP = 0000400
+ECHOCTL = 0001000
+ECHOPRT = 0002000
+ECHOKE = 0004000
+FLUSHO = 0010000
+PENDIN = 0040000
+IEXTEN = 0100000
+TIOCM_LE = 0x001
+TIOCM_DTR = 0x002
+TIOCM_RTS = 0x004
+TIOCM_ST = 0x008
+TIOCM_SR = 0x010
+TIOCM_CTS = 0x020
+TIOCM_CAR = 0x040
+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
+def CTRL(ch): return ((ch)&0x1F)
+
+IBSHIFT = 16
+CNUL = 0
+CDEL = 0177
+CESC = ord('\\')
+CINTR = 0177
+CQUIT = 034
+CERASE = ord('#')
+CKILL = ord('@')
+CEOT = 04
+CEOL = 0
+CEOL2 = 0
+CEOF = 4
+CSTART = 021
+CSTOP = 023
+CSWTCH = 032
+NSWTCH = 0
+CSUSP = CTRL(ord('Z'))
+CDSUSP = CTRL(ord('Y'))
+CRPRNT = CTRL(ord('R'))
+CFLUSH = CTRL(ord('O'))
+CWERASE = CTRL(ord('W'))
+CLNEXT = CTRL(ord('V'))
diff --git a/Lib/plat-linux2/regen b/Lib/plat-linux2/regen
new file mode 100755
index 0000000..d8dbc04
--- /dev/null
+++ b/Lib/plat-linux2/regen
@@ -0,0 +1,11 @@
+#! /bin/sh
+case `uname` in
+Linux*) ;;
+*) echo Probably not on a Linux system 1>&2
+ exit 1;;
+esac
+set -v
+h2py /usr/include/sys/fcntl.h
+h2py /usr/include/sys/socket.h
+h2py -i '(u_long)' /usr/include/netinet/in.h
+h2py /usr/include/termios.h