Hi all, when I'm using LTP, sometimes the
test syscalls/sched_getaffinity01 fails by
giving the following output:

sched_getaffinity01    0  TINFO  :  system has 4 processor(s).
sched_getaffinity01    0  TINFO  :  cpusetsize is 128
sched_getaffinity01    0  TINFO  :  mask.__bits[0] = 15 
sched_getaffinity01    1  TPASS  :  sched_getaffinity() succeed ,this process 
29494 is running processor: 0
sched_getaffinity01    2  TPASS  :  sched_getaffinity() succeed ,this process 
29494 is running processor: 1
sched_getaffinity01    3  TPASS  :  sched_getaffinity() succeed ,this process 
29494 is running processor: 2
sched_getaffinity01    4  TPASS  :  sched_getaffinity() succeed ,this process 
29494 is running processor: 3
sched_getaffinity01    5  TPASS  :  sched_getaffinity(0, len, (cpu_set_t *)-1): 
TEST_ERRNO=EFAULT(14): Bad address
sched_getaffinity01    6  TPASS  :  sched_getaffinity(0, 0, mask): 
TEST_ERRNO=EINVAL(22): Invalid argument
sched_getaffinity01    7  TFAIL  :  sched_getaffinity(getpid() + 1, len, mask): 
TEST_ERRNO=???(0): Success

Seems that using ``getpid() + 1'' is not
always correct, so I use another non-existed
pid to replace ``getpid() + ''. 

Signed-off-by: Caspar Zhang <[email protected]>

---
 .../sched_getaffinity/sched_getaffinity01.c        |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)

diff --git a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c 
b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
index 7dfb0ec..aaa646d 100644
--- a/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
+++ b/testcases/kernel/syscalls/sched_getaffinity/sched_getaffinity01.c
@@ -41,7 +41,7 @@
 #include<stdio.h>
 #include<sys/types.h>
 #include<unistd.h>
-#define _GNU_SOURCE 
+#define _GNU_SOURCE
 #define __USE_GNU
 #include<sched.h>
 #include<string.h>
@@ -201,11 +201,10 @@ realloc:
 #endif
                      QUICK_TEST(sched_getaffinity(0, len, (cpu_set_t *)-1));
                      QUICK_TEST(sched_getaffinity(0, 0, mask));
-                     QUICK_TEST(sched_getaffinity(getpid() + 1, len, mask));
+                     QUICK_TEST(sched_getaffinity(65535, len, mask));
                     CPU_FREE(mask);
                 }
        }
         cleanup();
        tst_exit();
 }
-
-- 
1.7.3.1

-- 
Quality Assurance Associate (Kernel) in
Red Hat Software (Beijing) Co., R&D Branch

TEL: +86-10-62608150
WEB: http://www.redhat.com/

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to