schedutils.c: added support for SCHED_DEADLINE

Signed-off-by: Jiri Kastner <jkastner@redhat.com>
Signed-off-by: John Kacur <jkacur@redhat.com>
diff --git a/python-schedutils/schedutils.c b/python-schedutils/schedutils.c
index d852d5d..be38e18 100644
--- a/python-schedutils/schedutils.c
+++ b/python-schedutils/schedutils.c
@@ -243,6 +243,10 @@
 #ifndef SCHED_IDLE
 #define SCHED_IDLE              5
 #endif
+#ifndef SCHED_DEADLINE
+#define SCHED_DEADLINE          6
+#endif
+
 
 static PyObject *schedstr(PyObject *self __unused, PyObject *args)
 {
@@ -258,6 +262,7 @@
 	case SCHED_FIFO:  s = "SCHED_FIFO";  break;
 	case SCHED_BATCH: s = "SCHED_BATCH"; break;
 	case SCHED_IDLE:  s = "SCHED_IDLE";  break;
+        case SCHED_DEADLINE:  s = "SCHED_DEADLINE";  break;
 	default:	  s = "UNKNOWN";     break;
 	}
 
@@ -282,6 +287,8 @@
 		scheduler = SCHED_BATCH;
 	else if (strcmp(s, "SCHED_IDLE") == 0)
 		scheduler = SCHED_IDLE;
+        else if (strcmp(s, "SCHED_DEADLINE") == 0)
+                scheduler = SCHED_DEADLINE;
 	else {
 		PyErr_SetString(PyExc_OSError, "Unknown scheduler");
 		return NULL;
@@ -382,6 +389,7 @@
 	PyModule_AddIntConstant(m, "SCHED_RR", SCHED_RR);
 	PyModule_AddIntConstant(m, "SCHED_BATCH", SCHED_BATCH);
 	PyModule_AddIntConstant(m, "SCHED_IDLE", SCHED_IDLE);
+        PyModule_AddIntConstant(m, "SCHED_DEADLINE", SCHED_DEADLINE);
 	PyModule_AddIntConstant(m, "SCHED_RESET_ON_FORK", SCHED_RESET_ON_FORK);
 }