Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7G6-0008Em-Bk for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jun 2020 09:36:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jp7G5-0002sK-35 for pgsql-hackers@arkaria.postgresql.org; Sat, 27 Jun 2020 09:36:25 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7G4-0002sC-SH for pgsql-hackers@lists.postgresql.org; Sat, 27 Jun 2020 09:36:24 +0000 Received: from wforward4-smtp.messagingengine.com ([64.147.123.34]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jp7Fx-0001bx-93 for pgsql-hackers@lists.postgresql.org; Sat, 27 Jun 2020 09:36:24 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailforward.west.internal (Postfix) with ESMTP id 231DD66D; Sat, 27 Jun 2020 05:36:14 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sat, 27 Jun 2020 05:36:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=H+WYZGYv+yScATjtqYggrNJ1MCv+SEFWGIVbrqlsi /U=; b=Bb8FnKur3+L1y5CbCXlMnlT3djQO/8iqQE5Wz7cpzCMgoCZ0gTXRtp/gd dIrFBB7XGDuYOQQIZNFfqMXpF8xHFN7XIMTeQ4MuYVilo5D5ZUj/defJJvEDOU5R G3kbEmPReaGbIn5jaWTqk82IcpOdixQ8RB35ss38G1/zitZQ/veirSBNUkgiemph ZiOB5V+grgox6g83aiTpGz774n56rAAm3qrgQGlidr6km2UZ5JTjLYK4LK6C+kf9 fi2T3EEkagSGeaU7m1PyHCovORToVJNGTKZE8Nw4+qMo8oDqbDQrqXApIG2GjWkG FEzXkbjtPMaLcHdgFuv6geAS+DLBw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudelfedgudelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhohfkffgfgggjtgfgsehtjeertddtfeejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrrdgvihhsvghnthhrrghuthesvdhnug hquhgrughrrghnthdrtghomheqnecuggftrfgrthhtvghrnhepteffjeelueelkeetueff ffefjeeftdehueevjeektdevvdegudeuhfeiveetiedvnecuffhomhgrihhnpehmihgtrh hoshhofhhtrdgtohhmpdhgihhthhhusgdrtghomhdpvdhnughquhgrughrrghnthdrtgho mhenucfkphepleefrddvgeefrdduledurddvfeeknecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepphgvthgvrhdrvghishgvnhhtrhgruhhtsedv nhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5df3bfee.dip0.t-ipconnect.de [93.243.191.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 3FED83067A08; Sat, 27 Jun 2020 05:36:12 -0400 (EDT) Subject: Re: pgsql: Enable Unix-domain sockets support on Windows To: Amit Kapila , PostgreSQL Hackers References: From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: <88ae9594-6177-fa3c-0061-5bf8f8044b21@2ndquadrant.com> Date: Sat, 27 Jun 2020 11:36:10 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-06-26 14:21, Amit Kapila wrote: > On Sat, Mar 28, 2020 at 7:37 PM Peter Eisentraut wrote: >> >> Enable Unix-domain sockets support on Windows >> > > + > +/* > + * Windows headers don't define this structure, but you can define it yourself > + * to use the functionality. > + */ > +struct sockaddr_un > +{ > + unsigned short sun_family; > + char sun_path[108]; > +}; > > I was going through this feature and reading about Windows support for > it. I came across a few links which suggest that this structure is > defined in . Is there a reason for not using this via > afunix.h? > > [1] - https://devblogs.microsoft.com/commandline/af_unix-comes-to-windows/ > [2] - https://gist.github.com/NZSmartie/079d8f894ee94f3035306cb23d49addc If we did it that way we'd have to write some kind of configuration-time check for the MSVC build, since not all Windows versions have that header. Also, not all versions of MinGW have that header (possibly none). So the current implementation is probably the most practical compromise. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services