From owner-cvs-all Wed Sep 26 1:58:29 2001 Delivered-To: cvs-all@freebsd.org Received: from whale.sunbay.crimea.ua (whale.sunbay.crimea.ua [212.110.138.65]) by hub.freebsd.org (Postfix) with ESMTP id 0621C37B410; Wed, 26 Sep 2001 01:58:13 -0700 (PDT) Received: (from ru@localhost) by whale.sunbay.crimea.ua (8.11.2/8.11.2) id f8Q8vHn42629; Wed, 26 Sep 2001 11:57:17 +0300 (EEST) (envelope-from ru) Date: Wed, 26 Sep 2001 11:57:17 +0300 From: Ruslan Ermilov To: Matt Dillon Cc: cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/bin/cat cat.1 cat.c Message-ID: <20010926115717.E29020@sunbay.com> References: <200109150039.f8F0dFZ41705@freefall.freebsd.org> <20010925211639.C57333@sunbay.com> <200109251909.f8PJ9eJ03402@earth.backplane.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200109251909.f8PJ9eJ03402@earth.backplane.com>; from dillon@earth.backplane.com on Tue, Sep 25, 2001 at 12:09:40PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tue, Sep 25, 2001 at 12:09:40PM -0700, Matt Dillon wrote: > > : > :How about testing with stat(2) that an argument is a socket > :thus eliminating the need to open(2) sockets and connect(2) > :to non-sockets? > > I don't see any particular reason why. An open() failure is as fast > or faster then stat(). If it fails and we get the appropriate errno, > we try a connect(). Either connect() is supported or it isn't. If it > is a case of a missing file we don't try the connect() because we get > a different errno. I see no particular need to stat the path, no ill > effects will occur if the connect() fails. > Just because EOPNOTSUPP from open(2) doesn't necessarily mean that the underlying object is of type socket. Cheers, -- Ruslan Ermilov Oracle Developer/DBA, ru@sunbay.com Sunbay Software AG, ru@FreeBSD.org FreeBSD committer, +380.652.512.251 Simferopol, Ukraine http://www.FreeBSD.org The Power To Serve http://www.oracle.com Enabling The Information Age To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message