Discussion:
sched_setscheduler() and usage issues ....please help
(too old to reply)
Arun Srinivas
2005-03-29 03:30:43 UTC
Permalink
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.

I am following the correct syntax and running it as root process.I am using
the given syntax i.e.,
int sched_setscheduler(pid_t pid, int policy, const struct sched_param *p);
(SCHED_FIFO for the policy and priority in the range of 1 to 99 for p).

But the function returns with an value of -1. I am trying to call this
function from the user-space.

1) Is this usage correct?
2)How do I read the error code (i.e., text description of what kiind of
error occurred like for eg., ESRCH,EPERM,EINVAL).

Please help.

thanks
Arun

_________________________________________________________________
Don't know where to look for your life partner?
http://www.bharatmatrimony.com/cgi-bin/bmclicks1.cgi?74 Trust
BharatMatrimony.com

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Steven Rostedt
2005-03-29 04:42:10 UTC
Permalink
Post by Arun Srinivas
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.
Attached is a little program that I use to set the priority of tasks.

-- Steve
Lee Revell
2005-03-29 04:55:31 UTC
Permalink
Post by Steven Rostedt
Post by Arun Srinivas
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.
Attached is a little program that I use to set the priority of tasks.
Why not just use chrt from schedtools?

Lee

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-29 06:06:11 UTC
Permalink
Post by Lee Revell
Post by Steven Rostedt
Post by Arun Srinivas
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.
Attached is a little program that I use to set the priority of tasks.
Why not just use chrt from schedtools?
Not every distro has it yet, and I like to point out that a lot of users is
still using "older" distros, such as FC2, SUSE 9.1, and also olders with Linux
2.4 kernels.

Jan Engelhardt
--
No TOFU for me, please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-29 11:54:06 UTC
Permalink
FC2 has this. Even FC1 had it, and I'd not be surprised if even RHL9 had
this. I'd be very susprised if SuSE 9.1 doesn't have it either.
It was introduced with SUSE Linux 9.1. But, as usually, I usually do not care
for new packages when updating, and schedutils was not a dependency, so it
lost itself until I actively checked what it's about when the boot process
says
"Setting scheduling timeslices unused"

Jan Engelhardt
--
No TOFU for me, please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Steven Rostedt
2005-03-29 11:39:49 UTC
Permalink
Post by Jan Engelhardt
Post by Lee Revell
Post by Steven Rostedt
Post by Arun Srinivas
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.
Attached is a little program that I use to set the priority of tasks.
Why not just use chrt from schedtools?
Not every distro has it yet, and I like to point out that a lot of users is
still using "older" distros, such as FC2, SUSE 9.1, and also olders with Linux
2.4 kernels.
OK, I'm a little embarrassed. I never saw this tool. I use debian
unstable, but didn't have the package loaded. I did a apropos on
sched_setscheduler, and it didn't come up with any tools, so I just
wrote my own!

Thanks,

-- Steve

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Jan Engelhardt
2005-03-29 11:46:41 UTC
Permalink
Post by Steven Rostedt
OK, I'm a little embarrassed. I never saw this tool. I use debian
You don't need to be. Before I got to know of this tool, I also wrote my own.
Look for "schedutils".
Post by Steven Rostedt
unstable, but didn't have the package loaded. I did a apropos on
sched_setscheduler, and it didn't come up with any tools, so I just
wrote my own!
Jan Engelhardt
--
No TOFU for me, please.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Arjan van de Ven
2005-03-29 11:51:41 UTC
Permalink
Post by Jan Engelhardt
Post by Lee Revell
Post by Steven Rostedt
Post by Arun Srinivas
I am trying to set the SCHED_FIFO policy for my process.I am using
sched_setscheduler() function to do this.
Attached is a little program that I use to set the priority of tasks.
Why not just use chrt from schedtools?
Not every distro has it yet, and I like to point out that a lot of users is
still using "older" distros, such as FC2, SUSE 9.1, and also olders with Linux
2.4 kernels
FC2 has this. Even FC1 had it, and I'd not be surprised if even RHL9 had
this. I'd be very susprised if SuSE 9.1 doesn't have it either.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to ***@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



-------------------------------------------------------------------------------
Achtung: diese Newsgruppe ist eine unidirektional gegatete Mailingliste.
Antworten nur per Mail an die im Reply-To-Header angegebene Adresse.
Fragen zum Gateway -> ***@inka.de.
-------------------------------------------------------------------------------
Loading...