static void show_sched_info(struct chrt_ctl *ctl)
{
if (ctl->all_tasks) {
+#ifdef __linux__
pid_t tid;
struct proc_tasks *ts = proc_open_tasks(ctl->pid);
show_sched_pid_info(ctl, tid);
proc_close_tasks(ts);
+#else
+ err(EXIT_FAILURE, _("cannot obtain the list of tasks"));
+#endif
} else
show_sched_pid_info(ctl, ctl->pid);
}
static void set_sched(struct chrt_ctl *ctl)
{
if (ctl->all_tasks) {
+#ifdef __linux__
pid_t tid;
struct proc_tasks *ts = proc_open_tasks(ctl->pid);
err(EXIT_FAILURE, _("failed to set tid %d's policy"), tid);
proc_close_tasks(ts);
-
+#else
+ err(EXIT_FAILURE, _("cannot obtain the list of tasks"));
+#endif
} else if (set_sched_one(ctl, ctl->pid) == -1)
err(EXIT_FAILURE, _("failed to set pid %d's policy"), ctl->pid);