From 43df29552865541e6d6d11a14b3cf47a4c162b42 Mon Sep 17 00:00:00 2001
From: ahedberg <ahedberg@google.com>
Date: Fri, 18 Mar 2016 10:46:38 -0400
Subject: [PATCH] add unix_sockets_posix module to build system and fix
 compilation errors

---
 BUILD                                         |  9 ++++++++
 Makefile                                      |  4 ++++
 binding.gyp                                   |  2 ++
 build.yaml                                    |  3 +++
 config.m4                                     |  2 ++
 gRPC.podspec                                  |  4 ++++
 grpc.gemspec                                  |  3 +++
 package.json                                  |  3 +++
 package.xml                                   |  3 +++
 src/core/iomgr/resolve_address_posix.c        |  2 +-
 src/core/iomgr/sockaddr_utils.c               |  2 +-
 src/core/iomgr/tcp_client_posix.c             |  4 ++--
 src/core/iomgr/unix_sockets_posix.c           | 18 +++++++--------
 src/core/iomgr/unix_sockets_posix.h           | 15 +++++-------
 src/core/iomgr/unix_sockets_posix_noop.c      | 23 +++++++++++--------
 src/python/grpcio/grpc_core_dependencies.py   |  2 ++
 tools/doxygen/Doxyfile.core.internal          |  3 +++
 tools/run_tests/sources_and_headers.json      |  8 +++++++
 vsprojects/vcxproj/grpc/grpc.vcxproj          |  5 ++++
 vsprojects/vcxproj/grpc/grpc.vcxproj.filters  |  9 ++++++++
 .../grpc_unsecure/grpc_unsecure.vcxproj       |  5 ++++
 .../grpc_unsecure.vcxproj.filters             |  9 ++++++++
 22 files changed, 107 insertions(+), 31 deletions(-)

diff --git a/BUILD b/BUILD
index 0e9f37a0e3..70d188afdf 100644
--- a/BUILD
+++ b/BUILD
@@ -221,6 +221,7 @@ cc_library(
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
     "src/core/iomgr/udp_server.h",
+    "src/core/iomgr/unix_sockets_posix.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
     "src/core/iomgr/workqueue.h",
@@ -361,6 +362,8 @@ cc_library(
     "src/core/iomgr/timer.c",
     "src/core/iomgr/timer_heap.c",
     "src/core/iomgr/udp_server.c",
+    "src/core/iomgr/unix_sockets_posix.c",
+    "src/core/iomgr/unix_sockets_posix_noop.c",
     "src/core/iomgr/wakeup_fd_eventfd.c",
     "src/core/iomgr/wakeup_fd_nospecial.c",
     "src/core/iomgr/wakeup_fd_pipe.c",
@@ -551,6 +554,7 @@ cc_library(
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
     "src/core/iomgr/udp_server.h",
+    "src/core/iomgr/unix_sockets_posix.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
     "src/core/iomgr/workqueue.h",
@@ -678,6 +682,8 @@ cc_library(
     "src/core/iomgr/timer.c",
     "src/core/iomgr/timer_heap.c",
     "src/core/iomgr/udp_server.c",
+    "src/core/iomgr/unix_sockets_posix.c",
+    "src/core/iomgr/unix_sockets_posix_noop.c",
     "src/core/iomgr/wakeup_fd_eventfd.c",
     "src/core/iomgr/wakeup_fd_nospecial.c",
     "src/core/iomgr/wakeup_fd_pipe.c",
@@ -1339,6 +1345,8 @@ objc_library(
     "src/core/iomgr/timer.c",
     "src/core/iomgr/timer_heap.c",
     "src/core/iomgr/udp_server.c",
+    "src/core/iomgr/unix_sockets_posix.c",
+    "src/core/iomgr/unix_sockets_posix_noop.c",
     "src/core/iomgr/wakeup_fd_eventfd.c",
     "src/core/iomgr/wakeup_fd_nospecial.c",
     "src/core/iomgr/wakeup_fd_pipe.c",
@@ -1510,6 +1518,7 @@ objc_library(
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
     "src/core/iomgr/udp_server.h",
+    "src/core/iomgr/unix_sockets_posix.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
     "src/core/iomgr/workqueue.h",
diff --git a/Makefile b/Makefile
index f118d54253..e980b1c877 100644
--- a/Makefile
+++ b/Makefile
@@ -2432,6 +2432,8 @@ LIBGRPC_SRC = \
     src/core/iomgr/timer.c \
     src/core/iomgr/timer_heap.c \
     src/core/iomgr/udp_server.c \
+    src/core/iomgr/unix_sockets_posix.c \
+    src/core/iomgr/unix_sockets_posix_noop.c \
     src/core/iomgr/wakeup_fd_eventfd.c \
     src/core/iomgr/wakeup_fd_nospecial.c \
     src/core/iomgr/wakeup_fd_pipe.c \
@@ -2744,6 +2746,8 @@ LIBGRPC_UNSECURE_SRC = \
     src/core/iomgr/timer.c \
     src/core/iomgr/timer_heap.c \
     src/core/iomgr/udp_server.c \
+    src/core/iomgr/unix_sockets_posix.c \
+    src/core/iomgr/unix_sockets_posix_noop.c \
     src/core/iomgr/wakeup_fd_eventfd.c \
     src/core/iomgr/wakeup_fd_nospecial.c \
     src/core/iomgr/wakeup_fd_pipe.c \
diff --git a/binding.gyp b/binding.gyp
index d1e086cfa0..e1f41c224e 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -627,6 +627,8 @@
         'src/core/iomgr/timer.c',
         'src/core/iomgr/timer_heap.c',
         'src/core/iomgr/udp_server.c',
+        'src/core/iomgr/unix_sockets_posix.c',
+        'src/core/iomgr/unix_sockets_posix_noop.c',
         'src/core/iomgr/wakeup_fd_eventfd.c',
         'src/core/iomgr/wakeup_fd_nospecial.c',
         'src/core/iomgr/wakeup_fd_pipe.c',
diff --git a/build.yaml b/build.yaml
index 83b7714e65..3f9abccf9f 100644
--- a/build.yaml
+++ b/build.yaml
@@ -310,6 +310,7 @@ filegroups:
   - src/core/iomgr/timer.h
   - src/core/iomgr/timer_heap.h
   - src/core/iomgr/udp_server.h
+  - src/core/iomgr/unix_sockets_posix.h
   - src/core/iomgr/wakeup_fd_pipe.h
   - src/core/iomgr/wakeup_fd_posix.h
   - src/core/iomgr/workqueue.h
@@ -430,6 +431,8 @@ filegroups:
   - src/core/iomgr/timer.c
   - src/core/iomgr/timer_heap.c
   - src/core/iomgr/udp_server.c
+  - src/core/iomgr/unix_sockets_posix.c
+  - src/core/iomgr/unix_sockets_posix_noop.c
   - src/core/iomgr/wakeup_fd_eventfd.c
   - src/core/iomgr/wakeup_fd_nospecial.c
   - src/core/iomgr/wakeup_fd_pipe.c
diff --git a/config.m4 b/config.m4
index 8ab45e6603..37d71ecb94 100644
--- a/config.m4
+++ b/config.m4
@@ -149,6 +149,8 @@ if test "$PHP_GRPC" != "no"; then
     src/core/iomgr/timer.c \
     src/core/iomgr/timer_heap.c \
     src/core/iomgr/udp_server.c \
+    src/core/iomgr/unix_sockets_posix.c \
+    src/core/iomgr/unix_sockets_posix_noop.c \
     src/core/iomgr/wakeup_fd_eventfd.c \
     src/core/iomgr/wakeup_fd_nospecial.c \
     src/core/iomgr/wakeup_fd_pipe.c \
diff --git a/gRPC.podspec b/gRPC.podspec
index f3103ea79a..ea178960fe 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -225,6 +225,7 @@ Pod::Spec.new do |s|
                       'src/core/iomgr/timer.h',
                       'src/core/iomgr/timer_heap.h',
                       'src/core/iomgr/udp_server.h',
+                      'src/core/iomgr/unix_sockets_posix.h',
                       'src/core/iomgr/wakeup_fd_pipe.h',
                       'src/core/iomgr/wakeup_fd_posix.h',
                       'src/core/iomgr/workqueue.h',
@@ -378,6 +379,8 @@ Pod::Spec.new do |s|
                       'src/core/iomgr/timer.c',
                       'src/core/iomgr/timer_heap.c',
                       'src/core/iomgr/udp_server.c',
+                      'src/core/iomgr/unix_sockets_posix.c',
+                      'src/core/iomgr/unix_sockets_posix_noop.c',
                       'src/core/iomgr/wakeup_fd_eventfd.c',
                       'src/core/iomgr/wakeup_fd_nospecial.c',
                       'src/core/iomgr/wakeup_fd_pipe.c',
@@ -546,6 +549,7 @@ Pod::Spec.new do |s|
                               'src/core/iomgr/timer.h',
                               'src/core/iomgr/timer_heap.h',
                               'src/core/iomgr/udp_server.h',
+                              'src/core/iomgr/unix_sockets_posix.h',
                               'src/core/iomgr/wakeup_fd_pipe.h',
                               'src/core/iomgr/wakeup_fd_posix.h',
                               'src/core/iomgr/workqueue.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index 1b3f15ecf3..6d94258a21 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -221,6 +221,7 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/iomgr/timer.h )
   s.files += %w( src/core/iomgr/timer_heap.h )
   s.files += %w( src/core/iomgr/udp_server.h )
+  s.files += %w( src/core/iomgr/unix_sockets_posix.h )
   s.files += %w( src/core/iomgr/wakeup_fd_pipe.h )
   s.files += %w( src/core/iomgr/wakeup_fd_posix.h )
   s.files += %w( src/core/iomgr/workqueue.h )
@@ -361,6 +362,8 @@ Gem::Specification.new do |s|
   s.files += %w( src/core/iomgr/timer.c )
   s.files += %w( src/core/iomgr/timer_heap.c )
   s.files += %w( src/core/iomgr/udp_server.c )
+  s.files += %w( src/core/iomgr/unix_sockets_posix.c )
+  s.files += %w( src/core/iomgr/unix_sockets_posix_noop.c )
   s.files += %w( src/core/iomgr/wakeup_fd_eventfd.c )
   s.files += %w( src/core/iomgr/wakeup_fd_nospecial.c )
   s.files += %w( src/core/iomgr/wakeup_fd_pipe.c )
diff --git a/package.json b/package.json
index db7f299e13..27342cceb0 100644
--- a/package.json
+++ b/package.json
@@ -165,6 +165,7 @@
     "src/core/iomgr/timer.h",
     "src/core/iomgr/timer_heap.h",
     "src/core/iomgr/udp_server.h",
+    "src/core/iomgr/unix_sockets_posix.h",
     "src/core/iomgr/wakeup_fd_pipe.h",
     "src/core/iomgr/wakeup_fd_posix.h",
     "src/core/iomgr/workqueue.h",
@@ -305,6 +306,8 @@
     "src/core/iomgr/timer.c",
     "src/core/iomgr/timer_heap.c",
     "src/core/iomgr/udp_server.c",
+    "src/core/iomgr/unix_sockets_posix.c",
+    "src/core/iomgr/unix_sockets_posix_noop.c",
     "src/core/iomgr/wakeup_fd_eventfd.c",
     "src/core/iomgr/wakeup_fd_nospecial.c",
     "src/core/iomgr/wakeup_fd_pipe.c",
diff --git a/package.xml b/package.xml
index bb4dcc2037..b992470343 100644
--- a/package.xml
+++ b/package.xml
@@ -225,6 +225,7 @@
     <file baseinstalldir="/" name="src/core/iomgr/timer.h" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/timer_heap.h" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/udp_server.h" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/unix_sockets_posix.h" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_pipe.h" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_posix.h" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/workqueue.h" role="src" />
@@ -365,6 +366,8 @@
     <file baseinstalldir="/" name="src/core/iomgr/timer.c" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/timer_heap.c" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/udp_server.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/unix_sockets_posix.c" role="src" />
+    <file baseinstalldir="/" name="src/core/iomgr/unix_sockets_posix_noop.c" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_eventfd.c" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_nospecial.c" role="src" />
     <file baseinstalldir="/" name="src/core/iomgr/wakeup_fd_pipe.c" role="src" />
diff --git a/src/core/iomgr/resolve_address_posix.c b/src/core/iomgr/resolve_address_posix.c
index ef193c02ec..26b3aa8189 100644
--- a/src/core/iomgr/resolve_address_posix.c
+++ b/src/core/iomgr/resolve_address_posix.c
@@ -50,7 +50,7 @@
 #include "src/core/iomgr/executor.h"
 #include "src/core/iomgr/iomgr_internal.h"
 #include "src/core/iomgr/sockaddr_utils.h"
-#include "src/core/iomgr/unix_posix_sockets.h"
+#include "src/core/iomgr/unix_sockets_posix.h"
 #include "src/core/support/block_annotate.h"
 #include "src/core/support/string.h"
 
diff --git a/src/core/iomgr/sockaddr_utils.c b/src/core/iomgr/sockaddr_utils.c
index 667ab01432..682b290a83 100644
--- a/src/core/iomgr/sockaddr_utils.c
+++ b/src/core/iomgr/sockaddr_utils.c
@@ -200,7 +200,7 @@ int grpc_sockaddr_get_port(const struct sockaddr *addr) {
     case AF_INET6:
       return ntohs(((struct sockaddr_in6 *)addr)->sin6_port);
     default:
-      if (grpc_is_unix_socket(addr->sa_family)) {
+      if (grpc_is_unix_socket(addr)) {
         return 1;
       }
       gpr_log(GPR_ERROR, "Unknown socket family %d in grpc_sockaddr_get_port",
diff --git a/src/core/iomgr/tcp_client_posix.c b/src/core/iomgr/tcp_client_posix.c
index 2ed6fb107b..1d3f9b6555 100644
--- a/src/core/iomgr/tcp_client_posix.c
+++ b/src/core/iomgr/tcp_client_posix.c
@@ -54,6 +54,7 @@
 #include "src/core/iomgr/socket_utils_posix.h"
 #include "src/core/iomgr/tcp_posix.h"
 #include "src/core/iomgr/timer.h"
+#include "src/core/iomgr/unix_sockets_posix.h"
 #include "src/core/support/string.h"
 
 extern int grpc_tcp_trace;
@@ -77,8 +78,7 @@ static int prepare_socket(const struct sockaddr *addr, int fd) {
   }
 
   if (!grpc_set_socket_nonblocking(fd, 1) || !grpc_set_socket_cloexec(fd, 1) ||
-      (!grpc_is_unix_socket(addr->sa_family) &&
-       !grpc_set_socket_low_latency(fd, 1)) ||
+      (!grpc_is_unix_socket(addr) && !grpc_set_socket_low_latency(fd, 1)) ||
       !grpc_set_socket_no_sigpipe_if_possible(fd)) {
     gpr_log(GPR_ERROR, "Unable to configure socket %d: %s", fd,
             strerror(errno));
diff --git a/src/core/iomgr/unix_sockets_posix.c b/src/core/iomgr/unix_sockets_posix.c
index 531ddcb37d..0ff48320ca 100644
--- a/src/core/iomgr/unix_sockets_posix.c
+++ b/src/core/iomgr/unix_sockets_posix.c
@@ -36,6 +36,7 @@
 #ifdef GPR_HAVE_UNIX_SOCKET
 
 #include <sys/types.h>
+#include <sys/stat.h>
 #include <sys/un.h>
 
 #include <grpc/support/alloc.h>
@@ -47,7 +48,7 @@ void grpc_create_socketpair_if_unix(int sv[2]) {
 grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) {
   struct sockaddr_un *un;
 
-  addrs = gpr_malloc(sizeof(grpc_resolved_addresses));
+  grpc_resolved_addresses *addrs = gpr_malloc(sizeof(grpc_resolved_addresses));
   addrs->naddrs = 1;
   addrs->addrs = gpr_malloc(sizeof(grpc_resolved_address));
   un = (struct sockaddr_un *)addrs->addrs->addr;
@@ -57,11 +58,11 @@ grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) {
   return addrs;
 }
 
-int grpc_is_unix_socket(sa_family_t addr_family) {
-  return addr_family == AF_UNIX;
+int grpc_is_unix_socket(const struct sockaddr *addr) {
+  return addr->sa_family == AF_UNIX;
 }
 
-static void unlink_if_unix_domain_socket(const struct sockaddr *addr) {
+void unlink_if_unix_domain_socket(const struct sockaddr *addr) {
   if (addr->sa_family != AF_UNIX) {
     return;
   }
@@ -73,8 +74,7 @@ static void unlink_if_unix_domain_socket(const struct sockaddr *addr) {
   }
 }
 
-static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr,
-                      size_t *len) {
+int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len) {
   struct sockaddr_un *un = (struct sockaddr_un *)addr;
 
   un->sun_family = AF_UNIX;
@@ -84,12 +84,12 @@ static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr,
   return 1;
 }
 
-static char *unix_get_default_authority(grpc_resolver_factory *factory,
-                                        grpc_uri *uri) {
+char *unix_get_default_authority(grpc_resolver_factory *factory,
+                                 grpc_uri *uri) {
   return gpr_strdup("localhost");
 }
 
-char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) {
+char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr) {
   if (addr->sa_family != AF_UNIX) {
     return NULL;
   }
diff --git a/src/core/iomgr/unix_sockets_posix.h b/src/core/iomgr/unix_sockets_posix.h
index 6023611373..c7ba0bfe09 100644
--- a/src/core/iomgr/unix_sockets_posix.h
+++ b/src/core/iomgr/unix_sockets_posix.h
@@ -43,25 +43,22 @@
 #include <grpc/support/string_util.h>
 
 #include "src/core/client_config/resolver_factory.h"
-#include "src/core/client_config/uri_parser.h";
+#include "src/core/client_config/uri_parser.h"
 #include "src/core/iomgr/resolve_address.h"
 
 void grpc_create_socketpair_if_unix(int sv[2]);
 
 grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name);
 
-int grpc_is_unix_socket(sa_family_t addr_family);
+int grpc_is_unix_socket(const struct sockaddr *addr);
 
-static void unlink_if_unix_domain_socket(const struct sockaddr *addr);
+void unlink_if_unix_domain_socket(const struct sockaddr *addr);
 
-static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr,
-                      size_t *len);
+int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len);
 
-static char *unix_get_default_authority(grpc_resolver_factory *factory,
-                                        grpc_uri *uri);
+char *unix_get_default_authority(grpc_resolver_factory *factory, grpc_uri *uri);
 
-char *grpc_sockaddr_to_uri_unix_if_possible(char **strp,
-                                            const char *format, ...);
+char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr);
 
 #endif
 #endif /* GRPC_INTERNAL_CORE_IOMGR_UNIX_SOCKETS_POSIX_H */
diff --git a/src/core/iomgr/unix_sockets_posix_noop.c b/src/core/iomgr/unix_sockets_posix_noop.c
index 1e29242486..1f6773576c 100644
--- a/src/core/iomgr/unix_sockets_posix_noop.c
+++ b/src/core/iomgr/unix_sockets_posix_noop.c
@@ -34,26 +34,31 @@
 
 #include "src/core/iomgr/unix_sockets_posix.h"
 
+#ifdef GPR_POSIX_SOCKET
+
 void grpc_create_socketpair_if_unix(int sv[2]) {}
 
-void grpc_resolve_unix_domain_address(const char* name) {
+grpc_resolved_addresses *grpc_resolve_unix_domain_address(const char* name) {
   return NULL;
 }
 
-int grpc_is_unix_socket(sa_family_t addr_family) {
+int grpc_is_unix_socket(const struct sockaddr *addr) {
   return false;
 }
 
-static void unlink_if_unix_domain_socket(const struct sockaddr *addr) {}
+void unlink_if_unix_domain_socket(const struct sockaddr *addr) {}
 
-static int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr,
-                      size_t *len) {}
+int parse_unix(grpc_uri *uri, struct sockaddr_storage *addr, size_t *len) {
+  return 0;
+}
 
-static char *unix_get_default_authority(grpc_resolver_factory *factory,
-                                        grpc_uri *uri) {}
+char *unix_get_default_authority(grpc_resolver_factory *factory,
+                                 grpc_uri *uri) {
+  return NULL;
+}
 
-char *grpc_sockaddr_to_uri_unix_if_possible(struct sockaddr *addr) {
-    return NULL;
+char *grpc_sockaddr_to_uri_unix_if_possible(const struct sockaddr *addr) {
+  return NULL;
 }
 
 #endif
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index a543791f5c..9c131bb4f0 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -143,6 +143,8 @@ CORE_SOURCE_FILES = [
   'src/core/iomgr/timer.c',
   'src/core/iomgr/timer_heap.c',
   'src/core/iomgr/udp_server.c',
+  'src/core/iomgr/unix_sockets_posix.c',
+  'src/core/iomgr/unix_sockets_posix_noop.c',
   'src/core/iomgr/wakeup_fd_eventfd.c',
   'src/core/iomgr/wakeup_fd_nospecial.c',
   'src/core/iomgr/wakeup_fd_pipe.c',
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index a894eaf22b..fe8dbe0418 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -839,6 +839,7 @@ src/core/iomgr/time_averaged_stats.h \
 src/core/iomgr/timer.h \
 src/core/iomgr/timer_heap.h \
 src/core/iomgr/udp_server.h \
+src/core/iomgr/unix_sockets_posix.h \
 src/core/iomgr/wakeup_fd_pipe.h \
 src/core/iomgr/wakeup_fd_posix.h \
 src/core/iomgr/workqueue.h \
@@ -979,6 +980,8 @@ src/core/iomgr/time_averaged_stats.c \
 src/core/iomgr/timer.c \
 src/core/iomgr/timer_heap.c \
 src/core/iomgr/udp_server.c \
+src/core/iomgr/unix_sockets_posix.c \
+src/core/iomgr/unix_sockets_posix_noop.c \
 src/core/iomgr/wakeup_fd_eventfd.c \
 src/core/iomgr/wakeup_fd_nospecial.c \
 src/core/iomgr/wakeup_fd_pipe.c \
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 092ed35ad9..83dbf0ba5f 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -3955,6 +3955,7 @@
       "src/core/iomgr/timer.h", 
       "src/core/iomgr/timer_heap.h", 
       "src/core/iomgr/udp_server.h", 
+      "src/core/iomgr/unix_sockets_posix.h", 
       "src/core/iomgr/wakeup_fd_pipe.h", 
       "src/core/iomgr/wakeup_fd_posix.h", 
       "src/core/iomgr/workqueue.h", 
@@ -4185,6 +4186,9 @@
       "src/core/iomgr/timer_heap.h", 
       "src/core/iomgr/udp_server.c", 
       "src/core/iomgr/udp_server.h", 
+      "src/core/iomgr/unix_sockets_posix.c", 
+      "src/core/iomgr/unix_sockets_posix.h", 
+      "src/core/iomgr/unix_sockets_posix_noop.c", 
       "src/core/iomgr/wakeup_fd_eventfd.c", 
       "src/core/iomgr/wakeup_fd_nospecial.c", 
       "src/core/iomgr/wakeup_fd_pipe.c", 
@@ -4512,6 +4516,7 @@
       "src/core/iomgr/timer.h", 
       "src/core/iomgr/timer_heap.h", 
       "src/core/iomgr/udp_server.h", 
+      "src/core/iomgr/unix_sockets_posix.h", 
       "src/core/iomgr/wakeup_fd_pipe.h", 
       "src/core/iomgr/wakeup_fd_posix.h", 
       "src/core/iomgr/workqueue.h", 
@@ -4726,6 +4731,9 @@
       "src/core/iomgr/timer_heap.h", 
       "src/core/iomgr/udp_server.c", 
       "src/core/iomgr/udp_server.h", 
+      "src/core/iomgr/unix_sockets_posix.c", 
+      "src/core/iomgr/unix_sockets_posix.h", 
+      "src/core/iomgr/unix_sockets_posix_noop.c", 
       "src/core/iomgr/wakeup_fd_eventfd.c", 
       "src/core/iomgr/wakeup_fd_nospecial.c", 
       "src/core/iomgr/wakeup_fd_pipe.c", 
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj
index c2635c31a3..ac87537a85 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj
@@ -348,6 +348,7 @@
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\timer.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\timer_heap.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\udp_server.h" />
+    <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_pipe.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_posix.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\workqueue.h" />
@@ -560,6 +561,10 @@
     </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\udp_server.c">
     </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.c">
+    </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix_noop.c">
+    </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_eventfd.c">
     </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_nospecial.c">
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
index 6dd10d3dd3..3a36073b9d 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
@@ -211,6 +211,12 @@
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\udp_server.c">
       <Filter>src\core\iomgr</Filter>
     </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.c">
+      <Filter>src\core\iomgr</Filter>
+    </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix_noop.c">
+      <Filter>src\core\iomgr</Filter>
+    </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_eventfd.c">
       <Filter>src\core\iomgr</Filter>
     </ClCompile>
@@ -722,6 +728,9 @@
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\udp_server.h">
       <Filter>src\core\iomgr</Filter>
     </ClInclude>
+    <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.h">
+      <Filter>src\core\iomgr</Filter>
+    </ClInclude>
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_pipe.h">
       <Filter>src\core\iomgr</Filter>
     </ClInclude>
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
index f0d869ba93..9126183e20 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
@@ -338,6 +338,7 @@
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\timer.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\timer_heap.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\udp_server.h" />
+    <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_pipe.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_posix.h" />
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\workqueue.h" />
@@ -538,6 +539,10 @@
     </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\udp_server.c">
     </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.c">
+    </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix_noop.c">
+    </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_eventfd.c">
     </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_nospecial.c">
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
index 1f240212a3..b7cf0764e8 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
@@ -214,6 +214,12 @@
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\udp_server.c">
       <Filter>src\core\iomgr</Filter>
     </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.c">
+      <Filter>src\core\iomgr</Filter>
+    </ClCompile>
+    <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix_noop.c">
+      <Filter>src\core\iomgr</Filter>
+    </ClCompile>
     <ClCompile Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_eventfd.c">
       <Filter>src\core\iomgr</Filter>
     </ClCompile>
@@ -659,6 +665,9 @@
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\udp_server.h">
       <Filter>src\core\iomgr</Filter>
     </ClInclude>
+    <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\unix_sockets_posix.h">
+      <Filter>src\core\iomgr</Filter>
+    </ClInclude>
     <ClInclude Include="$(SolutionDir)\..\src\core\iomgr\wakeup_fd_pipe.h">
       <Filter>src\core\iomgr</Filter>
     </ClInclude>
-- 
GitLab