/* * Set a given PID to be a SCHED_BATCH process. * * Copyright (C) 2002 Ingo Molnar */ #include #include #include #include #include #include int main (int argc, char **argv) { int pid, ret; struct sched_param p; p.sched_priority = 0; if (argc != 2) { printf("usage: setbatch \n"); exit(-1); } pid = atol(argv[1]); ret = sched_setscheduler(pid, 3, &p); if (ret) { printf("could not set pid %d to SCHED_BATCH: err %d.\n", pid, ret); return -1; } printf("pid %d is SCHED_BATCH from now on.\n", pid); return 0; }