From: Subrata <sub...@us...> - 2009-05-12 06:01:12
|
Update of /cvsroot/ltp/ltp/testcases/kernel/syscalls/accept4 In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv29023/ltp/testcases/kernel/syscalls/accept4 Modified Files: accept4_01.c Log Message: The accept4() system call is available starting with Linux 2.6.28; support in glibc is available starting with version 2.10. In v2.9, the function was to be declared. So i did some changes like following. Signed-off-by: Gui Xiaohua <gu...@cn...>. Acked-By: CAI Qian <ca...@cc...>. Index: accept4_01.c =================================================================== RCS file: /cvsroot/ltp/ltp/testcases/kernel/syscalls/accept4/accept4_01.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** accept4_01.c 23 Mar 2009 13:35:39 -0000 1.4 --- accept4_01.c 12 May 2009 06:01:04 -0000 1.5 *************** *** 142,148 **** tst_tmpdir(); } ! static int ! accept4(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) { #ifdef DEBUG --- 142,148 ---- tst_tmpdir(); } ! #if !(__GLIBC_PREREQ(2,10)) static int ! accept4_01(int fd, struct sockaddr *sockaddr, socklen_t *addrlen, int flags) { #ifdef DEBUG *************** *** 174,177 **** --- 174,178 ---- #endif } + #endif /**********************************************************************/ *************** *** 198,203 **** --- 199,209 ---- addrlen = sizeof(struct sockaddr_in); + #if !(__GLIBC_PREREQ(2,10)) + acceptfd = accept4_01(lfd, (struct sockaddr *)&claddr, &addrlen, + closeonexec_flag | nonblock_flag); + #else acceptfd = accept4(lfd, (struct sockaddr *)&claddr, &addrlen, closeonexec_flag | nonblock_flag); + #endif if (acceptfd == -1) { tst_resm(TCONF, |