1 #include <sys/syscall.h>
4 #if PY_MAJOR_VERSION < 2 || (PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION <= 3)
5 #define NO_METHODS NoMethods
6 static PyMethodDef NoMethods
[] = {
10 #define NO_METHODS NULL
13 #if PY_MAJOR_VERSION >= 3
14 PyDoc_STRVAR(doc
, "SYS_ioprio_get and SYS_ioprio_set for syscalls");
15 static struct PyModuleDef mod
= {
16 PyModuleDef_HEAD_INIT
,
27 #define INIT_FUNC PyInit__ioprio
28 #define INIT_MOD PyModule_Create(&mod)
30 #define INIT_RET return m
32 #define INIT_FUNC init_ioprio
33 #define INIT_MOD Py_InitModule("_ioprio", NO_METHODS)
36 #endif // PY_MAJOR_VERSION >= 3
38 PyMODINIT_FUNC
INIT_FUNC(void)
40 PyObject
*m
= INIT_MOD
;
47 PyModule_AddIntConstant(m
, "SYS_ioprio_get", SYS_ioprio_get
);
51 PyModule_AddIntConstant(m
, "SYS_ioprio_set", SYS_ioprio_set
);