Changeset View
Changeset View
Standalone View
Standalone View
tests/atf_python/utils.py
Show All 22 Lines | def __init__(self): | ||||
raise RuntimeError("libc not found") | raise RuntimeError("libc not found") | ||||
self._libc = CDLL(path, use_errno=True) | self._libc = CDLL(path, use_errno=True) | ||||
def modfind(self, mod_name: str) -> int: | def modfind(self, mod_name: str) -> int: | ||||
if self._libc.modfind(bytes(mod_name, encoding="ascii")) == -1: | if self._libc.modfind(bytes(mod_name, encoding="ascii")) == -1: | ||||
return get_errno() | return get_errno() | ||||
return 0 | return 0 | ||||
def kldload(self, kld_name: str) -> int: | |||||
if self._libc.kldload(bytes(kld_name, encoding="ascii")) == -1: | |||||
return get_errno() | |||||
return 0 | |||||
def jail_attach(self, jid: int) -> int: | def jail_attach(self, jid: int) -> int: | ||||
if self._libc.jail_attach(jid) != 0: | if self._libc.jail_attach(jid) != 0: | ||||
return get_errno() | return get_errno() | ||||
return 0 | return 0 | ||||
libc = LibCWrapper() | libc = LibCWrapper() | ||||
Show All 40 Lines |