Sample Programs, Configuration, and Header Files
Sample Process Group Program
switch (argc) { case 1:
USAGE; exit(ERR_RET);
case 2:
cls = atoi(argv[1]); break;
case 3:
tr_on = 1;
cls = atoi(argv[1]); break;
default:
USAGE; exit(ERR_RET);
}
TR printf(“target cls = %d\n”, cls);
TR printf(“original class: %d\n”, wq_get_proc_cls(&err));
ret = wq_set_proc_cls(cls, WQ_SCOPE_PROCESS, &err); if (ret ==
TR printf(“FAIL: ret=%d err%d\n”, ret, err); exit(ERR_RET);
}
TR printf(“wq_set_proc_cls succeeds\n”);
/* test if class has indeed been set as requested */ newcls = wq_get_proc_cls(&err);
TR printf(“class is now %d\n”, newcls); if (cls != newcls) {
printf(“FAILURE: wq_set_proc_cls succeeded, but class is not changed!\n”); TR system(“ps
}
exit(newcls);
}
36 | Appendix A |