* commit '72dc86ec5f8927d7be03b110a61aba45e94b4cfa': The host prebuilt glibc is 2.11, so remove workarounds for 2.9.
This commit is contained in:
		@@ -23,13 +23,9 @@
 | 
			
		||||
#include <fcntl.h>
 | 
			
		||||
 | 
			
		||||
#if defined(__BIONIC__)
 | 
			
		||||
  #define ACCEPT4_SUPPORTED 1
 | 
			
		||||
  #define RECVMMSG_SUPPORTED 1
 | 
			
		||||
  #define SENDMMSG_SUPPORTED 1
 | 
			
		||||
#elif defined(__GLIBC_PREREQ)
 | 
			
		||||
  #if __GLIBC_PREREQ(2, 9)
 | 
			
		||||
    #define ACCEPT4_SUPPORTED 1
 | 
			
		||||
  #endif
 | 
			
		||||
  #if __GLIBC_PREREQ(2, 12)
 | 
			
		||||
    #define RECVMMSG_SUPPORTED 1
 | 
			
		||||
  #endif
 | 
			
		||||
@@ -38,8 +34,6 @@
 | 
			
		||||
  #endif
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
#if defined(ACCEPT4_SUPPORTED) || defined(RECVMMSG_SUPPORTED) || defined(SENDMMSG_SUPPORTED)
 | 
			
		||||
 | 
			
		||||
#define SOCK_PATH "test"
 | 
			
		||||
 | 
			
		||||
static void* ConnectFn(void* data) {
 | 
			
		||||
@@ -105,18 +99,12 @@ static void RunTest(void (*test_fn)(struct sockaddr_un*, int),
 | 
			
		||||
 | 
			
		||||
  close(fd);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
TEST(sys_socket, accept4_error) {
 | 
			
		||||
#if defined(ACCEPT4_SUPPORTED)
 | 
			
		||||
  ASSERT_EQ(-1, accept4(-1, NULL, NULL, 0));
 | 
			
		||||
  ASSERT_EQ(EBADF, errno);
 | 
			
		||||
#else
 | 
			
		||||
  GTEST_LOG_(INFO) << "This test does nothing.\n";
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(ACCEPT4_SUPPORTED)
 | 
			
		||||
static void TestAccept4(struct sockaddr_un* addr, int fd) {
 | 
			
		||||
  socklen_t len = sizeof(*addr);
 | 
			
		||||
  int fd_acc = accept4(fd, reinterpret_cast<struct sockaddr*>(addr), &len, SOCK_CLOEXEC);
 | 
			
		||||
@@ -127,14 +115,9 @@ static void TestAccept4(struct sockaddr_un* addr, int fd) {
 | 
			
		||||
 | 
			
		||||
  close(fd_acc);
 | 
			
		||||
}
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
TEST(sys_socket, accept4_smoke) {
 | 
			
		||||
#if defined(ACCEPT4_SUPPORTED)
 | 
			
		||||
  RunTest(TestAccept4, NULL);
 | 
			
		||||
#else
 | 
			
		||||
  GTEST_LOG_(INFO) << "This test does nothing.\n";
 | 
			
		||||
#endif
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
#if defined(RECVMMSG_SUPPORTED)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user