aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2010-02-10 17:03:09 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2010-02-10 17:03:09 -0200
commit66a2327a3cf5bb09061c0ab5b862619dc65bb0f5 (patch)
tree818ea2b294b25d3a13e70973013a507bd9d92794
parent4e05f75442171fb298e252be19f3af9da58dc6d2 (diff)
downloadpython-schedutils-66a2327a3cf5bb09061c0ab5b862619dc65bb0f5.tar.gz
Add SCHED_IDLE to the list of constants exported
And use it in pchrt. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xpchrt.py3
-rw-r--r--python-schedutils/schedutils.c1
2 files changed, 4 insertions, 0 deletions
diff --git a/pchrt.py b/pchrt.py
index b8eab24..8e73a10 100755
--- a/pchrt.py
+++ b/pchrt.py
@@ -22,6 +22,7 @@ usage: chrt [options] [prio] [pid | cmd [args...]]
manipulate real-time attributes of a process
-b, --batch set policy to SCHED_BATCH
-f, --fifo set policy to SCHED_FIFO
+ -i, --idle set policy to SCHED_IDLE
-p, --pid operate on existing given pid
-m, --max show min and max valid priorities
-o, --other set policy to SCHED_OTHER
@@ -80,6 +81,8 @@ def main():
policy = schedutils.SCHED_BATCH
elif o in ("-f", "--fifo"):
policy = schedutils.SCHED_FIFO
+ elif o in ("-i", "--idle"):
+ policy = schedutils.SCHED_IDLE
elif o in ("-m", "--max"):
show_all_priority_limits()
return
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c
index fc9192a..670dcff 100644
--- a/python-schedutils/schedutils.c
+++ b/python-schedutils/schedutils.c
@@ -255,5 +255,6 @@ PyMODINIT_FUNC initschedutils(void)
PyModule_AddIntConstant(m, "SCHED_FIFO", SCHED_FIFO);
PyModule_AddIntConstant(m, "SCHED_RR", SCHED_RR);
PyModule_AddIntConstant(m, "SCHED_BATCH", SCHED_BATCH);
+ PyModule_AddIntConstant(m, "SCHED_IDLE", SCHED_IDLE);
}