sched: add helpful error message
#include <base/log.h>
#include <base/stddef.h>
+#include <unistd.h>
+
#include "defs.h"
#include "sched.h"
@@ -140,6 +142,11 @@ int main(int argc, char *argv[])
{
int i, ret;
+ if (getuid() != 0) {
+ fprintf(stderr, "Error: please run as root\n");
+ return -EPERM;
+ }
+
if (argc >= 2) {
if (!strcmp(argv[1], "simple")) {
sched_ops = &simple_ops;
