--- On Wed, 5/6/09, Gui Xiaohua <[email protected]> wrote:

> From: Gui Xiaohua <[email protected]>
> Subject: [LTP] [PATCH]the function name conflict with libc in LTP
> To: [email protected]
> Date: Wednesday, May 6, 2009, 1:16 PM
> There is an error occured during i
> compiled ltp which was 
> released in 20090430:
>   accept4_01.c:146: error: static declaration of
> ‘accept4’ 
>   follows non-static declaration
> /usr/include/sys/socket.h:222: 
>   note: previous declaration of ‘accept4’ was
> here.
> Note:
>   The OS is Fedora11Beta, the glibc version is 
>   glibc-headers-2.9.90-8.1.x86_64.
> 
> Signed-off-by: Gui Xiaohua <[email protected]>
> ---
> a/testcases/kernel/syscalls/accept4/accept4_01.c   
> 2009-05-05 16:58:49.000000000 +0800
> +++
> b/testcases/kernel/syscalls/accept4/accept4_01.c   
> 2009-05-05 17:00:41.000000000 +0800
> @@ -143,10 +143,10 @@ void setup()
>  }
>  
>  static int
> -accept4(int fd, struct sockaddr *sockaddr, socklen_t
> *addrlen, int flags)
> +accept4_01(int fd, struct sockaddr *sockaddr, socklen_t
> *addrlen, int flags)
>  {
>  #ifdef DEBUG
> -    tst_resm(TINFO, "Calling accept4():
> flags = %x", flags);
> +    tst_resm(TINFO, "Calling accept4_01():
> flags = %x", flags);
>      if (flags != 0) {
>          tst_resm(TINFO, "
> (");
>          if (flags &
> SOCK_CLOEXEC)
> @@ -197,7 +197,7 @@ do_test(int lfd, struct sockaddr_in
> *con
>          die("Connect
> Error");
>  
>      addrlen = sizeof(struct sockaddr_in);
> -    acceptfd = accept4(lfd, (struct
> sockaddr *)&claddr, &addrlen,
> +    acceptfd = accept4_01(lfd, (struct
> sockaddr *)&claddr, &addrlen,
>             
>    closeonexec_flag | nonblock_flag);
>      if (acceptfd == -1) {
>          tst_resm(TCONF,
> 
> 

Well, if glibc has already provided accept4(), we can use it unless it is
really necessary to use syscall(). In the future, we probably don't want 
to maintain a separate version of accept4() here. Is it possible to check
if the glibc version is available? If so, use the glibc one. Otherwise,
use the static one here?

CAI Qian

> 
> 
> 
> 
> ------------------------------------------------------------------------------
> The NEW KODAK i700 Series Scanners deliver under ANY
> circumstances! Your
> production scanning environment may not be a perfect world
> - but thanks to
> Kodak, there's a perfect scanner to get the job done! With
> the NEW KODAK i700
> Series Scanner you'll get full speed at 300 dpi even with
> all image 
> processing features enabled. http://p.sf.net/sfu/kodak-com
> _______________________________________________
> Ltp-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/ltp-list
> 

------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image 
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

Reply via email to