Hi,
=========================================================
Manas K. Nayak <[email protected]> reported:
=========================================================
accept4_01 test cases are broken because the function accept04() is not
implemented in testcase.
Used ltp version: ltp-full-20081130.tgz
Manually executed the test as below:
[accept4]# ./accept4_01
accept04_01 1 BROK : accept4() Error: Function not implemented
=========================================================
Subrata Modak <[email protected]> replied:
=========================================================
Fix on x86_64 as well, as it behaves properly on other Architectures
Supriya/Manas,
accept4_01.c is a new test case for the new system call accept4() recently
introduced in kernel-2.6.26 only for the x86_64 architecture. The test has the
code to handle if it is not supported in some architecture. Interestingly it
executes the expected way on x86 machines:
# uname -a
Linux 2.6.25-gcov-nomodconfig-smp #1 SMP Thu Jun 12 06:29:27 EDT 2008 i686 i686
i386 GNU/Linux
# ./ltp-intermediate-20081216/testcases/bin/accept4_01
accept04_01 1 CONF : syscall __NR_accept4 not supported on your arch
But on x86_64, it behaves differently:
# uname -a
Linux 2.6.18-125.el5 #1 SMP Mon Dec 1 17:38:25 EST 2008 x86_64 x86_64 x86_64
GNU/Linux
# ./accept4_01
accept04_01 1 BROK : accept4() Error: Function not implemented
It means though the interface calls for:
syscall(__NR_socketcall, SYS_ACCEPT4, args)
&
syscall(__NR_accept4, fd, sockaddr, addrlen, flags)
will execute as __NR_socketcall & __NR_accept4 are defined inside the system,
the exact implementation of the interface is yet to come as the kernel <
2.6.26. So, i changed the code accordingly. Please verify the patch.
Regards--
Subrata
--- ltp-full-20081130/testcases/kernel/syscalls/accept4/accept4_01.c 2008-11-19 16:04:38.000000000 +0530
+++ ltp-full-20081130/testcases/kernel/syscalls/accept4/accept4_01.modified.c 2008-12-16 05:46:52.000000000 +0530
@@ -204,8 +204,9 @@ do_test(int lfd, struct sockaddr_in *con
addrlen = sizeof(struct sockaddr_in);
acceptfd = accept4(lfd, (struct sockaddr *) &claddr, &addrlen,
closeonexec_flag | nonblock_flag);
- if (acceptfd == -1)
- die("accept4() Error");
+ if (acceptfd == -1) {
+ tst_resm(TCONF, "syscall __NR_accept4 not supported on your arch");
+ }
fdf = fcntl(acceptfd, F_GETFD);
if (fdf == -1)
@@ -272,6 +273,7 @@ create_listening_socket(int port_num)
int
main(int argc, char *argv[])
{
+ #if defined(__NR_accept4) || defined(__NR_socketcall)
struct sockaddr_in conn_addr;
int lfd;
int port_num;
@@ -291,6 +293,9 @@ main(int argc, char *argv[])
do_test(lfd, &conn_addr, 0, SOCK_NONBLOCK);
do_test(lfd, &conn_addr, SOCK_CLOEXEC, SOCK_NONBLOCK);
close(lfd);
+ #else
+ tst_resm(TCONF, "syscall __NR_accept4 not supported on your arch");
+ #endif
cleanup();
tst_exit();
------------------------------------------------------------------------------
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list