summaryrefslogtreecommitdiffstats
path: root/schedutils
diff options
context:
space:
mode:
Diffstat (limited to 'schedutils')
-rw-r--r--schedutils/chrt.16
-rw-r--r--schedutils/chrt.c7
2 files changed, 11 insertions, 2 deletions
diff --git a/schedutils/chrt.1 b/schedutils/chrt.1
index 9ffc084b5..f6db1cbe3 100644
--- a/schedutils/chrt.1
+++ b/schedutils/chrt.1
@@ -42,13 +42,15 @@ runs COMMAND with the given attributes. Both policy (one of
or
.BR SCHED_BATCH )
and priority can be set and retrieved.
+.PP
+The
+.BR SCHED_BATCH
+policy is supported since Linux 2.6.16.
.SH OPTIONS
.TP
.B -p, --pid
operate on an existing PID and do not launch a new task
.TP
-
-.TP
.B -b, --batch
set scheduling policy to
.BR SCHED_BATCH
diff --git a/schedutils/chrt.c b/schedutils/chrt.c
index 4c190a82d..02ff3809c 100644
--- a/schedutils/chrt.c
+++ b/schedutils/chrt.c
@@ -30,6 +30,13 @@
#include <getopt.h>
#include <errno.h>
+/* the SCHED_BATCH is supported since Linux 2.6.16
+ * -- temporary workaround for people with old glibc headers
+ */
+#ifndef SCHED_BATCH
+# define SCHED_BATCH 3
+#endif
+
static void show_usage(const char *cmd)
{
fprintf(stderr, "chrt (%s)\n", PACKAGE_STRING);