[Box Backup-dev] First errors on Darwin

Ben Summers boxbackup-dev@fluffy.co.uk
Sun, 18 Dec 2005 13:09:16 +0000


On 18 Dec 2005, at 10:21, Martin Ebourne wrote:

> On Sun, 2005-12-18 at 09:58 +0000, Ben Summers wrote:
>> So, checkout, ./bootstrap and ./configure all work fine on Darwin.
>> The last one is probably easy to sort out, but Darwin doesn't have
>> llistxattr, but it does have listxattr:
>>
>> ssize_t
>>       listxattr(const char *path, char *namebuf, size_t size, int
>> options);
>
> "llistxattr  is identical to listxattr, except in the case of a  
> symbolic
>  link, where the list of names of extended  attributes  associated   
> with
>  the link itself is retrieved, not the file that it refers to."
>
> Does darwin not have symlinks?

It does have them, it would be a bit pants if it didn't.

So llistxattr is just listxattr with XATTR_NOFOLLOW set in the  
options under Darwin. Learn something new every day.


>
>> What sort autoconf magic do I need to detect this?
>
> Add llistxattr to the end of this line in configure.ac. Then there
> should be a new HAVE_ in config.h which will be undefined for you.
>
> AC_CHECK_FUNCS([getpeereid kqueue lchown setproctitle])
>
> If you need an extra library to be linked in, then instead add  
> something
> like:
>
> AC_CHECK_LIB([xattr], [listxattr])
> AC_CHECK_FUNCS([llistxattr])
>
> If darwin does have symlinks but no llistxattr then I think probably
> some extra logic will be required too.

Can I check for XATTR_NOFOLLOW being defined in a similar way?

Ben