recursive-include gpiod/ext *.h
recursive-include tests/gpiosim *.c
-recursive-include tests/procname *.c
+recursive-include tests/system *.c
recursive-include lib *.c
recursive-include lib *.h
Builds:
tests/gpiosim/_ext.<target>.so
- tests/procname/_ext.<target>.so
+ tests/system/_ext.<target>.so
"""
],
)
-procname_ext = Extension(
- "tests.procname._ext",
- sources=["tests/procname/ext.c"],
+system_ext = Extension(
+ "tests.system._ext",
+ sources=["tests/system/ext.c"],
define_macros=[("_GNU_SOURCE", "1")],
extra_compile_args=["-Wall", "-Wextra"],
)
dist = Distribution(
{
"name": "gpiod",
- "ext_modules": [gpiosim_ext, procname_ext, gpiod_ext],
+ "ext_modules": [gpiosim_ext, system_ext, gpiod_ext],
"version": __version__,
"platforms": ["linux"],
}
# SPDX-License-Identifier: LGPL-2.1-or-later
# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
-SUBDIRS = gpiosim procname
+SUBDIRS = gpiosim system
EXTRA_DIST = \
helpers.py \
import unittest
-from . import procname
+from .system import set_process_name
from .tests_chip import *
from .tests_chip_info import *
from .tests_edge_event import *
from .tests_line_settings import *
from .tests_module import *
-procname.set_process_name("python-gpiod")
+set_process_name("python-gpiod")
unittest.main()
+++ /dev/null
-# SPDX-License-Identifier: LGPL-2.1-or-later
-# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
-
-EXTRA_DIST = \
- _ext.pyi \
- ext.c \
- __init__.py
+++ /dev/null
-# SPDX-License-Identifier: GPL-2.0-or-later
-# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
-
-from ._ext import set_process_name
-
-__all__ = ["set_process_name"]
+++ /dev/null
-# SPDX-License-Identifier: LGPL-2.1-or-later
-# SPDX-FileCopyrightText: 2024 Vincent Fazio <vfazio@gmail.com>
-
-def set_process_name(name: str) -> None: ...
+++ /dev/null
-// SPDX-License-Identifier: LGPL-2.1-or-later
-// SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
-
-#include <Python.h>
-#include <sys/prctl.h>
-
-static PyObject *
-module_set_process_name(PyObject *Py_UNUSED(self), PyObject *args)
-{
- const char *name;
- int ret;
-
- ret = PyArg_ParseTuple(args, "s", &name);
- if (!ret)
- return NULL;
-
- ret = prctl(PR_SET_NAME, name);
- if (ret)
- return PyErr_SetFromErrno(PyExc_OSError);
-
- Py_RETURN_NONE;
-}
-
-static PyMethodDef module_methods[] = {
- {
- .ml_name = "set_process_name",
- .ml_meth = (PyCFunction)module_set_process_name,
- .ml_flags = METH_VARARGS,
- },
- { }
-};
-
-static PyModuleDef module_def = {
- PyModuleDef_HEAD_INIT,
- .m_name = "procname._ext",
- .m_methods = module_methods,
-};
-
-PyMODINIT_FUNC PyInit__ext(void)
-{
- return PyModule_Create(&module_def);
-}
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
+
+EXTRA_DIST = \
+ _ext.pyi \
+ ext.c \
+ __init__.py
--- /dev/null
+# SPDX-License-Identifier: GPL-2.0-or-later
+# SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
+
+from ._ext import set_process_name
+
+__all__ = ["set_process_name"]
--- /dev/null
+# SPDX-License-Identifier: LGPL-2.1-or-later
+# SPDX-FileCopyrightText: 2024 Vincent Fazio <vfazio@gmail.com>
+
+def set_process_name(name: str) -> None: ...
--- /dev/null
+// SPDX-License-Identifier: LGPL-2.1-or-later
+// SPDX-FileCopyrightText: 2022 Bartosz Golaszewski <brgl@bgdev.pl>
+
+#include <Python.h>
+#include <sys/prctl.h>
+
+static PyObject *
+module_set_process_name(PyObject *Py_UNUSED(self), PyObject *args)
+{
+ const char *name;
+ int ret;
+
+ ret = PyArg_ParseTuple(args, "s", &name);
+ if (!ret)
+ return NULL;
+
+ ret = prctl(PR_SET_NAME, name);
+ if (ret)
+ return PyErr_SetFromErrno(PyExc_OSError);
+
+ Py_RETURN_NONE;
+}
+
+static PyMethodDef module_methods[] = {
+ {
+ .ml_name = "set_process_name",
+ .ml_meth = (PyCFunction)module_set_process_name,
+ .ml_flags = METH_VARARGS,
+ },
+ { }
+};
+
+static PyModuleDef module_def = {
+ PyModuleDef_HEAD_INIT,
+ .m_name = "system._ext",
+ .m_methods = module_methods,
+};
+
+PyMODINIT_FUNC PyInit__ext(void)
+{
+ return PyModule_Create(&module_def);
+}
bindings/python/examples/Makefile
bindings/python/tests/Makefile
bindings/python/tests/gpiosim/Makefile
- bindings/python/tests/procname/Makefile
+ bindings/python/tests/system/Makefile
bindings/rust/libgpiod-sys/src/Makefile
bindings/rust/libgpiod-sys/Makefile
bindings/rust/libgpiod/src/Makefile