summaryrefslogtreecommitdiff
path: root/linuxnamespaces
diff options
context:
space:
mode:
Diffstat (limited to 'linuxnamespaces')
-rw-r--r--linuxnamespaces/syscalls.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/linuxnamespaces/syscalls.py b/linuxnamespaces/syscalls.py
index d9d37eb..986238c 100644
--- a/linuxnamespaces/syscalls.py
+++ b/linuxnamespaces/syscalls.py
@@ -10,12 +10,16 @@ import ctypes
import dataclasses
import enum
import errno
+import logging
import os
import typing
from .atlocation import AtFlags, AtLocation, AtLocationLike, PathConvertible
+logger = logging.getLogger(__name__)
+
+
LIBC_SO = ctypes.CDLL(None, use_errno=True)
@@ -363,7 +367,9 @@ def call_libc(funcname: str, *args: typing.Any) -> int:
the function returns an integer that is non-negative on success. On
failure, an OSError with errno is raised.
"""
+ logger.debug("calling libc function %s%r", funcname, args)
ret: int = LIBC_SO[funcname](*args)
+ logger.debug("%s returned %d", funcname, ret)
if ret < 0:
err = ctypes.get_errno()
raise OSError(