sched_setscheduler/17-5.c: Add the missing scheduling policies.
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi!
Quoted 57 lines
On linux, I found the scheduling policies are defined as follow:
in
/usr/include/bits/sched.h/* Scheduling algorithms. */
#define SCHED_OTHER 0 #define SCHED_FIFO 1 #define SCHED_RR 2 #ifdef __USE_GNU # define SCHED_BATCH 3 # define SCHED_IDLE 5# define SCHED_RESET_ON_FORK 0x40000000 #endifSo besides
SCHED_OTHER,SCHED_FIFOandSCHED_RR, there are another two policies,SCHED_BATCHandSCHED_IDLE. And 3 is a valid value for the scheduling policy, which causes the test returns UNSOLVED on linux system.Here is the patch, please comment!
Thanks.:)Signed-off-by Tang Chen <[email protected]>--- .../interfaces/sched_setscheduler/17-5.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c +9
-0@@ -17,6 +17,11 @@* 2. Call sched_setscheduler with invalid args. * 3. Check that the policy and priority have not changed. */ + +#ifdef __linux__ +#define _GNU_SOURCE +#endif +#include <sched.h> #include <stdio.h> #include <errno.h> @@ -31,6 +36,10 @@ int main() { invalid_policy =0 ;/* Linux does not treat minus value as invalid for policy */ while (invalid_policy == SCHED_OTHER || +#ifdef _GNU_SOURCE + invalid_policy ==SCHED_BATCH || + invalid_policy ==SCHED_IDLE || +#endif invalid_policy ==SCHED_FIFO || invalid_policy == SCHED_RR) invalid_policy++;
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c int main() { · line 90
Quoted 6 lines
testcases/open_posix_testsuite/conformance/interfaces/sched_setscheduler/17-5.c +1
-1@@ -78,4 +87,4 @@ int main() {printf ("The policy has changed\n" ); }return PTS_FAIL ; -} +}
Meanwhile we changed the invalid policy to INT_MAX, which seems to work fine. Thanks anyway.
Signature · 12 lines
Cyril Hrubis [email protected] ------------------------------------------------------------------------------ Get a FREE DOWNLOAD! and learn more about uberSVN rich system, user administration capabilities and model configuration. Take the hassle out of deploying and managing Subversion and the tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2 _______________________________________________ Ltp-list mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/ltp-list