PyExt module¶
C extension interface.
-
PyExt.FFI¶ cffi interface.
- Type
ffi
-
PyExt.FFILIB¶ cffi library.
- Type
object
-
class
PyExt.EvPoll[source]¶ Bases:
objectEvpoll interface.
-
ffi¶ cffi interface.
- Type
ffi
-
ffilib¶ cffi library.
- Type
object
-
pollpairs¶ cffi polling pair buffer.
- Type
object
-
modify(evfd, events)[source]¶ Modify event flag.
- Parameters
evfd (int) – File descriptor.
events (int) – Event flag.
- Returns
None
-
poll(timeout, maxevts=65536)[source]¶ Poll events.
- Parameters
timeout (int) – Timeout.
maxevts (int) – Maximum number of events which are polled.
- Returns
Event pairs (fd, events).
- Return type
[(int, int)]
-
-
PyExt.create_task(exe_path, argv, envp, fd_mapping, work_path, root_path, uid, gid, timelimit, memlimit, restrict_level)[source]¶ Create a task.
- Parameters
exe_path (string) – Executable file path.
argv ([string]) – List of arguments.
envp ([string]) – List of environment variables.
fd_mapping (dict) – File descriptor mapping.
work_path (string) – Working directory.
root_path (string) – Root directory.
uid (int) – UID of sandbox.
gid (int) – GID of sandbox.
timelimit (int) – Timelimit of sandbox.
memlimit (int) – Memlimit of sandbox.
restrict_level (int) – Restriction level of sandbox.
- Returns
Task ID, or None if failed to create the task.
- Return type
int