X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvcl%2Fldp_socket_wrapper.c;h=38ee297174c97692bf4b50f00a4381ab2cf14c0f;hb=3fccd0278c38cb3fb07fc51a3f1686aef1ebb542;hp=981125850fff1001041ce95f5b8a1f42b86745c6;hpb=2a8652701d0ce7185c60cc05e407950e87a6c150;p=vpp.git diff --git a/src/vcl/ldp_socket_wrapper.c b/src/vcl/ldp_socket_wrapper.c index 981125850ff..38ee297174c 100644 --- a/src/vcl/ldp_socket_wrapper.c +++ b/src/vcl/ldp_socket_wrapper.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 Cisco and/or its affiliates. + * Copyright (c) 2016-2019 Cisco and/or its affiliates. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at: @@ -173,6 +173,9 @@ typedef int (*__libc_dup2) (int oldfd, int newfd); #endif typedef int (*__libc_fcntl) (int fd, int cmd, ...); +#ifdef HAVE_FCNTL64 +typedef int (*__libc_fcntl64) (int fd, int cmd, ...); +#endif typedef FILE *(*__libc_fopen) (const char *name, const char *mode); #ifdef HAVE_FOPEN64 typedef FILE *(*__libc_fopen64) (const char *name, const char *mode); @@ -292,6 +295,9 @@ struct swrap_libc_symbols SWRAP_SYMBOL_ENTRY (dup2); #endif SWRAP_SYMBOL_ENTRY (fcntl); +#ifdef HAVE_FCNTL64 + SWRAP_SYMBOL_ENTRY (fcntl64); +#endif SWRAP_SYMBOL_ENTRY (fopen); #ifdef HAVE_FOPEN64 SWRAP_SYMBOL_ENTRY (fopen64); @@ -388,7 +394,7 @@ swrap_load_lib_handle (enum swrap_lib lib) void *handle = NULL; int i; -#ifdef RTLD_DEEPBIND +#if defined(RTLD_DEEPBIND) && !defined(CLIB_SANITIZE_ADDR) flags |= RTLD_DEEPBIND; #endif @@ -541,7 +547,7 @@ libc_eventfd (int count, int flags) } #endif -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int +int libc_vfcntl (int fd, int cmd, va_list ap) { long int args[4]; @@ -562,7 +568,31 @@ libc_vfcntl (int fd, int cmd, va_list ap) return rc; } -DO_NOT_SANITIZE_ADDRESS_ATTRIBUTE int +#ifdef HAVE_FCNTL64 +int +libc_vfcntl64 (int fd, int cmd, va_list ap) +{ + long int args[4]; + int rc; + int i; + + swrap_bind_symbol_libc (fcntl64); + + for (i = 0; i < 4; i++) + { + args[i] = va_arg (ap, long int); + } + + rc = swrap.libc.symbols._libc_fcntl64.f (fd, + cmd, + args[0], args[1], args[2], + args[3]); + + return rc; +} +#endif + +int libc_vioctl (int fd, int cmd, va_list ap) { long int args[4];