Making rsync compile under Mac OS X 10.3.9 with extended attributes

Vitorio Machado v.machado at permanence-informatique.fr
Fri Feb 8 07:20:18 GMT 2008


Thanks for the info, so I'll have to do an if/else and check manually  
the size when the buffer is NULL. It's not the case in the actual  
code. Any more reactions about what I've coded?

Thanks,

Vitorio Machado

Le 7 févr. 08 à 23:33, Wayne Davison a écrit :

> On Thu, Feb 07, 2008 at 10:51:34PM +0100, Vitorio Machado wrote:
>> I also noticed that sys_lgetxattr can not be called twice if the  
>> buffer
>> size is too small, because there is no offset management. Is this  
>> normal?
>
> The code calls sys_lgetxattr() once with a NULL pointer and a 0 length
> to ask for the size.  Then, it calls it with a buffer large enough to
> hold the attribute.  So, the best solution would be to make your code
> just ask the OS how big an item is when there is no buffer  
> pointer.  If
> that is not possible, it should be easy to cache an object in a static
> in your function and re-use it for a following call where the name
> matches.
>
> ..wayne..



More information about the rsync mailing list