From owner-freebsd-fs@FreeBSD.ORG Thu Nov 11 12:06:36 2010 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 03356106564A for ; Thu, 11 Nov 2010 12:06:36 +0000 (UTC) (envelope-from martin@lispworks.com) Received: from lwfs1-cam.cam.lispworks.com (mail.lispworks.com [193.34.186.230]) by mx1.freebsd.org (Postfix) with ESMTP id 920AD8FC14 for ; Thu, 11 Nov 2010 12:06:34 +0000 (UTC) Received: from higson.cam.lispworks.com (IDENT:U2FsdGVkX1+e19cTDG6C3wTBNk2namDyp3/fFqQ2vxY@higson [192.168.1.7]) by lwfs1-cam.cam.lispworks.com (8.14.3/8.14.3) with ESMTP id oABC6VkA002088; Thu, 11 Nov 2010 12:06:31 GMT (envelope-from martin@lispworks.com) Received: from higson.cam.lispworks.com by higson.cam.lispworks.com (8.13.1) id oABC6VGe027666; Thu, 11 Nov 2010 12:06:31 GMT Received: (from martin@localhost) by higson.cam.lispworks.com (8.13.1/8.13.1/Submit) id oABC6VYG027663; Thu, 11 Nov 2010 12:06:31 GMT Date: Thu, 11 Nov 2010 12:06:31 GMT Message-Id: <201011111206.oABC6VYG027663@higson.cam.lispworks.com> From: Martin Simmons To: mark@exonetric.com In-reply-to: <871369D9-7D63-4CE0-BB87-B8C46A62B271@exonetric.com> (message from Mark Blackman on Wed, 10 Nov 2010 22:28:27 +0000) References: <871369D9-7D63-4CE0-BB87-B8C46A62B271@exonetric.com> Cc: freebsd-fs@freebsd.org Subject: Re: ZFS and pathconf(_PC_NO_TRUNC) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Nov 2010 12:06:36 -0000 >>>>> On Wed, 10 Nov 2010 22:28:27 +0000, Mark Blackman said: > > I note that when testing the pathconf(2) NO_TRUNC property > on a ZFS filesystem, I get a ENOENT, "No such file or directory". > > I'm not sure if this qualifies as correct behaviour, but thought > a learned soul on this list could enlighten me. > > I've attached the C snippet I used for testing. > > #include > #include > #include > #include > #include > > int main(int argc, char *argv[]){ > int result; > > result=pathconf(argv[1], _PC_NO_TRUNC); > printf("for %s: no_trunc is %d\n",argv[1],result); > if (result<0) > perror(NULL); > 1; > } Your call to printf is clobbering the real errno, which is EINVAL. That is an allowed value according to the pathconf man page: [EINVAL] The implementation does not support an association of the variable name with the associated file. So it is correct, but maybe not useful. __Martin