Making rsync compile under Mac OS X 10.3.9 with extended
attributes
Vitorio Machado
v.machado at permanence-informatique.fr
Sun Feb 10 22:55:20 GMT 2008
Here is the last version of my integration of Resource Forks and
Finder Info capabilities to OS X prior to Tiger: http://
shared.and.free.fr/sysxattrs_draft080210.c
Changelog:
- Coded the setter function
- Made changes to getter to emulate the expected behaviour when
sending NULL buffer and 0 size, to return the size of the arguments
What I've noticed: there is no clean way to code sys_fgetxattr as it
works with a file descriptor and the getattrlist only works with a
path. There is no fonction like "fgetattrlist" and the "easiest" way
to get a file path from it's file descriptor is to scan the
filesystem looking for an inode number... What a performance issue!
The good news: As I've seen in the code, sys_fgetxattr is only used
by get_stat_xattr when called by x_fstat all from xattrs.c. But no
code seems to call x_fstat, so it seems that this function is
useless, at least by now. Someone can confirm this?
TODO:
- Put the good includes in the header file (easy)
- Make a configure test to identify pre-tiger Macs (can somebody help
me with this, I don't really know how to do it)
- Test and debug it :)
- Integrate this modification to the main code
Good night, folks!
Vitorio
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