1 # Generated by h2py from /usr/include/sys/file.h
2 from warnings
import warnpy3k
3 warnpy3k("the FILE module has been removed in Python 3.0", stacklevel
=2)
6 # Included from standards.h
8 # Included from sys/types.h
10 # Included from sgidefs.h
19 # Included from sys/pthread.h
23 # Included from sys/bsd_types.h
25 # Included from sys/mkdev.h
37 def IS_STRING_SPEC_DEV(x
): return ((dev_t
)(x
)==__makedev(MKDEV_VER
, 0, 0))
39 def major(dev
): return __major(MKDEV_VER
, dev
)
41 def minor(dev
): return __minor(MKDEV_VER
, dev
)
44 # Included from sys/select.h
48 # Included from string.h
52 # Included from sys/cpumask.h
54 def CPUMASK_INDEX(bit
): return ((bit
) >> 6)
56 def CPUMASK_SHFT(bit
): return ((bit
) & 0x3f)
58 def CPUMASK_IS_ZERO(p
): return ((p
) == 0)
60 def CPUMASK_IS_NONZERO(p
): return ((p
) != 0)
63 # Included from sys/nodemask.h
64 def CNODEMASK_IS_ZERO(p
): return ((p
) == 0)
66 def CNODEMASK_IS_NONZERO(p
): return ((p
) != 0)
69 # Included from sys/sema.h
71 # Included from sys/timespec.h
73 # Included from sys/param.h
75 # Included from sys/signal.h
120 # Included from sys/sigevent.h
126 # Included from sys/siginfo.h
183 SA_ONSTACK
= 0x00000001
184 SA_RESETHAND
= 0x00000002
185 SA_RESTART
= 0x00000004
186 SA_SIGINFO
= 0x00000008
187 SA_NODEFER
= 0x00000010
188 SA_NOCLDWAIT
= 0x00010000
189 SA_NOCLDSTOP
= 0x00020000
190 _SA_BSDCALL
= 0x10000000
193 SS_ONSTACK
= 0x00000001
194 SS_DISABLE
= 0x00000002
196 # Included from sys/ucontext.h
205 UC_MCONTEXT
= (UC_CPU|UC_MAU
)
206 UC_ALL
= (UC_SIGMASK|UC_STACK|UC_MCONTEXT
)
286 CXT_CAUSE
= CTX_CAUSE
336 SV_INTERRUPT
= 0x0002
338 def sigmask(sig
): return (1L << ((sig
)-1))
340 def sigmask(sig
): return (1L << ((sig
)-1))
358 BRK_PSEUDO_OP_BIT
= 0x80
359 BRK_PSEUDO_OP_MAX
= 0x3
360 BRK_CACHE_SYNC
= 0x80
362 _POSIX_VERSION
= 199506L
363 _POSIX_VERSION
= 199506
368 GID_NOBODY
= UID_NOBODY
406 PTIME_SHARE_OVER
= -3
419 BPSSHIFT
= (BPCSHIFT
+CPSSHIFT
)
426 def BASEPRI(psw
): return (((psw
) & SR_IMASK
) == SR_IMASK0
)
428 def BASEPRI(psw
): return (((psw
) & SR_IMASK
) == SR_IMASK
)
430 def USERMODE(psw
): return (((psw
) & SR_KSU_MSK
) == SR_KSU_USR
)
439 BBSIZE
= (1<<BBSHIFT
)
441 def BBTOB(bbs
): return ((bbs
) << BBSHIFT
)
443 def OFFTOBB(bytes
): return (((__uint64_t
)(bytes
) + BBSIZE
- 1) >> BBSHIFT
)
445 def OFFTOBBT(bytes
): return ((off_t
)(bytes
) >> BBSHIFT
)
447 def BBTOOFF(bbs
): return ((off_t
)(bbs
) << BBSHIFT
)
449 SEEKLIMIT32
= 0x7fffffff
453 def btodb(bytes
): return \
455 def dbtob(db
): return \
457 BLKDEV_IOSHIFT
= BPCSHIFT
458 BLKDEV_IOSIZE
= (1<<BLKDEV_IOSHIFT
)
459 def BLKDEV_OFF(off
): return ((off
) & (BLKDEV_IOSIZE
- 1))
461 def BLKDEV_LBN(off
): return ((off
) >> BLKDEV_IOSHIFT
)
463 def BLKDEV_LTOP(bn
): return ((bn
) * BLKDEV_BB
)
466 def DELAY(n
): return us_delay(n
)
468 def DELAYBUS(n
): return us_delaybus(n
)
474 def mutex_spinlock(l
): return splhi()
476 def mutex_spintrylock(l
): return splhi()
478 def spinlock_initialized(l
): return 1
487 NSCHEDCLASS
= (-(PWEIGHTLESS
)+1)
491 MRLOCK_BEHAVIOR
= 0x2
492 MRLOCK_DBLTRIPPABLE
= 0x4
493 MRLOCK_ALLOW_EQUAL_PRI
= 0x8
494 MRLOCK_DEFAULT
= MRLOCK_BARRIER
495 def mraccess(mrp
): return mraccessf(mrp
, 0)
497 def mrupdate(mrp
): return mrupdatef(mrp
, 0)
499 def mp_mutex_unlock(m
): return mutex_unlock(m
)
501 def mp_mutex_trylock(m
): return mutex_trylock(m
)
503 def mp_mutex_spinlock(m
): return mutex_spinlock(m
)
506 # Included from sys/mon.h
512 MR_READER_BUCKETS
= 13
513 def initlock(l
): return spinlock_init(l
,0)
515 def ownlock(x
): return 1
517 def mutex_enter(m
): return mutex_lock(m
, PZERO
)
519 def mutex_tryenter(m
): return mutex_trylock(m
)
521 def mutex_exit(m
): return mutex_unlock(m
)
523 def cv_signal(cv
): return sv_signal(cv
)
525 def cv_broadcast(cv
): return sv_broadcast(cv
)
527 def cv_destroy(cv
): return sv_destroy(cv
)
529 RW_READER
= MR_ACCESS
530 RW_WRITER
= MR_UPDATE
531 def rw_exit(r
): return mrunlock(r
)
533 def rw_tryupgrade(r
): return mrtrypromote(r
)
535 def rw_downgrade(r
): return mrdemote(r
)
537 def rw_destroy(r
): return mrfree(r
)
539 def RW_WRITE_HELD(r
): return ismrlocked(r
, MR_UPDATE
)
541 def RW_READ_HELD(r
): return ismrlocked(r
, MR_ACCESS
)
548 # Included from sys/fcntl.h
635 BMV_IF_ATTRFORK
= 0x1
636 BMV_IF_NO_DMAPI_READ
= 0x2
637 BMV_IF_PREALLOC
= 0x4
638 BMV_IF_VALID
= (BMV_IF_ATTRFORK|BMV_IF_NO_DMAPI_READ|BMV_IF_PREALLOC
)
639 BMV_OF_PREALLOC
= 0x1
640 BMV_IF_EXTENDED
= 0x40000000