ZFS and pathconf(_PC_NO_TRUNC)
Mark Blackman
mark at exonetric.com
Thu Nov 11 12:10:53 UTC 2010
On 11 Nov 2010, at 12:06, Martin Simmons wrote:
>>>>>> On Wed, 10 Nov 2010 22:28:27 +0000, Mark Blackman said:
>>
>> #include <unistd.h>
>> #include <stdlib.h>
>> #include <stdio.h>
>> #include <string.h>
>> #include <errno.h>
>>
>> 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.
Doh! thanks for pointing that out. :)
> 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.
hmm. this is popping up in the context of building perl 5.12 on a zfs-only
filesystem. One of the POSIX::* tests fails because of the above.
- Mark
More information about the freebsd-fs
mailing list