From owner-freebsd-hackers@FreeBSD.ORG Wed Nov 16 10:23:26 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BD3CB106564A for ; Wed, 16 Nov 2011 10:23:26 +0000 (UTC) (envelope-from joerg@britannica.bec.de) Received: from mo-p00-ob6.rzone.de (mo-p00-ob6.rzone.de [IPv6:2a01:238:20a:202:53f0::1]) by mx1.freebsd.org (Postfix) with ESMTP id 599538FC0A for ; Wed, 16 Nov 2011 10:23:26 +0000 (UTC) X-RZG-AUTH: :JiIXek6mfvEEUpFQdo7Fj1/zg48CFjWjQv0cW+St/nW/avgusCdvwXOZ/NA7x/bslx4UOSLYuW7Bwv8PtjkoBcppeXE= X-RZG-CLASS-ID: mo00 Received: from britannica.bec.de ([2001:6f8:13f0:0:224:d7ff:fe63:d530]) by smtp.strato.de (klopstock mo40) (RZmta 26.10 AUTH) with (DHE-RSA-AES128-SHA encrypted) ESMTPA id L04d2fnAG9XbLv for ; Wed, 16 Nov 2011 11:23:12 +0100 (MET) Received: by britannica.bec.de (sSMTP sendmail emulation); Wed, 16 Nov 2011 11:22:39 +0100 Date: Wed, 16 Nov 2011 11:22:39 +0100 From: Joerg Sonnenberger To: freebsd-hackers@freebsd.org Message-ID: <20111116102239.GA2687@britannica.bec.de> Mail-Followup-To: freebsd-hackers@freebsd.org References: <20111115202450.GA73512@freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111115202450.GA73512@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: easy way to determine if a stream or fd is seekable X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Nov 2011 10:23:26 -0000 On Tue, Nov 15, 2011 at 08:24:50PM +0000, Alexander Best wrote: > one of the things i'm missing is an easy way to determine, whether a stream or > fd is seekable. i checked the dd(1) and hd(1) sources and those tools are > performing so much stuff just to find out if this is the case, and they still > are doing a very poor job. Isn't the primary issue that FreeBSD doesn't properly report errors for lseek(2)? I think you should start from that and not hack around the fallout... Joerg