From owner-cvs-all Wed Sep 26 2: 8:33 2001 Delivered-To: cvs-all@freebsd.org Received: from earth.backplane.com (earth-nat-cw.backplane.com [208.161.114.67]) by hub.freebsd.org (Postfix) with ESMTP id 330B137B401; Wed, 26 Sep 2001 02:08:26 -0700 (PDT) Received: (from dillon@localhost) by earth.backplane.com (8.11.6/8.11.2) id f8Q98Pm11521; Wed, 26 Sep 2001 02:08:25 -0700 (PDT) (envelope-from dillon) Date: Wed, 26 Sep 2001 02:08:25 -0700 (PDT) From: Matt Dillon Message-Id: <200109260908.f8Q98Pm11521@earth.backplane.com> To: Ruslan Ermilov Cc: cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG Subject: Re: cvs commit: src/bin/cat cat.1 cat.c References: <200109150039.f8F0dFZ41705@freefall.freebsd.org> <20010925211639.C57333@sunbay.com> <200109251909.f8PJ9eJ03402@earth.backplane.com> <20010926115717.E29020@sunbay.com> 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 :> 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, Yes, and.... so what? I never said it would be. The point is to simply minimize the number of unnecessary system calls for the common case. There is no need to stat() the file, you simply try to open() it. 99.9999% of the paths used with cat are simple files. There is no need to check whether it's a socket; if the open fails with a specific errno you simply try to connect() to it. If it isn't a socket, the connect() will fail. There is no need for anything more sophisticated. -Matt To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message