summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/plat-sunos5/DLFCN.py27
-rwxr-xr-xLib/plat-sunos5/IN.py937
-rw-r--r--Lib/plat-sunos5/STROPTS.py1235
-rw-r--r--Lib/plat-sunos5/TYPES.py314
-rwxr-xr-xLib/plat-sunos5/regen4
5 files changed, 1778 insertions, 739 deletions
diff --git a/Lib/plat-sunos5/DLFCN.py b/Lib/plat-sunos5/DLFCN.py
new file mode 100644
index 0000000..f492350
--- /dev/null
+++ b/Lib/plat-sunos5/DLFCN.py
@@ -0,0 +1,27 @@
+# Generated by h2py from /usr/include/dlfcn.h
+from TYPES import *
+RTLD_LAZY = 0x00001
+RTLD_NOW = 0x00002
+RTLD_NOLOAD = 0x00004
+RTLD_GLOBAL = 0x00100
+RTLD_LOCAL = 0x00000
+RTLD_PARENT = 0x00200
+RTLD_GROUP = 0x00400
+RTLD_WORLD = 0x00800
+RTLD_NODELETE = 0x01000
+RTLD_CONFGEN = 0x10000
+RTLD_REL_RELATIVE = 0x00001
+RTLD_REL_EXEC = 0x00002
+RTLD_REL_DEPENDS = 0x00004
+RTLD_REL_PRELOAD = 0x00008
+RTLD_REL_SELF = 0x00010
+RTLD_REL_WEAK = 0x00020
+RTLD_REL_ALL = 0x00fff
+RTLD_MEMORY = 0x01000
+RTLD_STRIP = 0x02000
+RTLD_NOHEAP = 0x04000
+RTLD_CONFSET = 0x10000
+RTLD_DI_LMID = 1
+RTLD_DI_LINKMAP = 2
+RTLD_DI_CONFIGADDR = 3
+RTLD_DI_MAX = 3
diff --git a/Lib/plat-sunos5/IN.py b/Lib/plat-sunos5/IN.py
index d5406a2..7e26187 100755
--- a/Lib/plat-sunos5/IN.py
+++ b/Lib/plat-sunos5/IN.py
@@ -1,18 +1,21 @@
# Generated by h2py from /usr/include/netinet/in.h
-# Included from sys/stream.h
-
-# Included from sys/vnode.h
-
-# Included from sys/types.h
-
# Included from sys/feature_tests.h
-_POSIX_C_SOURCE = 1
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
+_LONG_ALIGNMENT = 8
+_LONG_LONG_ALIGNMENT = 8
+_DOUBLE_ALIGNMENT = 8
+_LONG_DOUBLE_ALIGNMENT = 16
+_POINTER_ALIGNMENT = 8
+_MAX_ALIGNMENT = 16
+_ALIGNMENT_REQUIRED = 1
+_CHAR_ALIGNMENT = 1
+_SHORT_ALIGNMENT = 2
+_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 4
_LONG_LONG_ALIGNMENT = 4
_DOUBLE_ALIGNMENT = 4
@@ -23,172 +26,67 @@ _ALIGNMENT_REQUIRED = 0
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
-_LONG_ALIGNMENT = 4
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
-_LONG_DOUBLE_ALIGNMENT = 16
-_POINTER_ALIGNMENT = 4
-_MAX_ALIGNMENT = 16
_ALIGNMENT_REQUIRED = 1
-_CHAR_ALIGNMENT = 1
-_SHORT_ALIGNMENT = 2
-_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 4
-_LONG_LONG_ALIGNMENT = 8
-_DOUBLE_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = 8
_POINTER_ALIGNMENT = 4
_MAX_ALIGNMENT = 8
-_ALIGNMENT_REQUIRED = 1
-
-# Included from sys/machtypes.h
-SHRT_MIN = -32768
-SHRT_MAX = 32767
-INT_MIN = (-2147483647-1)
-INT_MAX = 2147483647
-LONG_MIN = (-2147483647-1)
-LONG_MAX = 2147483647
-P_MYID = (-1)
-
-# Included from sys/select.h
-
-# Included from sys/time.h
-DST_NONE = 0
-DST_USA = 1
-DST_AUST = 2
-DST_WET = 3
-DST_MET = 4
-DST_EET = 5
-DST_CAN = 6
-DST_GB = 7
-DST_RUM = 8
-DST_TUR = 9
-DST_AUSTALT = 10
-ITIMER_REAL = 0
-ITIMER_VIRTUAL = 1
-ITIMER_PROF = 2
-ITIMER_REALPROF = 3
-SEC = 1
-MILLISEC = 1000
-MICROSEC = 1000000
-NANOSEC = 1000000000
-__CLOCK_REALTIME0 = 0
-CLOCK_VIRTUAL = 1
-CLOCK_PROF = 2
-__CLOCK_REALTIME3 = 3
-CLOCK_REALTIME = __CLOCK_REALTIME3
-CLOCK_REALTIME = __CLOCK_REALTIME0
-TIMER_RELTIME = 0x0
-TIMER_ABSTIME = 0x1
-
-# Included from sys/mutex.h
-
-# Included from sys/dki_lkinfo.h
-
-# Included from sys/dl.h
-NOSTATS = 1
-LSB_NLKDS = 91
-def MUTEX_HELD(x): return (mutex_owned(x))
-
-
-# Included from time.h
-NULL = 0
-CLOCKS_PER_SEC = 1000000
-
-# Included from sys/siginfo.h
-SIGEV_NONE = 1
-SIGEV_SIGNAL = 2
-SIGEV_THREAD = 3
-SI_NOINFO = 32767
-SI_USER = 0
-SI_LWP = (-1)
-SI_QUEUE = (-2)
-SI_TIMER = (-3)
-SI_ASYNCIO = (-4)
-SI_MESGQ = (-5)
+_LONG_ALIGNMENT = 8
+_LONG_DOUBLE_ALIGNMENT = 16
+_POINTER_ALIGNMENT = 8
+_MAX_ALIGNMENT = 16
+_POSIX_C_SOURCE = 1
+_LARGEFILE64_SOURCE = 1
+_LARGEFILE_SOURCE = 1
+_FILE_OFFSET_BITS = 64
+_FILE_OFFSET_BITS = 32
+_POSIX_C_SOURCE = 199506L
+_POSIX_PTHREAD_SEMANTICS = 1
+_XOPEN_VERSION = 500
+_XOPEN_VERSION = 4
+_XOPEN_VERSION = 3
+from TYPES import *
-# Included from sys/machsig.h
-ILL_ILLOPC = 1
-ILL_ILLOPN = 2
-ILL_ILLADR = 3
-ILL_ILLTRP = 4
-ILL_PRVOPC = 5
-ILL_PRVREG = 6
-ILL_COPROC = 7
-ILL_BADSTK = 8
-NSIGILL = 8
-EMT_TAGOVF = 1
-NSIGEMT = 1
-FPE_INTDIV = 1
-FPE_INTOVF = 2
-FPE_FLTDIV = 3
-FPE_FLTOVF = 4
-FPE_FLTUND = 5
-FPE_FLTRES = 6
-FPE_FLTINV = 7
-FPE_FLTSUB = 8
-NSIGFPE = 8
-SEGV_MAPERR = 1
-SEGV_ACCERR = 2
-NSIGSEGV = 2
-BUS_ADRALN = 1
-BUS_ADRERR = 2
-BUS_OBJERR = 3
-NSIGBUS = 3
-TRAP_BRKPT = 1
-TRAP_TRACE = 2
-NSIGTRAP = 2
-CLD_EXITED = 1
-CLD_KILLED = 2
-CLD_DUMPED = 3
-CLD_TRAPPED = 4
-CLD_STOPPED = 5
-CLD_CONTINUED = 6
-NSIGCLD = 6
-POLL_IN = 1
-POLL_OUT = 2
-POLL_MSG = 3
-POLL_ERR = 4
-POLL_PRI = 5
-POLL_HUP = 6
-NSIGPOLL = 6
-PROF_SIG = 1
-NSIGPROF = 1
-SI_MAXSZ = 128
-def SI_CANQUEUE(c): return ((c) <= SI_QUEUE)
+# Included from sys/stream.h
-FD_SETSIZE = 1024
-NBBY = 8
+# Included from sys/vnode.h
+from TYPES import *
# Included from sys/t_lock.h
# Included from sys/machlock.h
+from TYPES import *
LOCK_HELD_VALUE = 0xff
def SPIN_LOCK(pl): return ((pl) > ipltospl(LOCK_LEVEL))
def LOCK_SAMPLE_INTERVAL(i): return (((i) & 0xff) == 0)
-LOCK_LEVEL = 10
CLOCK_LEVEL = 10
+LOCK_LEVEL = 10
+DISP_LEVEL = (LOCK_LEVEL + 1)
PTR24_LSB = 5
PTR24_MSB = (PTR24_LSB + 24)
PTR24_ALIGN = 32
PTR24_BASE = 0xe0000000
-# Included from sys/sleepq.h
-NSLEEPQ = 512
-
-# Included from sys/turnstile.h
-
# Included from sys/param.h
+from TYPES import *
_POSIX_VDISABLE = 0
MAX_INPUT = 512
MAX_CANON = 256
UID_NOBODY = 60001
GID_NOBODY = UID_NOBODY
UID_NOACCESS = 60002
-MAXPID = 30000
+MAX_TASKID = 999999
+MAX_MAXPID = 999999
+DEFAULT_MAXPID = 999999
+DEFAULT_JUMPPID = 100000
+DEFAULT_MAXPID = 30000
+DEFAULT_JUMPPID = 0
MAXUID = 2147483647
+MAXPROJID = MAXUID
MAXLINK = 32767
NMOUNT = 40
CANBSIZ = 256
@@ -196,27 +94,10 @@ NOFILE = 20
NGROUPS_UMIN = 0
NGROUPS_UMAX = 32
NGROUPS_MAX_DEFAULT = 16
-PMASK = 0177
-PCATCH = 0400
-PNOSTOP = 01000
-PSWP = 0
-PINOD = 10
-PSNDD = PINOD
-PAMAP = PINOD
-PPMAP = PAMAP
-PRIBIO = 20
-PZERO = 25
-PMEM = 0
NZERO = 20
-PPIPE = 26
-PVFS = 27
-PWAIT = 30
-PLOCK = 35
-PSLEP = 39
-PUSER = 60
-PIDLE = 127
+NULL = 0L
NULL = 0
-CMASK = 0
+CMASK = 022
CDLIMIT = (1L<<11)
NBPS = 0x20000
NBPSCTR = 512
@@ -235,6 +116,11 @@ MAXBSIZE = 8192
DEV_BSIZE = 512
DEV_BSHIFT = 9
MAXFRAG = 8
+MAXOFF32_T = 0x7fffffff
+MAXOFF_T = 0x7fffffffffffffffl
+MAXOFFSET_T = 0x7fffffffffffffffl
+MAXOFF_T = 0x7fffffffl
+MAXOFFSET_T = 0x7fffffff
def btodb(bytes): return \
def dbtob(db): return \
@@ -243,16 +129,19 @@ def lbtodb(bytes): return \
def ldbtob(db): return \
-NCARGS = 0x100000
+NCARGS32 = 0x100000
+NCARGS64 = 0x200000
+NCARGS = NCARGS64
+NCARGS = NCARGS32
FSHIFT = 8
FSCALE = (1<<FSHIFT)
def DELAY(n): return drv_usecwait(n)
def mmu_ptob(x): return ((x) << MMU_PAGESHIFT)
-def mmu_btop(x): return (((unsigned)(x)) >> MMU_PAGESHIFT)
+def mmu_btop(x): return (((x)) >> MMU_PAGESHIFT)
-def mmu_btopr(x): return ((((unsigned)(x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
+def mmu_btopr(x): return ((((x) + MMU_PAGEOFFSET) >> MMU_PAGESHIFT))
def mmu_ptod(x): return ((x) << (MMU_PAGESHIFT - DEV_BSHIFT))
@@ -260,18 +149,47 @@ def ptod(x): return ((x) << (PAGESHIFT - DEV_BSHIFT))
def ptob(x): return ((x) << PAGESHIFT)
-def btop(x): return (((unsigned)(x)) >> PAGESHIFT)
+def btop(x): return (((x) >> PAGESHIFT))
-def btopr(x): return ((((unsigned)(x) + PAGEOFFSET) >> PAGESHIFT))
+def btopr(x): return ((((x) + PAGEOFFSET) >> PAGESHIFT))
def dtop(DD): return (((DD) + NDPP - 1) >> (PAGESHIFT - DEV_BSHIFT))
def dtopt(DD): return ((DD) >> (PAGESHIFT - DEV_BSHIFT))
-def PAGOFF(x): return (((uint)(x)) & PAGEOFFSET)
-
+_AIO_LISTIO_MAX = (4096)
+_AIO_MAX = (-1)
+_MQ_OPEN_MAX = (32)
+_MQ_PRIO_MAX = (32)
+_SEM_NSEMS_MAX = INT_MAX
+_SEM_VALUE_MAX = INT_MAX
# Included from sys/unistd.h
+_CS_PATH = 65
+_CS_LFS_CFLAGS = 68
+_CS_LFS_LDFLAGS = 69
+_CS_LFS_LIBS = 70
+_CS_LFS_LINTFLAGS = 71
+_CS_LFS64_CFLAGS = 72
+_CS_LFS64_LDFLAGS = 73
+_CS_LFS64_LIBS = 74
+_CS_LFS64_LINTFLAGS = 75
+_CS_XBS5_ILP32_OFF32_CFLAGS = 700
+_CS_XBS5_ILP32_OFF32_LDFLAGS = 701
+_CS_XBS5_ILP32_OFF32_LIBS = 702
+_CS_XBS5_ILP32_OFF32_LINTFLAGS = 703
+_CS_XBS5_ILP32_OFFBIG_CFLAGS = 705
+_CS_XBS5_ILP32_OFFBIG_LDFLAGS = 706
+_CS_XBS5_ILP32_OFFBIG_LIBS = 707
+_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 708
+_CS_XBS5_LP64_OFF64_CFLAGS = 709
+_CS_XBS5_LP64_OFF64_LDFLAGS = 710
+_CS_XBS5_LP64_OFF64_LIBS = 711
+_CS_XBS5_LP64_OFF64_LINTFLAGS = 712
+_CS_XBS5_LPBIG_OFFBIG_CFLAGS = 713
+_CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 714
+_CS_XBS5_LPBIG_OFFBIG_LIBS = 715
+_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 716
_SC_ARG_MAX = 1
_SC_CHILD_MAX = 2
_SC_CLK_TCK = 3
@@ -335,9 +253,13 @@ _SC_RE_DUP_MAX = 61
_SC_XOPEN_CRYPT = 62
_SC_XOPEN_ENH_I18N = 63
_SC_XOPEN_SHM = 64
-_CS_PATH = 65
_SC_2_CHAR_TERM = 66
_SC_XOPEN_XCU_VERSION = 67
+_SC_ATEXIT_MAX = 76
+_SC_IOV_MAX = 77
+_SC_XOPEN_UNIX = 78
+_SC_PAGE_SIZE = _SC_PAGESIZE
+_SC_T_IOV_MAX = 79
_SC_PHYS_PAGES = 500
_SC_AVPHYS_PAGES = 501
_SC_COHER_BLKSZ = 503
@@ -351,6 +273,8 @@ _SC_DCACHE_BLKSZ = 510
_SC_DCACHE_TBLKSZ = 511
_SC_ICACHE_ASSOC = 512
_SC_DCACHE_ASSOC = 513
+_SC_MAXPID = 514
+_SC_STACK_PROT = 515
_SC_THREAD_DESTRUCTOR_ITERATIONS = 568
_SC_GETGR_R_SIZE_MAX = 569
_SC_GETPW_R_SIZE_MAX = 570
@@ -367,9 +291,13 @@ _SC_THREAD_PRIO_INHERIT = 580
_SC_THREAD_PRIO_PROTECT = 581
_SC_THREAD_PROCESS_SHARED = 582
_SC_THREAD_SAFE_FUNCTIONS = 583
-_SC_PPC_GRANULE_SZ = 601
-_SC_PPC_TB_TICKSPSECH = 602
-_SC_PPC_TB_TICKSPSECL = 603
+_SC_XOPEN_LEGACY = 717
+_SC_XOPEN_REALTIME = 718
+_SC_XOPEN_REALTIME_THREADS = 719
+_SC_XBS5_ILP32_OFF32 = 720
+_SC_XBS5_ILP32_OFFBIG = 721
+_SC_XBS5_LP64_OFF64 = 722
+_SC_XBS5_LPBIG_OFFBIG = 723
_PC_LINK_MAX = 1
_PC_MAX_CANON = 2
_PC_MAX_INPUT = 3
@@ -382,12 +310,15 @@ _PC_CHOWN_RESTRICTED = 9
_PC_ASYNC_IO = 10
_PC_PRIO_IO = 11
_PC_SYNC_IO = 12
-_PC_LAST = 12
+_PC_FILESIZEBITS = 67
+_PC_LAST = 67
_POSIX_VERSION = 199506L
_POSIX2_VERSION = 199209L
_POSIX2_C_VERSION = 199209L
-_XOPEN_VERSION = 3
_XOPEN_XCU_VERSION = 4
+_XOPEN_REALTIME = 1
+_XOPEN_ENH_I18N = 1
+_XOPEN_SHM = 1
_POSIX2_C_BIND = 1
_POSIX2_CHAR_TERM = 1
_POSIX2_LOCALEDEF = 1
@@ -395,23 +326,13 @@ _POSIX2_C_DEV = 1
_POSIX2_SW_DEV = 1
_POSIX2_UPE = 1
-# Included from sys/pirec.h
-NTSTILE_SQ = 2
-TSTILE_FREE = 0
-TSTILE_ACTIVE = 1
-TS_ROWSZ = 512
-TS_COLSZ = 128
-TS_ROWBITS = 9
-TS_COLBITS = 7
-TS_ROWMASK = ((1 << TS_ROWBITS) - 1)
-def TS_COL(ts_id): return ((ts_id) >> TS_ROWBITS)
-
-def TS_ROW(ts_id): return ((ts_id) & TS_ROWMASK)
-
-def TSTILE_PRIO_INVERTED(ts): return \
+# Included from sys/mutex.h
+from TYPES import *
+def MUTEX_HELD(x): return (mutex_owned(x))
# Included from sys/rwlock.h
+from TYPES import *
def RW_READ_HELD(x): return (rw_read_held((x)))
def RW_WRITE_HELD(x): return (rw_write_held((x)))
@@ -424,14 +345,107 @@ def RW_ISWRITER(x): return (rw_iswriter(x))
# Included from sys/semaphore.h
# Included from sys/thread.h
-
-# Included from sys/class.h
+from TYPES import *
# Included from sys/klwp.h
+from TYPES import *
# Included from sys/condvar.h
+from TYPES import *
+
+# Included from sys/time.h
+
+# Included from sys/types32.h
+
+# Included from sys/int_types.h
+TIME32_MAX = INT32_MAX
+TIME32_MIN = INT32_MIN
+def TIMEVAL_OVERFLOW(tv): return \
+
+from TYPES import *
+DST_NONE = 0
+DST_USA = 1
+DST_AUST = 2
+DST_WET = 3
+DST_MET = 4
+DST_EET = 5
+DST_CAN = 6
+DST_GB = 7
+DST_RUM = 8
+DST_TUR = 9
+DST_AUSTALT = 10
+ITIMER_REAL = 0
+ITIMER_VIRTUAL = 1
+ITIMER_PROF = 2
+ITIMER_REALPROF = 3
+def ITIMERVAL_OVERFLOW(itv): return \
+
+SEC = 1
+MILLISEC = 1000
+MICROSEC = 1000000
+NANOSEC = 1000000000
+
+# Included from sys/time_impl.h
+def TIMESPEC_OVERFLOW(ts): return \
+
+def ITIMERSPEC_OVERFLOW(it): return \
+
+__CLOCK_REALTIME0 = 0
+CLOCK_VIRTUAL = 1
+CLOCK_PROF = 2
+__CLOCK_REALTIME3 = 3
+CLOCK_HIGHRES = 4
+CLOCK_MAX = 5
+CLOCK_REALTIME = __CLOCK_REALTIME3
+CLOCK_REALTIME = __CLOCK_REALTIME0
+TIMER_RELTIME = 0x0
+TIMER_ABSTIME = 0x1
+def TICK_TO_SEC(tick): return ((tick) / hz)
+
+def SEC_TO_TICK(sec): return ((sec) * hz)
+
+def TICK_TO_MSEC(tick): return \
+
+def MSEC_TO_TICK(msec): return \
+
+def MSEC_TO_TICK_ROUNDUP(msec): return \
+
+def TICK_TO_USEC(tick): return ((tick) * usec_per_tick)
+
+def USEC_TO_TICK(usec): return ((usec) / usec_per_tick)
+
+def USEC_TO_TICK_ROUNDUP(usec): return \
+
+def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick)
+
+def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick)
+
+def NSEC_TO_TICK_ROUNDUP(nsec): return \
+
+def TIMEVAL_TO_TICK(tvp): return \
+
+def TIMESTRUC_TO_TICK(tsp): return \
+
+
+# Included from time.h
+from TYPES import *
+
+# Included from iso/time_iso.h
+NULL = 0L
+NULL = 0
+CLOCKS_PER_SEC = 1000000
+
+# Included from sys/select.h
+FD_SETSIZE = 65536
+FD_SETSIZE = 1024
+_NBBY = 8
+NBBY = _NBBY
+def FD_ZERO(p): return bzero((p), sizeof (*(p)))
+
# Included from sys/signal.h
+
+# Included from sys/iso/signal_iso.h
SIGHUP = 1
SIGINT = 2
SIGQUIT = 3
@@ -471,8 +485,9 @@ SIGLWP = 33
SIGFREEZE = 34
SIGTHAW = 35
SIGCANCEL = 36
-_SIGRTMIN = 37
-_SIGRTMAX = 44
+SIGLOST = 37
+_SIGRTMIN = 38
+_SIGRTMAX = 45
SIG_BLOCK = 1
SIG_UNBLOCK = 2
SIG_SETMASK = 3
@@ -482,6 +497,79 @@ SIGHOLD = 0x200
SIGRELSE = 0x400
SIGIGNORE = 0x800
SIGPAUSE = 0x1000
+
+# Included from sys/siginfo.h
+from TYPES import *
+SIGEV_NONE = 1
+SIGEV_SIGNAL = 2
+SIGEV_THREAD = 3
+SI_NOINFO = 32767
+SI_USER = 0
+SI_LWP = (-1)
+SI_QUEUE = (-2)
+SI_TIMER = (-3)
+SI_ASYNCIO = (-4)
+SI_MESGQ = (-5)
+
+# Included from sys/machsig.h
+ILL_ILLOPC = 1
+ILL_ILLOPN = 2
+ILL_ILLADR = 3
+ILL_ILLTRP = 4
+ILL_PRVOPC = 5
+ILL_PRVREG = 6
+ILL_COPROC = 7
+ILL_BADSTK = 8
+NSIGILL = 8
+EMT_TAGOVF = 1
+EMT_CPCOVF = 2
+NSIGEMT = 2
+FPE_INTDIV = 1
+FPE_INTOVF = 2
+FPE_FLTDIV = 3
+FPE_FLTOVF = 4
+FPE_FLTUND = 5
+FPE_FLTRES = 6
+FPE_FLTINV = 7
+FPE_FLTSUB = 8
+NSIGFPE = 8
+SEGV_MAPERR = 1
+SEGV_ACCERR = 2
+NSIGSEGV = 2
+BUS_ADRALN = 1
+BUS_ADRERR = 2
+BUS_OBJERR = 3
+NSIGBUS = 3
+TRAP_BRKPT = 1
+TRAP_TRACE = 2
+TRAP_RWATCH = 3
+TRAP_WWATCH = 4
+TRAP_XWATCH = 5
+NSIGTRAP = 5
+CLD_EXITED = 1
+CLD_KILLED = 2
+CLD_DUMPED = 3
+CLD_TRAPPED = 4
+CLD_STOPPED = 5
+CLD_CONTINUED = 6
+NSIGCLD = 6
+POLL_IN = 1
+POLL_OUT = 2
+POLL_MSG = 3
+POLL_ERR = 4
+POLL_PRI = 5
+POLL_HUP = 6
+NSIGPOLL = 6
+PROF_SIG = 1
+NSIGPROF = 1
+SI_MAXSZ = 256
+SI_MAXSZ = 128
+
+# Included from sys/time_std_impl.h
+from TYPES import *
+SI32_MAXSZ = 128
+def SI_CANQUEUE(c): return ((c) <= SI_QUEUE)
+
SA_NOCLDSTOP = 0x00020000
SA_ONSTACK = 0x00000001
SA_RESETHAND = 0x00000002
@@ -490,8 +578,8 @@ SA_SIGINFO = 0x00000008
SA_NODEFER = 0x00000010
SA_NOCLDWAIT = 0x00010000
SA_WAITSIG = 0x00010000
-NSIG = 45
-MAXSIG = 44
+NSIG = 46
+MAXSIG = 45
S_SIGNAL = 1
S_SIGSET = 2
S_SIGACTION = 3
@@ -500,11 +588,16 @@ MINSIGSTKSZ = 2048
SIGSTKSZ = 8192
SS_ONSTACK = 0x00000001
SS_DISABLE = 0x00000002
-_SIGQUEUE_MAX = 32
+SN_PROC = 1
+SN_CANCEL = 2
+SN_SEND = 3
-# Included from sys/pcb.h
+# Included from sys/ucontext.h
+from TYPES import *
# Included from sys/regset.h
+REG_CCR = (0)
+REG_PSR = (0)
REG_PSR = (0)
REG_PC = (1)
REG_nPC = (2)
@@ -524,11 +617,17 @@ REG_O4 = (15)
REG_O5 = (16)
REG_O6 = (17)
REG_O7 = (18)
+REG_ASI = (19)
+REG_FPRS = (20)
REG_PS = REG_PSR
REG_SP = REG_O6
REG_R0 = REG_O0
REG_R1 = REG_O1
-NGREG = 19
+_NGREG = 21
+_NGREG = 19
+NGREG = _NGREG
+_NGREG32 = 19
+_NGREG64 = 21
SPARC_MAXREGWINDOW = 31
MAXFPQ = 16
XRS_ID = 0x78727300
@@ -613,6 +712,7 @@ RD_NEGINF = 3
FPRS_DL = 0x1
FPRS_DU = 0x2
FPRS_FEF = 0x4
+PIL_MAX = 0xf
def SAVE_GLOBALS(RP): return \
def RESTORE_GLOBALS(RP): return \
@@ -629,8 +729,32 @@ def STORE_FPREGS(FP): return \
def LOAD_FPREGS(FP): return \
-FIX_ALIGNMENT = 0x01
+_SPARC_MAXREGWINDOW = 31
+_XRS_ID = 0x78727300
+GETCONTEXT = 0
+SETCONTEXT = 1
+UC_SIGMASK = 001
+UC_STACK = 002
+UC_CPU = 004
+UC_MAU = 010
+UC_FPU = UC_MAU
+UC_INTR = 020
+UC_ASR = 040
+UC_MCONTEXT = (UC_CPU|UC_FPU|UC_ASR)
+UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
+_SIGQUEUE_MAX = 32
+_SIGNOTIFY_MAX = 32
+
+# Included from sys/pcb.h
INSTR_VALID = 0x02
+NORMAL_STEP = 0x04
+WATCH_STEP = 0x08
+CPC_OVERFLOW = 0x10
+ASYNC_HWERR = 0x20
+STEP_NONE = 0
+STEP_REQUESTED = 1
+STEP_ACTIVE = 2
+STEP_WASACTIVE = 3
# Included from sys/msacct.h
LMS_USER = 0
@@ -645,31 +769,31 @@ LMS_WAIT_CPU = 8
LMS_STOPPED = 9
NMSTATES = 10
-# Included from sys/ucontext.h
-GETCONTEXT = 0
-SETCONTEXT = 1
-UC_SIGMASK = 001
-UC_STACK = 002
-UC_CPU = 004
-UC_MAU = 010
-UC_FPU = UC_MAU
-UC_INTR = 020
-UC_MCONTEXT = (UC_CPU|UC_FPU)
-UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
-
# Included from sys/lwp.h
# Included from sys/synch.h
-USYNC_THREAD = 0
-USYNC_PROCESS = 1
-TRACE_TYPE = 2
+from TYPES import *
+USYNC_THREAD = 0x00
+USYNC_PROCESS = 0x01
+LOCK_NORMAL = 0x00
+LOCK_ERRORCHECK = 0x02
+LOCK_RECURSIVE = 0x04
+USYNC_PROCESS_ROBUST = 0x08
+LOCK_PRIO_NONE = 0x00
+LOCK_PRIO_INHERIT = 0x10
+LOCK_PRIO_PROTECT = 0x20
+LOCK_STALL_NP = 0x00
+LOCK_ROBUST_NP = 0x40
+LOCK_OWNERDEAD = 0x1
+LOCK_NOTRECOVERABLE = 0x2
+LOCK_INITED = 0x4
+LOCK_UNMAPPED = 0x8
LWP_DETACHED = 0x00000040
LWP_SUSPENDED = 0x00000080
__LWP_ASLWP = 0x00000100
MAXSYSARGS = 8
NORMALRETURN = 0
JUSTRETURN = 1
-RESTARTSYS = 2
LWP_USER = 0x01
LWP_SYS = 0x02
TS_FREE = 0x00
@@ -682,31 +806,37 @@ T_INTR_THREAD = 0x0001
T_WAKEABLE = 0x0002
T_TOMASK = 0x0004
T_TALLOCSTK = 0x0008
-T_LWPZOMB = 0x0010
T_WOULDBLOCK = 0x0020
T_DONTBLOCK = 0x0040
T_DONTPEND = 0x0080
T_SYS_PROF = 0x0100
T_WAITCVSEM = 0x0200
-TP_WAITFOR = 0x01
-TP_HOLDLWP = 0x02
-TP_TWAIT = 0x04
-TP_LWPEXIT = 0x08
-TP_PRSTOP = 0x10
-TP_CHKPT = 0x20
-TP_EXITLWP = 0x40
-TP_PRVSTOP = 0x80
-TP_MSACCT = 0x100
-TP_STOPPING = 0x200
-TS_LOAD = 0x01
-TS_CSTART = 0x02
-TS_XSTART = 0x04
-TS_PSTART = 0x08
-TS_DONT_SWAP = 0x10
-TS_RESUME = 0x20
-TS_SWAPENQ = 0x40
-TS_ON_SWAPQ = 0x80
-TS_ALLSTART = (TS_CSTART | TS_XSTART | TS_PSTART | TS_RESUME)
+T_WATCHPT = 0x0400
+T_PANIC = 0x0800
+TP_HOLDLWP = 0x0002
+TP_TWAIT = 0x0004
+TP_LWPEXIT = 0x0008
+TP_PRSTOP = 0x0010
+TP_CHKPT = 0x0020
+TP_EXITLWP = 0x0040
+TP_PRVSTOP = 0x0080
+TP_MSACCT = 0x0100
+TP_STOPPING = 0x0200
+TP_WATCHPT = 0x0400
+TP_PAUSE = 0x0800
+TP_CHANGEBIND = 0x1000
+TS_LOAD = 0x0001
+TS_DONT_SWAP = 0x0002
+TS_SWAPENQ = 0x0004
+TS_ON_SWAPQ = 0x0008
+TS_CSTART = 0x0100
+TS_UNPAUSE = 0x0200
+TS_XSTART = 0x0400
+TS_PSTART = 0x0800
+TS_RESUME = 0x1000
+TS_CREATE = 0x2000
+TS_ALLSTART = \
+ (TS_CSTART|TS_UNPAUSE|TS_XSTART|TS_PSTART|TS_RESUME|TS_CREATE)
def CPR_VSTOPPED(t): return \
def THREAD_TRANSITION(tp): return thread_transition(tp);
@@ -717,23 +847,74 @@ def THREAD_ZOMB(tp): return THREAD_SET_STATE(tp, TS_ZOMB, NULL)
def SEMA_HELD(x): return (sema_held((x)))
-LOCK_NAME_LEN = 18
NO_LOCKS_HELD = 1
NO_COMPETING_THREADS = 1
# Included from sys/cred.h
# Included from sys/uio.h
+from TYPES import *
+
+# Included from sys/resource.h
+from TYPES import *
+PRIO_PROCESS = 0
+PRIO_PGRP = 1
+PRIO_USER = 2
+RLIMIT_CPU = 0
+RLIMIT_FSIZE = 1
+RLIMIT_DATA = 2
+RLIMIT_STACK = 3
+RLIMIT_CORE = 4
+RLIMIT_NOFILE = 5
+RLIMIT_VMEM = 6
+RLIMIT_AS = RLIMIT_VMEM
+RLIM_NLIMITS = 7
+RLIM_INFINITY = (-3l)
+RLIM_SAVED_MAX = (-2l)
+RLIM_SAVED_CUR = (-1l)
+RLIM_INFINITY = 0x7fffffff
+RLIM_SAVED_MAX = 0x7ffffffe
+RLIM_SAVED_CUR = 0x7ffffffd
+RLIM32_INFINITY = 0x7fffffff
+RLIM32_SAVED_MAX = 0x7ffffffe
+RLIM32_SAVED_CUR = 0x7ffffffd
+
+# Included from sys/model.h
+
+# Included from sys/debug.h
+def ASSERT64(x): return ASSERT(x)
+
+def ASSERT32(x): return ASSERT(x)
+
+DATAMODEL_MASK = 0x0FF00000
+DATAMODEL_ILP32 = 0x00100000
+DATAMODEL_LP64 = 0x00200000
+DATAMODEL_NONE = 0
+DATAMODEL_NATIVE = DATAMODEL_LP64
+DATAMODEL_NATIVE = DATAMODEL_ILP32
+def STRUCT_SIZE(handle): return \
+
+def STRUCT_BUF(handle): return ((handle).ptr.m64)
+
+def SIZEOF_PTR(umodel): return \
+
+def STRUCT_SIZE(handle): return (sizeof (*(handle).ptr))
+
+def STRUCT_BUF(handle): return ((handle).ptr)
+
+def SIZEOF_PTR(umodel): return sizeof (caddr_t)
+
+def lwp_getdatamodel(t): return DATAMODEL_ILP32
+
+RUSAGE_SELF = 0
+RUSAGE_CHILDREN = -1
# Included from vm/seg_enum.h
# Included from sys/buf.h
# Included from sys/kstat.h
-KSTAT_IOC_BASE = (ord('K') << 8)
-KSTAT_IOC_CHAIN_ID = KSTAT_IOC_BASE | 0x01
-KSTAT_IOC_READ = KSTAT_IOC_BASE | 0x02
-KSTAT_IOC_WRITE = KSTAT_IOC_BASE | 0x03
+from TYPES import *
KSTAT_STRLEN = 31
def KSTAT_ENTER(k): return \
@@ -754,10 +935,18 @@ KSTAT_FLAG_INVALID = 0x20
KSTAT_READ = 0
KSTAT_WRITE = 1
KSTAT_DATA_CHAR = 0
-KSTAT_DATA_LONG = 1
-KSTAT_DATA_ULONG = 2
-KSTAT_DATA_LONGLONG = 3
-KSTAT_DATA_ULONGLONG = 4
+KSTAT_DATA_INT32 = 1
+KSTAT_DATA_UINT32 = 2
+KSTAT_DATA_INT64 = 3
+KSTAT_DATA_UINT64 = 4
+KSTAT_DATA_LONG = KSTAT_DATA_INT32
+KSTAT_DATA_ULONG = KSTAT_DATA_UINT32
+KSTAT_DATA_LONG = KSTAT_DATA_INT64
+KSTAT_DATA_ULONG = KSTAT_DATA_UINT64
+KSTAT_DATA_LONG = 7
+KSTAT_DATA_ULONG = 8
+KSTAT_DATA_LONGLONG = KSTAT_DATA_INT64
+KSTAT_DATA_ULONGLONG = KSTAT_DATA_UINT64
KSTAT_DATA_FLOAT = 5
KSTAT_DATA_DOUBLE = 6
KSTAT_INTR_HARD = 0
@@ -769,12 +958,12 @@ KSTAT_NUM_INTRS = 5
B_BUSY = 0x0001
B_DONE = 0x0002
B_ERROR = 0x0004
-B_KERNBUF = 0x0008
B_PAGEIO = 0x0010
B_PHYS = 0x0020
B_READ = 0x0040
-B_WANTED = 0x0080
B_WRITE = 0x0100
+B_KERNBUF = 0x0008
+B_WANTED = 0x0080
B_AGE = 0x000200
B_ASYNC = 0x000400
B_DELWRI = 0x000800
@@ -787,8 +976,14 @@ B_FORCE = 0x020000
B_HEAD = 0x040000
B_NOCACHE = 0x080000
B_TRUNC = 0x100000
+B_SHADOW = 0x200000
+B_RETRYWRI = 0x400000
def notavail(bp): return \
+def BWRITE(bp): return \
+
+def BWRITE2(bp): return \
+
VROOT = 0x01
VNOCACHE = 0x02
VNOMAP = 0x04
@@ -800,6 +995,9 @@ VSWAPLIKE = 0x80
VVFSLOCK = 0x100
VVFSWAIT = 0x200
VVMLOCK = 0x400
+VDIROPEN = 0x800
+VVMEXEC = 0x1000
+VPXFS = 0x2000
AT_TYPE = 0x0001
AT_MODE = 0x0002
AT_UID = 0x0004
@@ -838,10 +1036,14 @@ VSA_ACLCNT = 0x0002
VSA_DFACL = 0x0004
VSA_DFACLCNT = 0x0008
LOOKUP_DIR = 0x01
+DUMP_ALLOC = 0
+DUMP_FREE = 1
+DUMP_SCAN = 2
ATTR_UTIME = 0x01
ATTR_EXEC = 0x02
ATTR_COMM = 0x04
ATTR_HINT = 0x08
+ATTR_REAL = 0x10
# Included from sys/poll.h
POLLIN = 0x0001
@@ -855,35 +1057,78 @@ POLLNORM = POLLRDNORM
POLLERR = 0x0008
POLLHUP = 0x0010
POLLNVAL = 0x0020
-T_POLLTIME = 0x01
-T_POLLWAKE = 0x02
+POLLREMOVE = 0x0800
+POLLRDDATA = 0x0200
+POLLNOERR = 0x0400
+POLLCLOSED = 0x8000
# Included from sys/strmdep.h
-def str_aligned(X): return (((uint)(X) & (sizeof (int) - 1)) == 0)
-
-QENAB = 0x001
-QWANTR = 0x002
-QWANTW = 0x004
-QFULL = 0x008
-QREADR = 0x010
-QUSE = 0x020
-QNOENB = 0x040
-QOLD = 0x080
-QBACK = 0x100
-QHLIST = 0x200
-QUNSAFE = 0x400
-QPAIR = 0x800
-QPERQ = 0x1000
-QPERMOD = 0x2000
-QMTSAFE = 0x4000
-QMTOUTPERIM = 0x8000
-QMT_TYPEMASK = (QUNSAFE|QPAIR|QPERQ|QPERMOD|QMTSAFE|QMTOUTPERIM)
-QINSERVICE = 0x10000
-QWCLOSE = 0x20000
-QEND = 0x40000
-QWANTWSYNC = 0x80000
-QSYNCSTR = 0x100000
-QISDRV = 0x200000
+def str_aligned(X): return (((ulong_t)(X) & (sizeof (long) - 1)) == 0)
+
+
+# Included from sys/strft.h
+tdelta_t_sz = 12
+FTEV_MASK = 0x1FFF
+FTEV_ISWR = 0x8000
+FTEV_CS = 0x4000
+FTEV_PS = 0x2000
+FTEV_QMASK = 0x1F00
+FTEV_ALLOCMASK = 0x1FF8
+FTEV_ALLOCB = 0x0000
+FTEV_ESBALLOC = 0x0001
+FTEV_DESBALLOC = 0x0002
+FTEV_ESBALLOCA = 0x0003
+FTEV_DESBALLOCA = 0x0004
+FTEV_ALLOCBIG = 0x0005
+FTEV_ALLOCBW = 0x0006
+FTEV_FREEB = 0x0008
+FTEV_DUPB = 0x0009
+FTEV_COPYB = 0x000A
+FTEV_CALLER = 0x000F
+FTEV_PUT = 0x0100
+FTEV_FSYNCQ = 0x0103
+FTEV_DSYNCQ = 0x0104
+FTEV_PUTQ = 0x0105
+FTEV_GETQ = 0x0106
+FTEV_RMVQ = 0x0107
+FTEV_INSQ = 0x0108
+FTEV_PUTBQ = 0x0109
+FTEV_FLUSHQ = 0x010A
+FTEV_REPLYQ = 0x010B
+FTEV_PUTNEXT = 0x010D
+FTEV_RWNEXT = 0x010E
+FTEV_QWINNER = 0x010F
+FTEV_GEWRITE = 0x0101
+def FTFLW_HASH(h): return (((unsigned)(h))%ftflw_hash_sz)
+
+FTBLK_EVNTS = 0x9
+QENAB = 0x00000001
+QWANTR = 0x00000002
+QWANTW = 0x00000004
+QFULL = 0x00000008
+QREADR = 0x00000010
+QUSE = 0x00000020
+QNOENB = 0x00000040
+QBACK = 0x00000100
+QHLIST = 0x00000200
+QPAIR = 0x00000800
+QPERQ = 0x00001000
+QPERMOD = 0x00002000
+QMTSAFE = 0x00004000
+QMTOUTPERIM = 0x00008000
+QMT_TYPEMASK = (QPAIR|QPERQ|QPERMOD|QMTSAFE|QMTOUTPERIM)
+QINSERVICE = 0x00010000
+QWCLOSE = 0x00020000
+QEND = 0x00040000
+QWANTWSYNC = 0x00080000
+QSYNCSTR = 0x00100000
+QISDRV = 0x00200000
+QHOT = 0x00400000
+QNEXTHOT = 0x00800000
+_QINSERTING = 0x04000000
+_QREMOVING = 0x08000000
+Q_SQQUEUED = 0x01
+Q_SQDRAINING = 0x02
QB_FULL = 0x01
QB_WANTW = 0x02
QB_BACK = 0x04
@@ -892,13 +1137,18 @@ STRUIOT_NONE = -1
STRUIOT_DONTCARE = 0
STRUIOT_STANDARD = 1
STRUIOT_IP = 2
+DBLK_REFMIN = 0x01
STRUIO_SPEC = 0x01
STRUIO_DONE = 0x02
STRUIO_IP = 0x04
+STRUIO_ZC = 0x08
+STRUIO_ICK = 0x10
MSGMARK = 0x01
MSGNOLOOP = 0x02
MSGDELIM = 0x04
MSGNOGET = 0x08
+MSGMARKNEXT = 0x10
+MSGNOTMARKNEXT = 0x20
M_DATA = 0x00
M_PROTO = 0x01
M_BREAK = 0x08
@@ -910,7 +1160,6 @@ M_CTL = 0x0d
M_IOCTL = 0x0e
M_SETOPTS = 0x10
M_RSE = 0x11
-M_VPIXINT = 0x12
M_IOCACK = 0x81
M_IOCNAK = 0x82
M_PCPROTO = 0x83
@@ -931,6 +1180,11 @@ M_PCEVENT = 0x91
M_UNHANGUP = 0x92
QNORM = 0x00
QPCTL = 0x80
+IOC_MODELS = DATAMODEL_MASK
+IOC_ILP32 = DATAMODEL_ILP32
+IOC_LP64 = DATAMODEL_LP64
+IOC_NATIVE = DATAMODEL_NATIVE
+IOC_NONE = DATAMODEL_NONE
STRCANON = 0x01
RECOPY = 0x02
SO_ALL = 0x003f
@@ -953,6 +1207,8 @@ SO_DELIM = 0x8000
SO_NODELIM = 0x010000
SO_STRHOLD = 0x020000
SO_ERROPT = 0x040000
+SO_COPYOPT = 0x080000
+SO_MAXBLK = 0x100000
DEF_IOV_MAX = 16
INFOD_FIRSTBYTES = 0x02
INFOD_BYTES = 0x04
@@ -960,15 +1216,15 @@ INFOD_COUNT = 0x08
INFOD_COPYOUT = 0x10
MODOPEN = 0x1
CLONEOPEN = 0x2
+CONSOPEN = 0x4
OPENFAIL = -1
BPRI_LO = 1
BPRI_MED = 2
BPRI_HI = 3
+BPRI_FT = 4
INFPSZ = -1
FLUSHALL = 1
FLUSHDATA = 0
-STIPRI = PZERO+3
-STOPRI = PZERO+3
STRHIGH = 5120
STRLOW = 1024
MAXIOCBSZ = 1024
@@ -976,7 +1232,7 @@ PERIM_INNER = 1
PERIM_OUTER = 2
def datamsg(type): return \
-def straln(a): return (caddr_t)((long)(a) & ~(sizeof (int)-1))
+def straln(a): return (caddr_t)((intptr_t)(a) & ~(sizeof (int)-1))
# Included from sys/byteorder.h
@@ -989,6 +1245,7 @@ def htonl(x): return (x)
def htons(x): return (x)
IPPROTO_IP = 0
+IPPROTO_HOPOPTS = 0
IPPROTO_ICMP = 1
IPPROTO_IGMP = 2
IPPROTO_GGP = 3
@@ -998,9 +1255,19 @@ IPPROTO_EGP = 8
IPPROTO_PUP = 12
IPPROTO_UDP = 17
IPPROTO_IDP = 22
+IPPROTO_IPV6 = 41
+IPPROTO_ROUTING = 43
+IPPROTO_FRAGMENT = 44
+IPPROTO_RSVP = 46
+IPPROTO_ESP = 50
+IPPROTO_AH = 51
+IPPROTO_ICMPV6 = 58
+IPPROTO_NONE = 59
+IPPROTO_DSTOPTS = 60
IPPROTO_HELLO = 63
IPPROTO_ND = 77
IPPROTO_EON = 80
+IPPROTO_PIM = 103
IPPROTO_RAW = 255
IPPROTO_MAX = 256
IPPORT_ECHO = 7
@@ -1015,6 +1282,8 @@ IPPORT_TIMESERVER = 37
IPPORT_NAMESERVER = 42
IPPORT_WHOIS = 43
IPPORT_MTP = 57
+IPPORT_BOOTPS = 67
+IPPORT_BOOTPC = 68
IPPORT_TFTP = 69
IPPORT_RJE = 77
IPPORT_FINGER = 79
@@ -1032,43 +1301,71 @@ IPPORT_USERRESERVED = 5000
IMPLINK_IP = 155
IMPLINK_LOWEXPER = 156
IMPLINK_HIGHEXPER = 158
-def IN_CLASSA(i): return (((long)(i) & 0x80000000) == 0)
-
-IN_CLASSA_NET = 0xff000000
IN_CLASSA_NSHIFT = 24
-IN_CLASSA_HOST = 0x00ffffff
IN_CLASSA_MAX = 128
-def IN_CLASSB(i): return (((long)(i) & 0xc0000000) == 0x80000000)
-
-IN_CLASSB_NET = 0xffff0000
IN_CLASSB_NSHIFT = 16
-IN_CLASSB_HOST = 0x0000ffff
IN_CLASSB_MAX = 65536
-def IN_CLASSC(i): return (((long)(i) & 0xe0000000) == 0xc0000000)
-
-IN_CLASSC_NET = 0xffffff00
IN_CLASSC_NSHIFT = 8
-IN_CLASSC_HOST = 0x000000ff
-def IN_CLASSD(i): return (((long)(i) & 0xf0000000) == 0xe0000000)
-
-IN_CLASSD_NET = 0xf0000000
IN_CLASSD_NSHIFT = 28
-IN_CLASSD_HOST = 0x0fffffff
def IN_MULTICAST(i): return IN_CLASSD(i)
-def IN_EXPERIMENTAL(i): return (((long)(i) & 0xe0000000) == 0xe0000000)
-
-def IN_BADCLASS(i): return (((long)(i) & 0xf0000000) == 0xf0000000)
-
-INADDR_ANY = 0x00000000
-INADDR_LOOPBACK = 0x7F000001
-INADDR_BROADCAST = 0xffffffff
-INADDR_UNSPEC_GROUP = 0xe0000000
-INADDR_ALLHOSTS_GROUP = 0xe0000001
-INADDR_MAX_LOCAL_GROUP = 0xe00000ff
IN_LOOPBACKNET = 127
def IN_SET_LOOPBACK_ADDR(a): return \
+def IN6_IS_ADDR_UNSPECIFIED(addr): return \
+
+def IN6_IS_ADDR_LOOPBACK(addr): return \
+
+def IN6_IS_ADDR_LOOPBACK(addr): return \
+
+def IN6_IS_ADDR_MULTICAST(addr): return \
+
+def IN6_IS_ADDR_MULTICAST(addr): return \
+
+def IN6_IS_ADDR_LINKLOCAL(addr): return \
+
+def IN6_IS_ADDR_LINKLOCAL(addr): return \
+
+def IN6_IS_ADDR_SITELOCAL(addr): return \
+
+def IN6_IS_ADDR_SITELOCAL(addr): return \
+
+def IN6_IS_ADDR_V4MAPPED(addr): return \
+
+def IN6_IS_ADDR_V4MAPPED(addr): return \
+
+def IN6_IS_ADDR_V4MAPPED_ANY(addr): return \
+
+def IN6_IS_ADDR_V4MAPPED_ANY(addr): return \
+
+def IN6_IS_ADDR_V4COMPAT(addr): return \
+
+def IN6_IS_ADDR_V4COMPAT(addr): return \
+
+def IN6_IS_ADDR_MC_RESERVED(addr): return \
+
+def IN6_IS_ADDR_MC_RESERVED(addr): return \
+
+def IN6_IS_ADDR_MC_NODELOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_NODELOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_LINKLOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_LINKLOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_SITELOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_SITELOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_ORGLOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_ORGLOCAL(addr): return \
+
+def IN6_IS_ADDR_MC_GLOBAL(addr): return \
+
+def IN6_IS_ADDR_MC_GLOBAL(addr): return \
+
IP_OPTIONS = 1
IP_HDRINCL = 2
IP_TOS = 3
@@ -1082,5 +1379,43 @@ IP_MULTICAST_TTL = 0x11
IP_MULTICAST_LOOP = 0x12
IP_ADD_MEMBERSHIP = 0x13
IP_DROP_MEMBERSHIP = 0x14
+IP_SEC_OPT = 0x22
+IPSEC_PREF_NEVER = 0x01
+IPSEC_PREF_REQUIRED = 0x02
+IPSEC_PREF_UNIQUE = 0x04
+IP_ADD_PROXY_ADDR = 0x40
+IP_BOUND_IF = 0x41
+IP_UNSPEC_SRC = 0x42
+IP_REUSEADDR = 0x104
+IP_DONTROUTE = 0x105
+IP_BROADCAST = 0x106
IP_DEFAULT_MULTICAST_TTL = 1
IP_DEFAULT_MULTICAST_LOOP = 1
+IPV6_RTHDR_TYPE_0 = 0
+IPV6_UNICAST_HOPS = 0x5
+IPV6_MULTICAST_IF = 0x6
+IPV6_MULTICAST_HOPS = 0x7
+IPV6_MULTICAST_LOOP = 0x8
+IPV6_JOIN_GROUP = 0x9
+IPV6_LEAVE_GROUP = 0xa
+IPV6_ADD_MEMBERSHIP = 0x9
+IPV6_DROP_MEMBERSHIP = 0xa
+IPV6_PKTINFO = 0xb
+IPV6_HOPLIMIT = 0xc
+IPV6_NEXTHOP = 0xd
+IPV6_HOPOPTS = 0xe
+IPV6_DSTOPTS = 0xf
+IPV6_RTHDR = 0x10
+IPV6_RTHDRDSTOPTS = 0x11
+IPV6_RECVPKTINFO = 0x12
+IPV6_RECVHOPLIMIT = 0x13
+IPV6_RECVHOPOPTS = 0x14
+IPV6_RECVDSTOPTS = 0x15
+IPV6_RECVRTHDR = 0x16
+IPV6_RECVRTHDRDSTOPTS = 0x17
+IPV6_CHECKSUM = 0x18
+IPV6_BOUND_IF = 0x41
+IPV6_UNSPEC_SRC = 0x42
+INET_ADDRSTRLEN = 16
+INET6_ADDRSTRLEN = 46
+IPV6_PAD1_OPT = 0
diff --git a/Lib/plat-sunos5/STROPTS.py b/Lib/plat-sunos5/STROPTS.py
index b75ae4e..19173bb 100644
--- a/Lib/plat-sunos5/STROPTS.py
+++ b/Lib/plat-sunos5/STROPTS.py
@@ -1,19 +1,21 @@
# Generated by h2py from /usr/include/sys/stropts.h
# Included from sys/feature_tests.h
-_POSIX_C_SOURCE = 1
-_LARGEFILE64_SOURCE = 1
-_LARGEFILE_SOURCE = 1
-_FILE_OFFSET_BITS = 32
-_XOPEN_VERSION = 4
-_XOPEN_VERSION = 3
-
-# Included from sys/types.h
# Included from sys/isa_defs.h
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
+_LONG_ALIGNMENT = 8
+_LONG_LONG_ALIGNMENT = 8
+_DOUBLE_ALIGNMENT = 8
+_LONG_DOUBLE_ALIGNMENT = 16
+_POINTER_ALIGNMENT = 8
+_MAX_ALIGNMENT = 16
+_ALIGNMENT_REQUIRED = 1
+_CHAR_ALIGNMENT = 1
+_SHORT_ALIGNMENT = 2
+_INT_ALIGNMENT = 4
_LONG_ALIGNMENT = 4
_LONG_LONG_ALIGNMENT = 4
_DOUBLE_ALIGNMENT = 4
@@ -24,16 +26,6 @@ _ALIGNMENT_REQUIRED = 0
_CHAR_ALIGNMENT = 1
_SHORT_ALIGNMENT = 2
_INT_ALIGNMENT = 4
-_LONG_ALIGNMENT = 4
-_LONG_LONG_ALIGNMENT = 8
-_DOUBLE_ALIGNMENT = 8
-_LONG_DOUBLE_ALIGNMENT = 16
-_POINTER_ALIGNMENT = 4
-_MAX_ALIGNMENT = 16
-_ALIGNMENT_REQUIRED = 1
-_CHAR_ALIGNMENT = 1
-_SHORT_ALIGNMENT = 2
-_INT_ALIGNMENT = 4
_LONG_LONG_ALIGNMENT = 8
_DOUBLE_ALIGNMENT = 8
_ALIGNMENT_REQUIRED = 1
@@ -45,186 +37,53 @@ _LONG_ALIGNMENT = 8
_LONG_DOUBLE_ALIGNMENT = 16
_POINTER_ALIGNMENT = 8
_MAX_ALIGNMENT = 16
-
-# Included from sys/machtypes.h
-
-# Included from sys/int_types.h
-SHRT_MIN = (-32768)
-SHRT_MAX = 32767
-USHRT_MAX = 65535
-INT_MIN = (-2147483647-1)
-INT_MAX = 2147483647
-LONG_MIN = (-9223372036854775807L-1L)
-LONG_MAX = 9223372036854775807L
-LONG_MIN = (-2147483647L-1L)
-LONG_MAX = 2147483647L
-P_MYID = (-1)
-
-# Included from sys/select.h
-
-# Included from sys/time.h
-DST_NONE = 0
-DST_USA = 1
-DST_AUST = 2
-DST_WET = 3
-DST_MET = 4
-DST_EET = 5
-DST_CAN = 6
-DST_GB = 7
-DST_RUM = 8
-DST_TUR = 9
-DST_AUSTALT = 10
-ITIMER_REAL = 0
-ITIMER_VIRTUAL = 1
-ITIMER_PROF = 2
-ITIMER_REALPROF = 3
-SEC = 1
-MILLISEC = 1000
-MICROSEC = 1000000
-NANOSEC = 1000000000
-__CLOCK_REALTIME0 = 0
-CLOCK_VIRTUAL = 1
-CLOCK_PROF = 2
-__CLOCK_REALTIME3 = 3
-CLOCK_REALTIME = __CLOCK_REALTIME3
-CLOCK_REALTIME = __CLOCK_REALTIME0
-TIMER_RELTIME = 0x0
-TIMER_ABSTIME = 0x1
-
-# Included from sys/mutex.h
-def MUTEX_HELD(x): return (mutex_owned(x))
-
-def TICK_TO_SEC(tick): return ((tick) / hz)
-
-def SEC_TO_TICK(sec): return ((sec) * hz)
-
-def TICK_TO_MSEC(tick): return \
-
-def MSEC_TO_TICK(msec): return \
-
-def MSEC_TO_TICK_ROUNDUP(msec): return \
-
-def TICK_TO_USEC(tick): return ((tick) * usec_per_tick)
-
-def USEC_TO_TICK(usec): return ((usec) / usec_per_tick)
-
-def USEC_TO_TICK_ROUNDUP(usec): return \
-
-def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick)
-
-def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick)
-
-def NSEC_TO_TICK_ROUNDUP(nsec): return \
-
-def TIMEVAL_TO_TICK(tvp): return \
-
-def TIMESTRUC_TO_TICK(tsp): return \
-
-
-# Included from time.h
-NULL = 0
-CLOCKS_PER_SEC = 1000000
-
-# Included from sys/siginfo.h
-SIGEV_NONE = 1
-SIGEV_SIGNAL = 2
-SIGEV_THREAD = 3
-SI_NOINFO = 32767
-SI_USER = 0
-SI_LWP = (-1)
-SI_QUEUE = (-2)
-SI_TIMER = (-3)
-SI_ASYNCIO = (-4)
-SI_MESGQ = (-5)
-
-# Included from sys/machsig.h
-ILL_ILLOPC = 1
-ILL_ILLOPN = 2
-ILL_ILLADR = 3
-ILL_ILLTRP = 4
-ILL_PRVOPC = 5
-ILL_PRVREG = 6
-ILL_COPROC = 7
-ILL_BADSTK = 8
-NSIGILL = 8
-EMT_TAGOVF = 1
-NSIGEMT = 1
-FPE_INTDIV = 1
-FPE_INTOVF = 2
-FPE_FLTDIV = 3
-FPE_FLTOVF = 4
-FPE_FLTUND = 5
-FPE_FLTRES = 6
-FPE_FLTINV = 7
-FPE_FLTSUB = 8
-NSIGFPE = 8
-SEGV_MAPERR = 1
-SEGV_ACCERR = 2
-NSIGSEGV = 2
-BUS_ADRALN = 1
-BUS_ADRERR = 2
-BUS_OBJERR = 3
-NSIGBUS = 3
-TRAP_BRKPT = 1
-TRAP_TRACE = 2
-TRAP_RWATCH = 3
-TRAP_WWATCH = 4
-TRAP_XWATCH = 5
-NSIGTRAP = 5
-CLD_EXITED = 1
-CLD_KILLED = 2
-CLD_DUMPED = 3
-CLD_TRAPPED = 4
-CLD_STOPPED = 5
-CLD_CONTINUED = 6
-NSIGCLD = 6
-POLL_IN = 1
-POLL_OUT = 2
-POLL_MSG = 3
-POLL_ERR = 4
-POLL_PRI = 5
-POLL_HUP = 6
-NSIGPOLL = 6
-PROF_SIG = 1
-NSIGPROF = 1
-SI_MAXSZ = 128
-def SI_CANQUEUE(c): return ((c) <= SI_QUEUE)
-
-FD_SETSIZE = 1024
-_NBBY = 8
-NBBY = _NBBY
+_POSIX_C_SOURCE = 1
+_LARGEFILE64_SOURCE = 1
+_LARGEFILE_SOURCE = 1
+_FILE_OFFSET_BITS = 64
+_FILE_OFFSET_BITS = 32
+_POSIX_C_SOURCE = 199506L
+_POSIX_PTHREAD_SEMANTICS = 1
+_XOPEN_VERSION = 500
+_XOPEN_VERSION = 4
+_XOPEN_VERSION = 3
+from TYPES import *
# Included from sys/conf.h
# Included from sys/t_lock.h
# Included from sys/machlock.h
+from TYPES import *
LOCK_HELD_VALUE = 0xff
def SPIN_LOCK(pl): return ((pl) > ipltospl(LOCK_LEVEL))
def LOCK_SAMPLE_INTERVAL(i): return (((i) & 0xff) == 0)
-LOCK_LEVEL = 10
CLOCK_LEVEL = 10
+LOCK_LEVEL = 10
+DISP_LEVEL = (LOCK_LEVEL + 1)
PTR24_LSB = 5
PTR24_MSB = (PTR24_LSB + 24)
PTR24_ALIGN = 32
PTR24_BASE = 0xe0000000
-# Included from sys/sleepq.h
-NSLEEPQ = 512
-
-# Included from sys/turnstile.h
-
# Included from sys/param.h
+from TYPES import *
_POSIX_VDISABLE = 0
MAX_INPUT = 512
MAX_CANON = 256
UID_NOBODY = 60001
GID_NOBODY = UID_NOBODY
UID_NOACCESS = 60002
-MAXPID = 30000
+MAX_TASKID = 999999
+MAX_MAXPID = 999999
+DEFAULT_MAXPID = 999999
+DEFAULT_JUMPPID = 100000
+DEFAULT_MAXPID = 30000
+DEFAULT_JUMPPID = 0
MAXUID = 2147483647
+MAXPROJID = MAXUID
MAXLINK = 32767
NMOUNT = 40
CANBSIZ = 256
@@ -232,27 +91,10 @@ NOFILE = 20
NGROUPS_UMIN = 0
NGROUPS_UMAX = 32
NGROUPS_MAX_DEFAULT = 16
-PMASK = 0177
-PCATCH = 0400
-PNOSTOP = 01000
-PSWP = 0
-PINOD = 10
-PSNDD = PINOD
-PAMAP = PINOD
-PPMAP = PAMAP
-PRIBIO = 20
-PZERO = 25
-PMEM = 0
NZERO = 20
-PPIPE = 26
-PVFS = 27
-PWAIT = 30
-PLOCK = 35
-PSLEP = 39
-PUSER = 60
-PIDLE = 127
+NULL = 0L
NULL = 0
-CMASK = 0
+CMASK = 022
CDLIMIT = (1L<<11)
NBPS = 0x20000
NBPSCTR = 512
@@ -271,8 +113,11 @@ MAXBSIZE = 8192
DEV_BSIZE = 512
DEV_BSHIFT = 9
MAXFRAG = 8
-MAXOFF_T = 0x7fffffff
-MAXOFFSET_T = MAXOFF_T
+MAXOFF32_T = 0x7fffffff
+MAXOFF_T = 0x7fffffffffffffffl
+MAXOFFSET_T = 0x7fffffffffffffffl
+MAXOFF_T = 0x7fffffffl
+MAXOFFSET_T = 0x7fffffff
def btodb(bytes): return \
def dbtob(db): return \
@@ -281,7 +126,10 @@ def lbtodb(bytes): return \
def ldbtob(db): return \
-NCARGS = 0x100000
+NCARGS32 = 0x100000
+NCARGS64 = 0x200000
+NCARGS = NCARGS64
+NCARGS = NCARGS32
FSHIFT = 8
FSCALE = (1<<FSHIFT)
def DELAY(n): return drv_usecwait(n)
@@ -298,25 +146,47 @@ def ptod(x): return ((x) << (PAGESHIFT - DEV_BSHIFT))
def ptob(x): return ((x) << PAGESHIFT)
-def btop(x): return ((u_int)((x) >> PAGESHIFT))
+def btop(x): return (((x) >> PAGESHIFT))
-def btopr(x): return ((u_int)(((x) + PAGEOFFSET) >> PAGESHIFT))
+def btopr(x): return ((((x) + PAGEOFFSET) >> PAGESHIFT))
def dtop(DD): return (((DD) + NDPP - 1) >> (PAGESHIFT - DEV_BSHIFT))
def dtopt(DD): return ((DD) >> (PAGESHIFT - DEV_BSHIFT))
-def PAGOFF(x): return (((uint)(x)) & PAGEOFFSET)
-
-_AIO_LISTIO_MAX = (256)
+_AIO_LISTIO_MAX = (4096)
_AIO_MAX = (-1)
-_AIO_PRIO_DELTA_MAX = (-1)
_MQ_OPEN_MAX = (32)
_MQ_PRIO_MAX = (32)
_SEM_NSEMS_MAX = INT_MAX
_SEM_VALUE_MAX = INT_MAX
# Included from sys/unistd.h
+_CS_PATH = 65
+_CS_LFS_CFLAGS = 68
+_CS_LFS_LDFLAGS = 69
+_CS_LFS_LIBS = 70
+_CS_LFS_LINTFLAGS = 71
+_CS_LFS64_CFLAGS = 72
+_CS_LFS64_LDFLAGS = 73
+_CS_LFS64_LIBS = 74
+_CS_LFS64_LINTFLAGS = 75
+_CS_XBS5_ILP32_OFF32_CFLAGS = 700
+_CS_XBS5_ILP32_OFF32_LDFLAGS = 701
+_CS_XBS5_ILP32_OFF32_LIBS = 702
+_CS_XBS5_ILP32_OFF32_LINTFLAGS = 703
+_CS_XBS5_ILP32_OFFBIG_CFLAGS = 705
+_CS_XBS5_ILP32_OFFBIG_LDFLAGS = 706
+_CS_XBS5_ILP32_OFFBIG_LIBS = 707
+_CS_XBS5_ILP32_OFFBIG_LINTFLAGS = 708
+_CS_XBS5_LP64_OFF64_CFLAGS = 709
+_CS_XBS5_LP64_OFF64_LDFLAGS = 710
+_CS_XBS5_LP64_OFF64_LIBS = 711
+_CS_XBS5_LP64_OFF64_LINTFLAGS = 712
+_CS_XBS5_LPBIG_OFFBIG_CFLAGS = 713
+_CS_XBS5_LPBIG_OFFBIG_LDFLAGS = 714
+_CS_XBS5_LPBIG_OFFBIG_LIBS = 715
+_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS = 716
_SC_ARG_MAX = 1
_SC_CHILD_MAX = 2
_SC_CLK_TCK = 3
@@ -380,21 +250,13 @@ _SC_RE_DUP_MAX = 61
_SC_XOPEN_CRYPT = 62
_SC_XOPEN_ENH_I18N = 63
_SC_XOPEN_SHM = 64
-_CS_PATH = 65
_SC_2_CHAR_TERM = 66
_SC_XOPEN_XCU_VERSION = 67
-_CS_LFS_CFLAGS = 68
-_CS_LFS_LDFLAGS = 69
-_CS_LFS_LIBS = 70
-_CS_LFS_LINTFLAGS = 71
-_CS_LFS64_CFLAGS = 72
-_CS_LFS64_LDFLAGS = 73
-_CS_LFS64_LIBS = 74
-_CS_LFS64_LINTFLAGS = 75
_SC_ATEXIT_MAX = 76
_SC_IOV_MAX = 77
_SC_XOPEN_UNIX = 78
_SC_PAGE_SIZE = _SC_PAGESIZE
+_SC_T_IOV_MAX = 79
_SC_PHYS_PAGES = 500
_SC_AVPHYS_PAGES = 501
_SC_COHER_BLKSZ = 503
@@ -408,6 +270,8 @@ _SC_DCACHE_BLKSZ = 510
_SC_DCACHE_TBLKSZ = 511
_SC_ICACHE_ASSOC = 512
_SC_DCACHE_ASSOC = 513
+_SC_MAXPID = 514
+_SC_STACK_PROT = 515
_SC_THREAD_DESTRUCTOR_ITERATIONS = 568
_SC_GETGR_R_SIZE_MAX = 569
_SC_GETPW_R_SIZE_MAX = 570
@@ -424,9 +288,13 @@ _SC_THREAD_PRIO_INHERIT = 580
_SC_THREAD_PRIO_PROTECT = 581
_SC_THREAD_PROCESS_SHARED = 582
_SC_THREAD_SAFE_FUNCTIONS = 583
-_SC_PPC_GRANULE_SZ = 601
-_SC_PPC_TB_TICKSPSECH = 602
-_SC_PPC_TB_TICKSPSECL = 603
+_SC_XOPEN_LEGACY = 717
+_SC_XOPEN_REALTIME = 718
+_SC_XOPEN_REALTIME_THREADS = 719
+_SC_XBS5_ILP32_OFF32 = 720
+_SC_XBS5_ILP32_OFFBIG = 721
+_SC_XBS5_LP64_OFF64 = 722
+_SC_XBS5_LPBIG_OFFBIG = 723
_PC_LINK_MAX = 1
_PC_MAX_CANON = 2
_PC_MAX_INPUT = 3
@@ -445,6 +313,9 @@ _POSIX_VERSION = 199506L
_POSIX2_VERSION = 199209L
_POSIX2_C_VERSION = 199209L
_XOPEN_XCU_VERSION = 4
+_XOPEN_REALTIME = 1
+_XOPEN_ENH_I18N = 1
+_XOPEN_SHM = 1
_POSIX2_C_BIND = 1
_POSIX2_CHAR_TERM = 1
_POSIX2_LOCALEDEF = 1
@@ -452,23 +323,13 @@ _POSIX2_C_DEV = 1
_POSIX2_SW_DEV = 1
_POSIX2_UPE = 1
-# Included from sys/pirec.h
-NTSTILE_SQ = 2
-TSTILE_FREE = 0
-TSTILE_ACTIVE = 1
-TS_ROWSZ = 512
-TS_COLSZ = 128
-TS_ROWBITS = 9
-TS_COLBITS = 7
-TS_ROWMASK = ((1 << TS_ROWBITS) - 1)
-def TS_COL(ts_id): return ((ts_id) >> TS_ROWBITS)
-
-def TS_ROW(ts_id): return ((ts_id) & TS_ROWMASK)
-
-def TSTILE_PRIO_INVERTED(ts): return \
+# Included from sys/mutex.h
+from TYPES import *
+def MUTEX_HELD(x): return (mutex_owned(x))
# Included from sys/rwlock.h
+from TYPES import *
def RW_READ_HELD(x): return (rw_read_held((x)))
def RW_WRITE_HELD(x): return (rw_write_held((x)))
@@ -481,12 +342,107 @@ def RW_ISWRITER(x): return (rw_iswriter(x))
# Included from sys/semaphore.h
# Included from sys/thread.h
+from TYPES import *
+
+# Included from sys/klwp.h
+from TYPES import *
# Included from sys/condvar.h
+from TYPES import *
+
+# Included from sys/time.h
+
+# Included from sys/types32.h
+
+# Included from sys/int_types.h
+TIME32_MAX = INT32_MAX
+TIME32_MIN = INT32_MIN
+def TIMEVAL_OVERFLOW(tv): return \
+
+from TYPES import *
+DST_NONE = 0
+DST_USA = 1
+DST_AUST = 2
+DST_WET = 3
+DST_MET = 4
+DST_EET = 5
+DST_CAN = 6
+DST_GB = 7
+DST_RUM = 8
+DST_TUR = 9
+DST_AUSTALT = 10
+ITIMER_REAL = 0
+ITIMER_VIRTUAL = 1
+ITIMER_PROF = 2
+ITIMER_REALPROF = 3
+def ITIMERVAL_OVERFLOW(itv): return \
+
+SEC = 1
+MILLISEC = 1000
+MICROSEC = 1000000
+NANOSEC = 1000000000
+
+# Included from sys/time_impl.h
+def TIMESPEC_OVERFLOW(ts): return \
+
+def ITIMERSPEC_OVERFLOW(it): return \
+
+__CLOCK_REALTIME0 = 0
+CLOCK_VIRTUAL = 1
+CLOCK_PROF = 2
+__CLOCK_REALTIME3 = 3
+CLOCK_HIGHRES = 4
+CLOCK_MAX = 5
+CLOCK_REALTIME = __CLOCK_REALTIME3
+CLOCK_REALTIME = __CLOCK_REALTIME0
+TIMER_RELTIME = 0x0
+TIMER_ABSTIME = 0x1
+def TICK_TO_SEC(tick): return ((tick) / hz)
+
+def SEC_TO_TICK(sec): return ((sec) * hz)
+
+def TICK_TO_MSEC(tick): return \
+
+def MSEC_TO_TICK(msec): return \
+
+def MSEC_TO_TICK_ROUNDUP(msec): return \
+
+def TICK_TO_USEC(tick): return ((tick) * usec_per_tick)
+
+def USEC_TO_TICK(usec): return ((usec) / usec_per_tick)
+
+def USEC_TO_TICK_ROUNDUP(usec): return \
+
+def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick)
+
+def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick)
+
+def NSEC_TO_TICK_ROUNDUP(nsec): return \
+
+def TIMEVAL_TO_TICK(tvp): return \
+
+def TIMESTRUC_TO_TICK(tsp): return \
+
+
+# Included from time.h
+from TYPES import *
+
+# Included from iso/time_iso.h
+NULL = 0L
+NULL = 0
+CLOCKS_PER_SEC = 1000000
+
+# Included from sys/select.h
+FD_SETSIZE = 65536
+FD_SETSIZE = 1024
+_NBBY = 8
+NBBY = _NBBY
+def FD_ZERO(p): return bzero((p), sizeof (*(p)))
-# Included from sys/klwp.h
# Included from sys/signal.h
+
+# Included from sys/iso/signal_iso.h
SIGHUP = 1
SIGINT = 2
SIGQUIT = 3
@@ -538,6 +494,79 @@ SIGHOLD = 0x200
SIGRELSE = 0x400
SIGIGNORE = 0x800
SIGPAUSE = 0x1000
+
+# Included from sys/siginfo.h
+from TYPES import *
+SIGEV_NONE = 1
+SIGEV_SIGNAL = 2
+SIGEV_THREAD = 3
+SI_NOINFO = 32767
+SI_USER = 0
+SI_LWP = (-1)
+SI_QUEUE = (-2)
+SI_TIMER = (-3)
+SI_ASYNCIO = (-4)
+SI_MESGQ = (-5)
+
+# Included from sys/machsig.h
+ILL_ILLOPC = 1
+ILL_ILLOPN = 2
+ILL_ILLADR = 3
+ILL_ILLTRP = 4
+ILL_PRVOPC = 5
+ILL_PRVREG = 6
+ILL_COPROC = 7
+ILL_BADSTK = 8
+NSIGILL = 8
+EMT_TAGOVF = 1
+EMT_CPCOVF = 2
+NSIGEMT = 2
+FPE_INTDIV = 1
+FPE_INTOVF = 2
+FPE_FLTDIV = 3
+FPE_FLTOVF = 4
+FPE_FLTUND = 5
+FPE_FLTRES = 6
+FPE_FLTINV = 7
+FPE_FLTSUB = 8
+NSIGFPE = 8
+SEGV_MAPERR = 1
+SEGV_ACCERR = 2
+NSIGSEGV = 2
+BUS_ADRALN = 1
+BUS_ADRERR = 2
+BUS_OBJERR = 3
+NSIGBUS = 3
+TRAP_BRKPT = 1
+TRAP_TRACE = 2
+TRAP_RWATCH = 3
+TRAP_WWATCH = 4
+TRAP_XWATCH = 5
+NSIGTRAP = 5
+CLD_EXITED = 1
+CLD_KILLED = 2
+CLD_DUMPED = 3
+CLD_TRAPPED = 4
+CLD_STOPPED = 5
+CLD_CONTINUED = 6
+NSIGCLD = 6
+POLL_IN = 1
+POLL_OUT = 2
+POLL_MSG = 3
+POLL_ERR = 4
+POLL_PRI = 5
+POLL_HUP = 6
+NSIGPOLL = 6
+PROF_SIG = 1
+NSIGPROF = 1
+SI_MAXSZ = 256
+SI_MAXSZ = 128
+
+# Included from sys/time_std_impl.h
+from TYPES import *
+SI32_MAXSZ = 128
+def SI_CANQUEUE(c): return ((c) <= SI_QUEUE)
+
SA_NOCLDSTOP = 0x00020000
SA_ONSTACK = 0x00000001
SA_RESETHAND = 0x00000002
@@ -561,8 +590,11 @@ SN_CANCEL = 2
SN_SEND = 3
# Included from sys/ucontext.h
+from TYPES import *
# Included from sys/regset.h
+REG_CCR = (0)
+REG_PSR = (0)
REG_PSR = (0)
REG_PC = (1)
REG_nPC = (2)
@@ -582,12 +614,17 @@ REG_O4 = (15)
REG_O5 = (16)
REG_O6 = (17)
REG_O7 = (18)
+REG_ASI = (19)
+REG_FPRS = (20)
REG_PS = REG_PSR
REG_SP = REG_O6
REG_R0 = REG_O0
REG_R1 = REG_O1
+_NGREG = 21
_NGREG = 19
NGREG = _NGREG
+_NGREG32 = 19
+_NGREG64 = 21
SPARC_MAXREGWINDOW = 31
MAXFPQ = 16
XRS_ID = 0x78727300
@@ -672,6 +709,7 @@ RD_NEGINF = 3
FPRS_DL = 0x1
FPRS_DU = 0x2
FPRS_FEF = 0x4
+PIL_MAX = 0xf
def SAVE_GLOBALS(RP): return \
def RESTORE_GLOBALS(RP): return \
@@ -698,7 +736,8 @@ UC_CPU = 004
UC_MAU = 010
UC_FPU = UC_MAU
UC_INTR = 020
-UC_MCONTEXT = (UC_CPU|UC_FPU)
+UC_ASR = 040
+UC_MCONTEXT = (UC_CPU|UC_FPU|UC_ASR)
UC_ALL = (UC_SIGMASK|UC_STACK|UC_MCONTEXT)
_SIGQUEUE_MAX = 32
_SIGNOTIFY_MAX = 32
@@ -707,6 +746,12 @@ _SIGNOTIFY_MAX = 32
INSTR_VALID = 0x02
NORMAL_STEP = 0x04
WATCH_STEP = 0x08
+CPC_OVERFLOW = 0x10
+ASYNC_HWERR = 0x20
+STEP_NONE = 0
+STEP_REQUESTED = 1
+STEP_ACTIVE = 2
+STEP_WASACTIVE = 3
# Included from sys/msacct.h
LMS_USER = 0
@@ -724,9 +769,22 @@ NMSTATES = 10
# Included from sys/lwp.h
# Included from sys/synch.h
-USYNC_THREAD = 0
-USYNC_PROCESS = 1
-TRACE_TYPE = 2
+from TYPES import *
+USYNC_THREAD = 0x00
+USYNC_PROCESS = 0x01
+LOCK_NORMAL = 0x00
+LOCK_ERRORCHECK = 0x02
+LOCK_RECURSIVE = 0x04
+USYNC_PROCESS_ROBUST = 0x08
+LOCK_PRIO_NONE = 0x00
+LOCK_PRIO_INHERIT = 0x10
+LOCK_PRIO_PROTECT = 0x20
+LOCK_STALL_NP = 0x00
+LOCK_ROBUST_NP = 0x40
+LOCK_OWNERDEAD = 0x1
+LOCK_NOTRECOVERABLE = 0x2
+LOCK_INITED = 0x4
+LOCK_UNMAPPED = 0x8
LWP_DETACHED = 0x00000040
LWP_SUSPENDED = 0x00000080
__LWP_ASLWP = 0x00000100
@@ -735,23 +793,6 @@ NORMALRETURN = 0
JUSTRETURN = 1
LWP_USER = 0x01
LWP_SYS = 0x02
-
-# Included from vm/page.h
-PAGE_HASHAVELEN = 4
-PAGE_HASHVPSHIFT = 6
-PG_EXCL = 0x0001
-PG_WAIT = 0x0002
-PG_PHYSCONTIG = 0x0004
-PG_MATCH_COLOR = 0x0008
-PG_FREE_LIST = 1
-PG_CACHE_LIST = 2
-PG_LIST_TAIL = 0
-PG_LIST_HEAD = 1
-PAGE_IO_INUSE = 0x1
-PAGE_IO_WANTED = 0x2
-P_FREE = 0x80
-def PP_SETAGED(pp): return ASSERT(PP_ISAGED(pp))
-
TS_FREE = 0x00
TS_SLEEP = 0x01
TS_RUN = 0x02
@@ -762,25 +803,25 @@ T_INTR_THREAD = 0x0001
T_WAKEABLE = 0x0002
T_TOMASK = 0x0004
T_TALLOCSTK = 0x0008
-T_LWPZOMB = 0x0010
T_WOULDBLOCK = 0x0020
T_DONTBLOCK = 0x0040
T_DONTPEND = 0x0080
T_SYS_PROF = 0x0100
T_WAITCVSEM = 0x0200
T_WATCHPT = 0x0400
-TP_WAITFOR = 0x001
-TP_HOLDLWP = 0x002
-TP_TWAIT = 0x004
-TP_LWPEXIT = 0x008
-TP_PRSTOP = 0x010
-TP_CHKPT = 0x020
-TP_EXITLWP = 0x040
-TP_PRVSTOP = 0x080
-TP_MSACCT = 0x100
-TP_STOPPING = 0x200
-TP_WATCHPT = 0x400
-TP_PAUSE = 0x800
+T_PANIC = 0x0800
+TP_HOLDLWP = 0x0002
+TP_TWAIT = 0x0004
+TP_LWPEXIT = 0x0008
+TP_PRSTOP = 0x0010
+TP_CHKPT = 0x0020
+TP_EXITLWP = 0x0040
+TP_PRVSTOP = 0x0080
+TP_MSACCT = 0x0100
+TP_STOPPING = 0x0200
+TP_WATCHPT = 0x0400
+TP_PAUSE = 0x0800
+TP_CHANGEBIND = 0x1000
TS_LOAD = 0x0001
TS_DONT_SWAP = 0x0002
TS_SWAPENQ = 0x0004
@@ -790,7 +831,9 @@ TS_UNPAUSE = 0x0200
TS_XSTART = 0x0400
TS_PSTART = 0x0800
TS_RESUME = 0x1000
-TS_ALLSTART = (TS_CSTART|TS_UNPAUSE|TS_XSTART|TS_PSTART|TS_RESUME)
+TS_CREATE = 0x2000
+TS_ALLSTART = \
+ (TS_CSTART|TS_UNPAUSE|TS_XSTART|TS_PSTART|TS_RESUME|TS_CREATE)
def CPR_VSTOPPED(t): return \
def THREAD_TRANSITION(tp): return thread_transition(tp);
@@ -806,58 +849,243 @@ NO_COMPETING_THREADS = 1
FMNAMESZ = 8
# Included from sys/systm.h
+from TYPES import *
-# Included from sys/varargs.h
+# Included from sys/proc.h
-# Included from sys/va_list.h
-def va_start(list): return __builtin_va_info(list)
+# Included from sys/cred.h
-NSYSCALL = 250
-SE_LOADABLE = 0x08
-SE_LOADED = 0x10
-SE_NOUNLOAD = 0x20
-SE_ARGC = 0x40
-NUMRC = 512
-NUMPHASE = 64
-PFCHAR = 10
-KPFCHILDSLP = 35
-KPFTRON = 36
-KPFTRON2 = 37
-KPFTROFF = 38
-KPT_SYSCALL = 0
-KPT_INTR = 1
-KPT_TRAP_RET = 2
-KPT_INT_KRET = 3
-KPT_INT_URET = 4
-KPT_SLEEP = 5
-KPT_WAKEUP = 6
-KPT_PSWTCH = 7
-KPT_SPL = 8
-KPT_CSERVE = 9
-KPT_RSERVE = 10
-KPT_UXMEMF = 11
-KPT_SWTCH = 12
-KPT_QSWTCH = 13
-KPT_STKBX = 14
-KPT_END = 15
-KPT_IDLE = 16
-KPT_PREEMPT = 17
-KPT_P_QSWTCH = 18
-KPT_LAST = 19
+# Included from sys/user.h
+from TYPES import *
-# Included from sys/devops.h
+# Included from sys/resource.h
+from TYPES import *
+PRIO_PROCESS = 0
+PRIO_PGRP = 1
+PRIO_USER = 2
+RLIMIT_CPU = 0
+RLIMIT_FSIZE = 1
+RLIMIT_DATA = 2
+RLIMIT_STACK = 3
+RLIMIT_CORE = 4
+RLIMIT_NOFILE = 5
+RLIMIT_VMEM = 6
+RLIMIT_AS = RLIMIT_VMEM
+RLIM_NLIMITS = 7
+RLIM_INFINITY = (-3l)
+RLIM_SAVED_MAX = (-2l)
+RLIM_SAVED_CUR = (-1l)
+RLIM_INFINITY = 0x7fffffff
+RLIM_SAVED_MAX = 0x7ffffffe
+RLIM_SAVED_CUR = 0x7ffffffd
+RLIM32_INFINITY = 0x7fffffff
+RLIM32_SAVED_MAX = 0x7ffffffe
+RLIM32_SAVED_CUR = 0x7ffffffd
-# Included from sys/cred.h
+# Included from sys/model.h
-# Included from sys/uio.h
+# Included from sys/debug.h
+def ASSERT64(x): return ASSERT(x)
+
+def ASSERT32(x): return ASSERT(x)
+
+DATAMODEL_MASK = 0x0FF00000
+DATAMODEL_ILP32 = 0x00100000
+DATAMODEL_LP64 = 0x00200000
+DATAMODEL_NONE = 0
+DATAMODEL_NATIVE = DATAMODEL_LP64
+DATAMODEL_NATIVE = DATAMODEL_ILP32
+def STRUCT_SIZE(handle): return \
+
+def STRUCT_BUF(handle): return ((handle).ptr.m64)
+
+def SIZEOF_PTR(umodel): return \
+
+def STRUCT_SIZE(handle): return (sizeof (*(handle).ptr))
+
+def STRUCT_BUF(handle): return ((handle).ptr)
+
+def SIZEOF_PTR(umodel): return sizeof (caddr_t)
+
+def lwp_getdatamodel(t): return DATAMODEL_ILP32
+
+RUSAGE_SELF = 0
+RUSAGE_CHILDREN = -1
+
+# Included from sys/auxv.h
+AT_NULL = 0
+AT_IGNORE = 1
+AT_EXECFD = 2
+AT_PHDR = 3
+AT_PHENT = 4
+AT_PHNUM = 5
+AT_PAGESZ = 6
+AT_BASE = 7
+AT_FLAGS = 8
+AT_ENTRY = 9
+AT_DCACHEBSIZE = 10
+AT_ICACHEBSIZE = 11
+AT_UCACHEBSIZE = 12
+AT_SUN_UID = 2000
+AT_SUN_RUID = 2001
+AT_SUN_GID = 2002
+AT_SUN_RGID = 2003
+AT_SUN_LDELF = 2004
+AT_SUN_LDSHDR = 2005
+AT_SUN_LDNAME = 2006
+AT_SUN_LPAGESZ = 2007
+AT_SUN_PLATFORM = 2008
+AT_SUN_HWCAP = 2009
+AT_SUN_IFLUSH = 2010
+AT_SUN_CPU = 2011
+AT_SUN_EMUL_ENTRY = 2012
+AT_SUN_EMUL_EXECFD = 2013
+AT_SUN_EXECNAME = 2014
+AT_SUN_MMU = 2015
+
+# Included from sys/errno.h
+EPERM = 1
+ENOENT = 2
+ESRCH = 3
+EINTR = 4
+EIO = 5
+ENXIO = 6
+E2BIG = 7
+ENOEXEC = 8
+EBADF = 9
+ECHILD = 10
+EAGAIN = 11
+ENOMEM = 12
+EACCES = 13
+EFAULT = 14
+ENOTBLK = 15
+EBUSY = 16
+EEXIST = 17
+EXDEV = 18
+ENODEV = 19
+ENOTDIR = 20
+EISDIR = 21
+EINVAL = 22
+ENFILE = 23
+EMFILE = 24
+ENOTTY = 25
+ETXTBSY = 26
+EFBIG = 27
+ENOSPC = 28
+ESPIPE = 29
+EROFS = 30
+EMLINK = 31
+EPIPE = 32
+EDOM = 33
+ERANGE = 34
+ENOMSG = 35
+EIDRM = 36
+ECHRNG = 37
+EL2NSYNC = 38
+EL3HLT = 39
+EL3RST = 40
+ELNRNG = 41
+EUNATCH = 42
+ENOCSI = 43
+EL2HLT = 44
+EDEADLK = 45
+ENOLCK = 46
+ECANCELED = 47
+ENOTSUP = 48
+EDQUOT = 49
+EBADE = 50
+EBADR = 51
+EXFULL = 52
+ENOANO = 53
+EBADRQC = 54
+EBADSLT = 55
+EDEADLOCK = 56
+EBFONT = 57
+EOWNERDEAD = 58
+ENOTRECOVERABLE = 59
+ENOSTR = 60
+ENODATA = 61
+ETIME = 62
+ENOSR = 63
+ENONET = 64
+ENOPKG = 65
+EREMOTE = 66
+ENOLINK = 67
+EADV = 68
+ESRMNT = 69
+ECOMM = 70
+EPROTO = 71
+ELOCKUNMAPPED = 72
+ENOTACTIVE = 73
+EMULTIHOP = 74
+EBADMSG = 77
+ENAMETOOLONG = 78
+EOVERFLOW = 79
+ENOTUNIQ = 80
+EBADFD = 81
+EREMCHG = 82
+ELIBACC = 83
+ELIBBAD = 84
+ELIBSCN = 85
+ELIBMAX = 86
+ELIBEXEC = 87
+EILSEQ = 88
+ENOSYS = 89
+ELOOP = 90
+ERESTART = 91
+ESTRPIPE = 92
+ENOTEMPTY = 93
+EUSERS = 94
+ENOTSOCK = 95
+EDESTADDRREQ = 96
+EMSGSIZE = 97
+EPROTOTYPE = 98
+ENOPROTOOPT = 99
+EPROTONOSUPPORT = 120
+ESOCKTNOSUPPORT = 121
+EOPNOTSUPP = 122
+EPFNOSUPPORT = 123
+EAFNOSUPPORT = 124
+EADDRINUSE = 125
+EADDRNOTAVAIL = 126
+ENETDOWN = 127
+ENETUNREACH = 128
+ENETRESET = 129
+ECONNABORTED = 130
+ECONNRESET = 131
+ENOBUFS = 132
+EISCONN = 133
+ENOTCONN = 134
+ESHUTDOWN = 143
+ETOOMANYREFS = 144
+ETIMEDOUT = 145
+ECONNREFUSED = 146
+EHOSTDOWN = 147
+EHOSTUNREACH = 148
+EWOULDBLOCK = EAGAIN
+EALREADY = 149
+EINPROGRESS = 150
+ESTALE = 151
+PSARGSZ = 80
+PSCOMSIZ = 14
+MAXCOMLEN = 16
+__KERN_NAUXV_IMPL = 19
+__KERN_NAUXV_IMPL = 21
+__KERN_NAUXV_IMPL = 21
+PSARGSZ = 80
+
+# Included from sys/watchpoint.h
+from TYPES import *
+
+# Included from vm/seg_enum.h
+
+# Included from sys/copyops.h
+from TYPES import *
# Included from sys/buf.h
# Included from sys/kstat.h
-KSTAT_IOC_BASE = (ord('K') << 8)
-KSTAT_IOC_CHAIN_ID = KSTAT_IOC_BASE | 0x01
-KSTAT_IOC_READ = KSTAT_IOC_BASE | 0x02
-KSTAT_IOC_WRITE = KSTAT_IOC_BASE | 0x03
+from TYPES import *
KSTAT_STRLEN = 31
def KSTAT_ENTER(k): return \
@@ -882,10 +1110,14 @@ KSTAT_DATA_INT32 = 1
KSTAT_DATA_UINT32 = 2
KSTAT_DATA_INT64 = 3
KSTAT_DATA_UINT64 = 4
-KSTAT_DATA_LONG = 1
-KSTAT_DATA_ULONG = 2
-KSTAT_DATA_LONGLONG = 3
-KSTAT_DATA_ULONGLONG = 4
+KSTAT_DATA_LONG = KSTAT_DATA_INT32
+KSTAT_DATA_ULONG = KSTAT_DATA_UINT32
+KSTAT_DATA_LONG = KSTAT_DATA_INT64
+KSTAT_DATA_ULONG = KSTAT_DATA_UINT64
+KSTAT_DATA_LONG = 7
+KSTAT_DATA_ULONG = 8
+KSTAT_DATA_LONGLONG = KSTAT_DATA_INT64
+KSTAT_DATA_ULONGLONG = KSTAT_DATA_UINT64
KSTAT_DATA_FLOAT = 5
KSTAT_DATA_DOUBLE = 6
KSTAT_INTR_HARD = 0
@@ -916,8 +1148,197 @@ B_HEAD = 0x040000
B_NOCACHE = 0x080000
B_TRUNC = 0x100000
B_SHADOW = 0x200000
+B_RETRYWRI = 0x400000
def notavail(bp): return \
+def BWRITE(bp): return \
+
+def BWRITE2(bp): return \
+
+
+# Included from sys/aio_req.h
+
+# Included from sys/uio.h
+from TYPES import *
+WP_NOWATCH = 0x01
+WP_SETPROT = 0x02
+
+# Included from sys/timer.h
+from TYPES import *
+_TIMER_MAX = 32
+ITLK_LOCKED = 0x01
+ITLK_WANTED = 0x02
+ITLK_REMOVE = 0x04
+IT_PERLWP = 0x01
+IT_SIGNAL = 0x02
+
+# Included from sys/utrap.h
+UT_INSTRUCTION_DISABLED = 1
+UT_INSTRUCTION_ERROR = 2
+UT_INSTRUCTION_PROTECTION = 3
+UT_ILLTRAP_INSTRUCTION = 4
+UT_ILLEGAL_INSTRUCTION = 5
+UT_PRIVILEGED_OPCODE = 6
+UT_FP_DISABLED = 7
+UT_FP_EXCEPTION_IEEE_754 = 8
+UT_FP_EXCEPTION_OTHER = 9
+UT_TAG_OVERFLOW = 10
+UT_DIVISION_BY_ZERO = 11
+UT_DATA_EXCEPTION = 12
+UT_DATA_ERROR = 13
+UT_DATA_PROTECTION = 14
+UT_MEM_ADDRESS_NOT_ALIGNED = 15
+UT_PRIVILEGED_ACTION = 16
+UT_ASYNC_DATA_ERROR = 17
+UT_TRAP_INSTRUCTION_16 = 18
+UT_TRAP_INSTRUCTION_17 = 19
+UT_TRAP_INSTRUCTION_18 = 20
+UT_TRAP_INSTRUCTION_19 = 21
+UT_TRAP_INSTRUCTION_20 = 22
+UT_TRAP_INSTRUCTION_21 = 23
+UT_TRAP_INSTRUCTION_22 = 24
+UT_TRAP_INSTRUCTION_23 = 25
+UT_TRAP_INSTRUCTION_24 = 26
+UT_TRAP_INSTRUCTION_25 = 27
+UT_TRAP_INSTRUCTION_26 = 28
+UT_TRAP_INSTRUCTION_27 = 29
+UT_TRAP_INSTRUCTION_28 = 30
+UT_TRAP_INSTRUCTION_29 = 31
+UT_TRAP_INSTRUCTION_30 = 32
+UT_TRAP_INSTRUCTION_31 = 33
+UTRAP_V8P_FP_DISABLED = UT_FP_DISABLED
+UTRAP_V8P_MEM_ADDRESS_NOT_ALIGNED = UT_MEM_ADDRESS_NOT_ALIGNED
+UT_PRECISE_MAXTRAPS = 33
+
+# Included from sys/refstr.h
+
+# Included from sys/task.h
+from TYPES import *
+TASK_NORMAL = 0x0
+TASK_FINAL = 0x1
+TASK_FINALITY = 0x1
+
+# Included from sys/id_space.h
+from TYPES import *
+
+# Included from sys/vmem.h
+from TYPES import *
+VM_SLEEP = 0x00000000
+VM_NOSLEEP = 0x00000001
+VM_PANIC = 0x00000002
+VM_KMFLAGS = 0x000000ff
+VM_BESTFIT = 0x00000100
+VMEM_ALLOC = 0x01
+VMEM_FREE = 0x02
+VMEM_SPAN = 0x10
+ISP_NORMAL = 0x0
+ISP_RESERVE = 0x1
+
+# Included from sys/exacct_impl.h
+from TYPES import *
+
+# Included from sys/kmem.h
+from TYPES import *
+KM_SLEEP = 0x0000
+KM_NOSLEEP = 0x0001
+KM_PANIC = 0x0002
+KM_VMFLAGS = 0x00ff
+KM_FLAGS = 0xffff
+KMC_NOTOUCH = 0x00010000
+KMC_NODEBUG = 0x00020000
+KMC_NOMAGAZINE = 0x00040000
+KMC_NOHASH = 0x00080000
+KMC_QCACHE = 0x00100000
+_ISA_IA32 = 0
+_ISA_IA64 = 1
+SSLEEP = 1
+SRUN = 2
+SZOMB = 3
+SSTOP = 4
+SIDL = 5
+SONPROC = 6
+CLDPEND = 0x0001
+CLDCONT = 0x0002
+SSYS = 0x00000001
+STRC = 0x00000002
+SLOAD = 0x00000008
+SLOCK = 0x00000010
+SPREXEC = 0x00000020
+SPROCTR = 0x00000040
+SPRFORK = 0x00000080
+SKILLED = 0x00000100
+SULOAD = 0x00000200
+SRUNLCL = 0x00000400
+SBPTADJ = 0x00000800
+SKILLCL = 0x00001000
+SOWEUPC = 0x00002000
+SEXECED = 0x00004000
+SPASYNC = 0x00008000
+SJCTL = 0x00010000
+SNOWAIT = 0x00020000
+SVFORK = 0x00040000
+SVFWAIT = 0x00080000
+EXITLWPS = 0x00100000
+HOLDFORK = 0x00200000
+SWAITSIG = 0x00400000
+HOLDFORK1 = 0x00800000
+COREDUMP = 0x01000000
+SMSACCT = 0x02000000
+ASLWP = 0x04000000
+SPRLOCK = 0x08000000
+NOCD = 0x10000000
+HOLDWATCH = 0x20000000
+SMSFORK = 0x40000000
+SDOCORE = 0x80000000
+FORREAL = 0
+JUSTLOOKING = 1
+SUSPEND_NORMAL = 0
+SUSPEND_PAUSE = 1
+NOCLASS = (-1)
+
+# Included from sys/dditypes.h
+DDI_DEVICE_ATTR_V0 = 0x0001
+DDI_NEVERSWAP_ACC = 0x00
+DDI_STRUCTURE_LE_ACC = 0x01
+DDI_STRUCTURE_BE_ACC = 0x02
+DDI_STRICTORDER_ACC = 0x00
+DDI_UNORDERED_OK_ACC = 0x01
+DDI_MERGING_OK_ACC = 0x02
+DDI_LOADCACHING_OK_ACC = 0x03
+DDI_STORECACHING_OK_ACC = 0x04
+DDI_DATA_SZ01_ACC = 1
+DDI_DATA_SZ02_ACC = 2
+DDI_DATA_SZ04_ACC = 4
+DDI_DATA_SZ08_ACC = 8
+VERS_ACCHDL = 0x0001
+DEVID_NONE = 0
+DEVID_SCSI3_WWN = 1
+DEVID_SCSI_SERIAL = 2
+DEVID_FAB = 3
+DEVID_ENCAP = 4
+DEVID_MAXTYPE = 4
+
+# Included from sys/varargs.h
+
+# Included from sys/va_list.h
+VA_ALIGN = 8
+def _ARGSIZEOF(t): return ((sizeof (t) + VA_ALIGN - 1) & ~(VA_ALIGN - 1))
+
+VA_ALIGN = 8
+def _ARGSIZEOF(t): return ((sizeof (t) + VA_ALIGN - 1) & ~(VA_ALIGN - 1))
+
+NSYSCALL = 256
+SE_32RVAL1 = 0x0
+SE_32RVAL2 = 0x1
+SE_64RVAL = 0x2
+SE_RVAL_MASK = 0x3
+SE_LOADABLE = 0x08
+SE_LOADED = 0x10
+SE_NOUNLOAD = 0x20
+SE_ARGC = 0x40
+
+# Included from sys/devops.h
+from TYPES import *
# Included from sys/poll.h
POLLIN = 0x0001
@@ -931,43 +1352,17 @@ POLLNORM = POLLRDNORM
POLLERR = 0x0008
POLLHUP = 0x0010
POLLNVAL = 0x0020
-POLLRDDATA = 0x200
-POLLNOERR = 0x400
-T_POLLTIME = 0x01
-T_POLLWAKE = 0x02
+POLLREMOVE = 0x0800
+POLLRDDATA = 0x0200
+POLLNOERR = 0x0400
+POLLCLOSED = 0x8000
# Included from vm/as.h
-# Included from sys/watchpoint.h
-
-# Included from vm/seg_enum.h
-
-# Included from sys/copyops.h
-WP_NOWATCH = 0x01
-WP_SETPROT = 0x02
-
# Included from vm/seg.h
# Included from sys/vnode.h
-
-# Included from sys/resource.h
-PRIO_PROCESS = 0
-PRIO_PGRP = 1
-PRIO_USER = 2
-RLIMIT_CPU = 0
-RLIMIT_FSIZE = 1
-RLIMIT_DATA = 2
-RLIMIT_STACK = 3
-RLIMIT_CORE = 4
-RLIMIT_NOFILE = 5
-RLIMIT_VMEM = 6
-RLIMIT_AS = RLIMIT_VMEM
-RLIM_NLIMITS = 7
-RLIM_INFINITY = 0x7fffffff
-RLIM_SAVED_MAX = 0x7ffffffe
-RLIM_SAVED_CUR = 0x7ffffffd
-RUSAGE_SELF = 0
-RUSAGE_CHILDREN = -1
+from TYPES import *
VROOT = 0x01
VNOCACHE = 0x02
VNOMAP = 0x04
@@ -980,6 +1375,8 @@ VVFSLOCK = 0x100
VVFSWAIT = 0x200
VVMLOCK = 0x400
VDIROPEN = 0x800
+VVMEXEC = 0x1000
+VPXFS = 0x2000
AT_TYPE = 0x0001
AT_MODE = 0x0002
AT_UID = 0x0004
@@ -1018,6 +1415,9 @@ VSA_ACLCNT = 0x0002
VSA_DFACL = 0x0004
VSA_DFACLCNT = 0x0008
LOOKUP_DIR = 0x01
+DUMP_ALLOC = 0
+DUMP_FREE = 1
+DUMP_SCAN = 2
ATTR_UTIME = 0x01
ATTR_EXEC = 0x02
ATTR_COMM = 0x04
@@ -1039,6 +1439,31 @@ def FC_ERRNO(fc): return ((unsigned)(fc) >> 8)
# Included from vm/hat.h
+from TYPES import *
+
+# Included from vm/page.h
+PAGE_HASHAVELEN = 4
+PAGE_HASHVPSHIFT = 6
+PG_EXCL = 0x0001
+PG_WAIT = 0x0002
+PG_PHYSCONTIG = 0x0004
+PG_MATCH_COLOR = 0x0008
+PG_NORELOC = 0x0010
+PG_FREE_LIST = 1
+PG_CACHE_LIST = 2
+PG_LIST_TAIL = 0
+PG_LIST_HEAD = 1
+def page_next_raw(PP): return page_nextn_raw((PP), 1)
+
+PAGE_IO_INUSE = 0x1
+PAGE_IO_WANTED = 0x2
+PGREL_NOTREL = 0x1
+PGREL_CLEAN = 0x2
+PGREL_MOD = 0x3
+P_FREE = 0x80
+P_NORELOC = 0x40
+def PP_SETAGED(pp): return ASSERT(PP_ISAGED(pp))
+
HAT_FLAGS_RESV = 0xFF000000
HAT_LOAD = 0x00
HAT_LOAD_LOCK = 0x01
@@ -1047,6 +1472,7 @@ HAT_LOAD_CONTIG = 0x10
HAT_LOAD_NOCONSIST = 0x20
HAT_LOAD_SHARE = 0x40
HAT_LOAD_REMAP = 0x80
+HAT_RELOAD_SHARE = 0x100
HAT_PLAT_ATTR_MASK = 0xF00000
HAT_PROT_MASK = 0x0F
HAT_NOFAULT = 0x10
@@ -1061,7 +1487,6 @@ HAT_NEVERSWAP = 0x0000
HAT_STRUCTURE_BE = 0x1000
HAT_STRUCTURE_LE = 0x2000
HAT_ENDIAN_MASK = 0x3000
-HAT_KMEM = 0x10000
HAT_COW = 0x0001
HAT_UNLOAD = 0x00
HAT_UNLOAD_NOSYNC = 0x02
@@ -1115,11 +1540,18 @@ HRM_SWSMONID = 1
SSL_NLEVELS = 4
SSL_BFACTOR = 4
SSL_LOG2BF = 2
+SEGP_ASYNC_FLUSH = 0x1
+SEGP_FORCE_WIRED = 0x2
+SEGP_SUCCESS = 0
+SEGP_FAIL = 1
def seg_pages(seg): return \
+IE_NOMEM = -1
AS_PAGLCK = 0x80
AS_CLAIMGAP = 0x40
AS_UNMAPWAIT = 0x20
+def AS_TYPE_64BIT(as): return \
+
AS_LREP_LINKEDLIST = 0
AS_LREP_SKIPLIST = 1
AS_MUTATION_THRESH = 225
@@ -1128,33 +1560,6 @@ AH_LO = 0x0
AH_HI = 0x1
AH_CONTAIN = 0x2
-# Included from sys/dditypes.h
-DDI_DEVICE_ATTR_V0 = 0x0001
-DDI_NEVERSWAP_ACC = 0x00
-DDI_STRUCTURE_LE_ACC = 0x01
-DDI_STRUCTURE_BE_ACC = 0x02
-DDI_STRICTORDER_ACC = 0x00
-DDI_UNORDERED_OK_ACC = 0x01
-DDI_MERGING_OK_ACC = 0x02
-DDI_LOADCACHING_OK_ACC = 0x03
-DDI_STORECACHING_OK_ACC = 0x04
-DDI_DATA_SZ01_ACC = 1
-DDI_DATA_SZ02_ACC = 2
-DDI_DATA_SZ04_ACC = 4
-DDI_DATA_SZ08_ACC = 8
-VERS_ACCHDL = 0x0001
-VERS1_NOFAULT = 1
-PEEK_START = 1
-POKE_START = 2
-PEEK_FAULT = 4
-POKE_FAULT = 8
-DEVID_NONE = 0
-DEVID_SCSI3_WWN = 1
-DEVID_SCSI_SERIAL = 2
-DEVID_FAB = 3
-DEVID_ENCAP = 4
-DEVID_MAXTYPE = 4
-
# Included from sys/ddidmareq.h
DMA_UNIT_8 = 1
DMA_UNIT_16 = 2
@@ -1173,7 +1578,6 @@ DDI_DMA_PARTIAL = 0x0008
DDI_DMA_CONSISTENT = 0x0010
DDI_DMA_EXCLUSIVE = 0x0020
DDI_DMA_STREAMING = 0x0040
-DDI_DMA_VME_USEA32 = 0x1000
DDI_DMA_SBUS_64BIT = 0x2000
DDI_DMA_MAPPED = 0
DDI_DMA_MAPOK = 0
@@ -1199,7 +1603,6 @@ PROT_READ = 0x1
PROT_WRITE = 0x2
PROT_EXEC = 0x4
PROT_USER = 0x8
-PROT_ZFOD = (PROT_READ | PROT_WRITE | PROT_USER)
PROT_ZFOD = (PROT_READ | PROT_WRITE | PROT_EXEC | PROT_USER)
PROT_ALL = (PROT_READ | PROT_WRITE | PROT_EXEC | PROT_USER)
PROT_NONE = 0x0
@@ -1208,6 +1611,8 @@ MAP_PRIVATE = 2
MAP_TYPE = 0xf
MAP_FIXED = 0x10
MAP_NORESERVE = 0x40
+MAP_ANON = 0x100
+MAP_ANONYMOUS = MAP_ANON
MAP_RENAME = 0x20
PROC_TEXT = (PROT_EXEC | PROT_READ)
PROC_DATA = (PROT_READ | PROT_WRITE | PROT_EXEC)
@@ -1215,14 +1620,17 @@ SHARED = 0x10
PRIVATE = 0x20
VALID_ATTR = (PROT_READ|PROT_WRITE|PROT_EXEC|SHARED|PRIVATE)
PROT_EXCL = 0x20
-MAP_INHERIT = 0x80
+_MAP_LOW32 = 0x80
_MAP_NEW = 0x80000000
+from TYPES import *
MADV_NORMAL = 0
MADV_RANDOM = 1
MADV_SEQUENTIAL = 2
MADV_WILLNEED = 3
MADV_DONTNEED = 4
-MS_SYNC = 0x0
+MADV_FREE = 5
+MS_OLDSYNC = 0x0
+MS_SYNC = 0x4
MS_ASYNC = 0x1
MS_INVALIDATE = 0x2
MC_SYNC = 1
@@ -1246,6 +1654,10 @@ DDI_ME_RNUMBER_RANGE = (-6)
DDI_ME_INVAL = (-7)
# Included from sys/ddipropdefs.h
+def CELLS_1275_TO_BYTES(n): return ((n) * PROP_1275_CELL_SIZE)
+
+def BYTES_TO_1275_CELLS(n): return ((n) / PROP_1275_CELL_SIZE)
+
PH_FROM_PROM = 0x01
DDI_PROP_SUCCESS = 0
DDI_PROP_NOT_FOUND = 1
@@ -1284,55 +1696,46 @@ DDI_GENERIC_ADDRESSING = "generic-addressing"
# Included from sys/ddidevmap.h
KMEM_PAGEABLE = 0x100
KMEM_NON_PAGEABLE = 0x200
+UMEM_LOCKED = 0x400
+UMEM_TRASH = 0x800
DEVMAP_OPS_REV = 1
DEVMAP_DEFAULTS = 0x00
DEVMAP_MAPPING_INVALID = 0x01
DEVMAP_ALLOW_REMAP = 0x02
DEVMAP_USE_PAGESIZE = 0x04
-DEVMAP_UNLOAD_PENDING = 0x08
+DEVMAP_SETUP_FLAGS = \
+ (DEVMAP_MAPPING_INVALID | DEVMAP_ALLOW_REMAP | DEVMAP_USE_PAGESIZE)
DEVMAP_SETUP_DONE = 0x100
DEVMAP_LOCK_INITED = 0x200
DEVMAP_FAULTING = 0x400
DEVMAP_LOCKED = 0x800
DEVMAP_FLAG_LARGE = 0x1000
-DEVMAP_FLAG_KPMEM = 0x2000
-DEVMAP_FLAG_KMEM = 0x4000
-DEVMAP_FLAG_DEVMEM = 0x8000
-PROT_NONE = 0x0
-PROT_READ = 0x1
-PROT_WRITE = 0x2
-PROT_EXEC = 0x4
-PROT_USER = 0x8
-PROT_ALL = (PROT_READ | PROT_WRITE | PROT_EXEC | PROT_USER)
DDI_UMEM_SLEEP = 0x0
DDI_UMEM_NOSLEEP = 0x01
DDI_UMEM_PAGEABLE = 0x02
+DDI_UMEM_TRASH = 0x04
+DDI_UMEMLOCK_READ = 0x01
+DDI_UMEMLOCK_WRITE = 0x02
# Included from sys/nexusdefs.h
-# Included from sys/aio_req.h
-BUSO_REV = 3
+# Included from sys/nexusintr.h
+BUSO_REV = 4
BUSO_REV_3 = 3
+BUSO_REV_4 = 4
DEVO_REV = 3
CB_REV = 1
DDI_IDENTIFIED = (0)
DDI_NOT_IDENTIFIED = (-1)
+DDI_PROBE_FAILURE = ENXIO
DDI_PROBE_DONTCARE = 0
DDI_PROBE_PARTIAL = 1
DDI_PROBE_SUCCESS = 2
MAPDEV_REV = 1
-
-# Included from sys/model.h
-DATAMODEL_MASK = 0x0FF00000
-DATAMODEL_ILP32 = 0x00100000
-DATAMODEL_LP64 = 0x00200000
-DATAMODEL_NONE = 0
-DATAMODEL_NATIVE = DATAMODEL_LP64
-DATAMODEL_NATIVE = DATAMODEL_ILP32
+from TYPES import *
D_NEW = 0x00
-D_OLD = 0x01
+_D_OLD = 0x01
D_TAPE = 0x08
-D_NOBRKUP = 0x10
D_MTSAFE = 0x0020
_D_QNEXTLESS = 0x0040
_D_MTOCSHARED = 0x0080
@@ -1342,16 +1745,13 @@ D_MTPERQ = 0x2000
D_MTQPAIR = 0x4000
D_MTPERMOD = 0x6000
D_MTOUTPERIM = 0x8000
-D_MTINNER_MOD = (D_MTPUTSHARED|_D_MTOCSHARED)
+_D_MTCBSHARED = 0x10000
+D_MTINNER_MOD = (D_MTPUTSHARED|_D_MTOCSHARED|_D_MTCBSHARED)
D_MTOUTER_MOD = (D_MTOCEXCL)
D_MP = D_MTSAFE
D_64BIT = 0x200
D_SYNCSTR = 0x400
D_DEVMAP = 0x100
-D_MODELS = DATAMODEL_MASK
-D_ILP32 = DATAMODEL_ILP32
-D_LP64 = DATAMODEL_LP64
-D_NATIVE = DATAMODEL_NATIVE
D_HOTPLUG = 0x4
SNDZERO = 0x001
SNDPIPE = 0x002
@@ -1409,42 +1809,5 @@ MOREDATA = 2
MUXID_ALL = (-1)
ANYMARK = 0x01
LASTMARK = 0x02
-STR = (ord('S')<<8)
-I_NREAD = (STR|01)
-I_PUSH = (STR|02)
-I_POP = (STR|03)
-I_LOOK = (STR|04)
-I_FLUSH = (STR|05)
-I_SRDOPT = (STR|06)
-I_GRDOPT = (STR|07)
-I_STR = (STR|010)
-I_SETSIG = (STR|011)
-I_GETSIG = (STR|012)
-I_FIND = (STR|013)
-I_LINK = (STR|014)
-I_UNLINK = (STR|015)
-I_PEEK = (STR|017)
-I_FDINSERT = (STR|020)
-I_SENDFD = (STR|021)
-I_RECVFD = (STR|022)
-I_E_RECVFD = (STR|016)
-I_RECVFD = (STR|016)
-I_SWROPT = (STR|023)
-I_GWROPT = (STR|024)
-I_LIST = (STR|025)
-I_PLINK = (STR|026)
-I_PUNLINK = (STR|027)
-I_FLUSHBAND = (STR|034)
-I_CKBAND = (STR|035)
-I_GETBAND = (STR|036)
-I_ATMARK = (STR|037)
-I_SETCLTIME = (STR|040)
-I_GETCLTIME = (STR|041)
-I_CANPUT = (STR|042)
-I_SERROPT = (STR|043)
-I_GERROPT = (STR|044)
-I_ESETSIG = (STR|045)
-I_EGETSIG = (STR|046)
-__I_PUSH_NOCTTY = (STR|047)
_INFTIM = -1
INFTIM = _INFTIM
diff --git a/Lib/plat-sunos5/TYPES.py b/Lib/plat-sunos5/TYPES.py
new file mode 100644
index 0000000..e7106dd
--- /dev/null
+++ b/Lib/plat-sunos5/TYPES.py
@@ -0,0 +1,314 @@
+# Generated by h2py from /usr/include/sys/types.h
+
+# Included from sys/isa_defs.h
+_CHAR_ALIGNMENT = 1
+_SHORT_ALIGNMENT = 2
+_INT_ALIGNMENT = 4
+_LONG_ALIGNMENT = 8
+_LONG_LONG_ALIGNMENT = 8
+_DOUBLE_ALIGNMENT = 8
+_LONG_DOUBLE_ALIGNMENT = 16
+_POINTER_ALIGNMENT = 8
+_MAX_ALIGNMENT = 16
+_ALIGNMENT_REQUIRED = 1
+_CHAR_ALIGNMENT = 1
+_SHORT_ALIGNMENT = 2
+_INT_ALIGNMENT = 4
+_LONG_ALIGNMENT = 4
+_LONG_LONG_ALIGNMENT = 4
+_DOUBLE_ALIGNMENT = 4
+_LONG_DOUBLE_ALIGNMENT = 4
+_POINTER_ALIGNMENT = 4
+_MAX_ALIGNMENT = 4
+_ALIGNMENT_REQUIRED = 0
+_CHAR_ALIGNMENT = 1
+_SHORT_ALIGNMENT = 2
+_INT_ALIGNMENT = 4
+_LONG_LONG_ALIGNMENT = 8
+_DOUBLE_ALIGNMENT = 8
+_ALIGNMENT_REQUIRED = 1
+_LONG_ALIGNMENT = 4
+_LONG_DOUBLE_ALIGNMENT = 8
+_POINTER_ALIGNMENT = 4
+_MAX_ALIGNMENT = 8
+_LONG_ALIGNMENT = 8
+_LONG_DOUBLE_ALIGNMENT = 16
+_POINTER_ALIGNMENT = 8
+_MAX_ALIGNMENT = 16
+
+# Included from sys/feature_tests.h
+_POSIX_C_SOURCE = 1
+_LARGEFILE64_SOURCE = 1
+_LARGEFILE_SOURCE = 1
+_FILE_OFFSET_BITS = 64
+_FILE_OFFSET_BITS = 32
+_POSIX_C_SOURCE = 199506L
+_POSIX_PTHREAD_SEMANTICS = 1
+_XOPEN_VERSION = 500
+_XOPEN_VERSION = 4
+_XOPEN_VERSION = 3
+
+# Included from sys/machtypes.h
+
+# Included from sys/inttypes.h
+
+# Included from sys/int_types.h
+
+# Included from sys/int_limits.h
+INT8_MAX = (127)
+INT16_MAX = (32767)
+INT32_MAX = (2147483647)
+INTMAX_MAX = INT32_MAX
+INT_LEAST8_MAX = INT8_MAX
+INT_LEAST16_MAX = INT16_MAX
+INT_LEAST32_MAX = INT32_MAX
+INT8_MIN = (-128)
+INT16_MIN = (-32767-1)
+INT32_MIN = (-2147483647-1)
+INTMAX_MIN = INT32_MIN
+INT_LEAST8_MIN = INT8_MIN
+INT_LEAST16_MIN = INT16_MIN
+INT_LEAST32_MIN = INT32_MIN
+
+# Included from sys/int_const.h
+def INT8_C(c): return (c)
+
+def INT16_C(c): return (c)
+
+def INT32_C(c): return (c)
+
+def INT64_C(c): return __CONCAT__(c,l)
+
+def INT64_C(c): return __CONCAT__(c,ll)
+
+def UINT8_C(c): return __CONCAT__(c,u)
+
+def UINT16_C(c): return __CONCAT__(c,u)
+
+def UINT32_C(c): return __CONCAT__(c,u)
+
+def UINT64_C(c): return __CONCAT__(c,ul)
+
+def UINT64_C(c): return __CONCAT__(c,ull)
+
+def INTMAX_C(c): return __CONCAT__(c,l)
+
+def UINTMAX_C(c): return __CONCAT__(c,ul)
+
+def INTMAX_C(c): return __CONCAT__(c,ll)
+
+def UINTMAX_C(c): return __CONCAT__(c,ull)
+
+def INTMAX_C(c): return (c)
+
+def UINTMAX_C(c): return (c)
+
+
+# Included from sys/int_fmtio.h
+PRId8 = "d"
+PRId16 = "d"
+PRId32 = "d"
+PRId64 = "ld"
+PRId64 = "lld"
+PRIdLEAST8 = "d"
+PRIdLEAST16 = "d"
+PRIdLEAST32 = "d"
+PRIdLEAST64 = "ld"
+PRIdLEAST64 = "lld"
+PRIi8 = "i"
+PRIi16 = "i"
+PRIi32 = "i"
+PRIi64 = "li"
+PRIi64 = "lli"
+PRIiLEAST8 = "i"
+PRIiLEAST16 = "i"
+PRIiLEAST32 = "i"
+PRIiLEAST64 = "li"
+PRIiLEAST64 = "lli"
+PRIo8 = "o"
+PRIo16 = "o"
+PRIo32 = "o"
+PRIo64 = "lo"
+PRIo64 = "llo"
+PRIoLEAST8 = "o"
+PRIoLEAST16 = "o"
+PRIoLEAST32 = "o"
+PRIoLEAST64 = "lo"
+PRIoLEAST64 = "llo"
+PRIx8 = "x"
+PRIx16 = "x"
+PRIx32 = "x"
+PRIx64 = "lx"
+PRIx64 = "llx"
+PRIxLEAST8 = "x"
+PRIxLEAST16 = "x"
+PRIxLEAST32 = "x"
+PRIxLEAST64 = "lx"
+PRIxLEAST64 = "llx"
+PRIX8 = "X"
+PRIX16 = "X"
+PRIX32 = "X"
+PRIX64 = "lX"
+PRIX64 = "llX"
+PRIXLEAST8 = "X"
+PRIXLEAST16 = "X"
+PRIXLEAST32 = "X"
+PRIXLEAST64 = "lX"
+PRIXLEAST64 = "llX"
+PRIu8 = "u"
+PRIu16 = "u"
+PRIu32 = "u"
+PRIu64 = "lu"
+PRIu64 = "llu"
+PRIuLEAST8 = "u"
+PRIuLEAST16 = "u"
+PRIuLEAST32 = "u"
+PRIuLEAST64 = "lu"
+PRIuLEAST64 = "llu"
+SCNd16 = "hd"
+SCNd32 = "d"
+SCNd64 = "ld"
+SCNd64 = "lld"
+SCNi16 = "hi"
+SCNi32 = "i"
+SCNi64 = "li"
+SCNi64 = "lli"
+SCNo16 = "ho"
+SCNo32 = "o"
+SCNo64 = "lo"
+SCNo64 = "llo"
+SCNu16 = "hu"
+SCNu32 = "u"
+SCNu64 = "lu"
+SCNu64 = "llu"
+SCNx16 = "hx"
+SCNx32 = "x"
+SCNx64 = "lx"
+SCNx64 = "llx"
+PRIdMAX = "ld"
+PRIoMAX = "lo"
+PRIxMAX = "lx"
+PRIuMAX = "lu"
+PRIdMAX = "lld"
+PRIoMAX = "llo"
+PRIxMAX = "llx"
+PRIuMAX = "llu"
+PRIdMAX = "d"
+PRIoMAX = "o"
+PRIxMAX = "x"
+PRIuMAX = "u"
+SCNiMAX = "li"
+SCNdMAX = "ld"
+SCNoMAX = "lo"
+SCNxMAX = "lx"
+SCNiMAX = "lli"
+SCNdMAX = "lld"
+SCNoMAX = "llo"
+SCNxMAX = "llx"
+SCNiMAX = "i"
+SCNdMAX = "d"
+SCNoMAX = "o"
+SCNxMAX = "x"
+
+# Included from sys/types32.h
+SHRT_MIN = (-32768)
+SHRT_MAX = 32767
+USHRT_MAX = 65535
+INT_MIN = (-2147483647-1)
+INT_MAX = 2147483647
+LONG_MIN = (-9223372036854775807L-1L)
+LONG_MAX = 9223372036854775807L
+LONG_MIN = (-2147483647L-1L)
+LONG_MAX = 2147483647L
+P_MYID = (-1)
+
+# Included from sys/select.h
+
+# Included from sys/time.h
+TIME32_MAX = INT32_MAX
+TIME32_MIN = INT32_MIN
+def TIMEVAL_OVERFLOW(tv): return \
+
+from TYPES import *
+DST_NONE = 0
+DST_USA = 1
+DST_AUST = 2
+DST_WET = 3
+DST_MET = 4
+DST_EET = 5
+DST_CAN = 6
+DST_GB = 7
+DST_RUM = 8
+DST_TUR = 9
+DST_AUSTALT = 10
+ITIMER_REAL = 0
+ITIMER_VIRTUAL = 1
+ITIMER_PROF = 2
+ITIMER_REALPROF = 3
+def ITIMERVAL_OVERFLOW(itv): return \
+
+SEC = 1
+MILLISEC = 1000
+MICROSEC = 1000000
+NANOSEC = 1000000000
+
+# Included from sys/time_impl.h
+def TIMESPEC_OVERFLOW(ts): return \
+
+def ITIMERSPEC_OVERFLOW(it): return \
+
+__CLOCK_REALTIME0 = 0
+CLOCK_VIRTUAL = 1
+CLOCK_PROF = 2
+__CLOCK_REALTIME3 = 3
+CLOCK_HIGHRES = 4
+CLOCK_MAX = 5
+CLOCK_REALTIME = __CLOCK_REALTIME3
+CLOCK_REALTIME = __CLOCK_REALTIME0
+TIMER_RELTIME = 0x0
+TIMER_ABSTIME = 0x1
+
+# Included from sys/mutex.h
+from TYPES import *
+def MUTEX_HELD(x): return (mutex_owned(x))
+
+def TICK_TO_SEC(tick): return ((tick) / hz)
+
+def SEC_TO_TICK(sec): return ((sec) * hz)
+
+def TICK_TO_MSEC(tick): return \
+
+def MSEC_TO_TICK(msec): return \
+
+def MSEC_TO_TICK_ROUNDUP(msec): return \
+
+def TICK_TO_USEC(tick): return ((tick) * usec_per_tick)
+
+def USEC_TO_TICK(usec): return ((usec) / usec_per_tick)
+
+def USEC_TO_TICK_ROUNDUP(usec): return \
+
+def TICK_TO_NSEC(tick): return ((tick) * nsec_per_tick)
+
+def NSEC_TO_TICK(nsec): return ((nsec) / nsec_per_tick)
+
+def NSEC_TO_TICK_ROUNDUP(nsec): return \
+
+def TIMEVAL_TO_TICK(tvp): return \
+
+def TIMESTRUC_TO_TICK(tsp): return \
+
+
+# Included from time.h
+from TYPES import *
+
+# Included from iso/time_iso.h
+NULL = 0L
+NULL = 0
+CLOCKS_PER_SEC = 1000000
+FD_SETSIZE = 65536
+FD_SETSIZE = 1024
+_NBBY = 8
+NBBY = _NBBY
+def FD_ZERO(p): return bzero((p), sizeof (*(p)))
+
diff --git a/Lib/plat-sunos5/regen b/Lib/plat-sunos5/regen
index 3c8310e..78cb7de 100755
--- a/Lib/plat-sunos5/regen
+++ b/Lib/plat-sunos5/regen
@@ -5,5 +5,5 @@ case `uname -sr` in
exit 1;;
esac
set -v
-h2py -i '(u_long)' /usr/include/netinet/in.h
-h2py /usr/include/sys/stropts.h
+h2py -i '(u_long)' /usr/include/sys/types.h /usr/include/netinet/in.h /usr/include/sys/stropts.h /usr/include/dlfcn.h
+