Skip to contentSkip to conversation

fix the system call number of exit_group01

PATCH In review Wei Yongjun 3 participants 4 messages Jul 16, 2009 – Jul 19, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix the system call number of exit_group01

The system call number is depend on the system architecture, not always 252. This patch fixed the problem.

testcases/kernel/syscalls/exit_group/exit_group01.c +1 -1
@@ -136,7 +136,7 @@ int main(int ac, char **av) {
                      } else if (TEST_RETURN == 0){
 	                 	tst_resm(TINFO, "In the child process");
                            	sleep(5);
-				TEST(syscall(252,4));
+				TEST(syscall(__NR_exit_group,4));
                      }else {
 				tst_resm(TINFO,"in the parent process");
 				TEST(w = wait(&status));

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 7 lines · Wei Yongjun

The system call number is depend on the system architecture, not always 252. This patch fixed the problem.

testcases/kernel/syscalls/exit_group/exit_group01.c       2009-07-15 09:26:23.000000000 +0800 int main(int ac, char **av) { · line 142

Quoted 8 lines
testcases/kernel/syscalls/exit_group/exit_group01.c       2009-07-15 09:26:23.000000000 +0800 renamed from testcases/kernel/syscalls/exit_group/exit_group01.c       2009-05-22 02:14:40.000000000 +0800 +1 -1
@@ -136,7 +136,7 @@ int main(int ac, char **av) {
                      } else if (TEST_RETURN == 0){
                                tst_resm(TINFO, "In the child process");
                                sleep(5);
-                               TEST(syscall(252,4));
+                               TEST(syscall(__NR_exit_group,4));
                      }else {
                                tst_resm(TINFO,"in the parent process");
                                TEST(w = wait(&status));

Hi Wei,
The best way to do this (IMHO) may be to add the relevant syscall
number to the architecture specific .in file in testcases/kernel/include. Do you have the syscall number for your architecture?
Thanks,
-Garrett

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw
Quoted 4 lines · On Sunday 19 July 2009 00:47:29 Garrett Cooper wrote:
Quoted 3 lines · Wei Yongjun

The system call number is depend on the system architecture, not always
252. This patch fixed the problem.

Quoted 8 lines

testcases/kernel/syscalls/exit_group/exit_group01.c int main(int ac, char **av) { · line 139

Quoted 3 lines

--- a/testcases/kernel/syscalls/exit_group/exit_group01.c

testcases/kernel/syscalls/exit_group/exit_group01.c +1 -1
-                               TEST(syscall(252,4));
+                               TEST(syscall(__NR_exit_group,4));

The best way to do this (IMHO) may be to add the relevant syscall
number to the architecture specific .in file in testcases/kernel/include. Do you have the syscall number for your architecture?

both should be done. syscall() should never be used with a hardcoded #. -mike

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge

_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 14 lines · Mike Frysinger
Quoted 4 lines · On Sunday 19 July 2009 00:47:29 Garrett Cooper wrote:
Quoted 3 lines · Wei Yongjun

The system call number is depend on the system architecture, not always
252. This patch fixed the problem.

Quoted 8 lines
Quoted 3 lines

--- a/testcases/kernel/syscalls/exit_group/exit_group01.c
-                               TEST(syscall(252,4));
+                               TEST(syscall(__NR_exit_group,4));

    The best way to do this (IMHO) may be to add the relevant syscall number to the architecture specific .in file in testcases/kernel/include. Do you have the syscall number for your architecture?

Quoted 1 line

both should be done.  syscall() should never be used with a hardcoded #.

Agreed.
-Garrett

------------------------------------------------------------------------------
Enter the BlackBerry Developer Challenge
This is your chance to win up to $100,000 in prizes! For a limited time, vendors submitting new applications to BlackBerry App World(TM) will have the opportunity to enter the BlackBerry Developer Challenge. See full prize details at: http://p.sf.net/sfu/Challenge
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list