problems coding a real-time process

lockhart at irtf.ifa.hawaii.edu lockhart at irtf.ifa.hawaii.edu
Tue Jan 22 10:57:10 PST 2002


Geeky coder question:

I'm having the damndest time setting up the priority for a real-time
thread under linux.  I think I'm correctly setting the capability of the
process to CAP_SYS_NICE (using cap_set_proc(cap_from_text("cap_sys_nice"))
), as the routine isn't failing or returning an errno.  And when I call
sched_get_priority_max(SCHED_FIFO), I'm getting back a 99, which is what I
was figuring on.  But when I run the following:

int priority;
struct sched_param sp;
priority = sched_get_priority_max(SCHED_FIFO);
sp.sched_priority = priority;
sched_setschedule(getpid(), SCHED_FIFO, &sp);

the sched_setschedule() returns an error, and the error code is 29
(ESPIPE?).  According to the man page, this routine returns 3 different
errors when it fails, none of them are ESPIPE.

Is anybody familiar enough with this to explain it, or maybe point me in
the right direction?

Thanks,

-Charles



More information about the LUAU mailing list