You are not logged in.

#1 2012-04-24 16:10:04

philomath
Member
Registered: 2012-04-04
Posts: 11

Extended Attributes - Glibc and the 'attr' package

Glibc implements the (semi-standard) EA functions: {,l,f}setxattr, {,l,f}getxattr, {,l,f}removexattr, {,l,f}listxattr.  the interface of which is accessible via sys/xattr.h.
In core there is an 'attr' package -required by acl and more- that includes the exact same functions, the interface is in attr/xattr.h.

I see that attr includes some more -mostly convenience- functions, but other then that are they the same?  when should one prefer one over the other?

thanks.

Offline

#2 2012-04-24 16:38:30

lunar
Member
Registered: 2010-10-04
Posts: 95

Re: Extended Attributes - Glibc and the 'attr' package

@philomath: Use "attr/xattr.h". "sys/xattr.h" likely only declares the straight-forward interfaces to the underlying syscalls.

Offline

#3 2012-04-25 14:35:44

philomath
Member
Registered: 2012-04-04
Posts: 11

Re: Extended Attributes - Glibc and the 'attr' package

That's what I thought first, but look at the (attr) source, it can't go more straight-forward...
most of the other libattr functions are just for compatibility with Irix, (the only exceptions seems to be the attr_copy_* functions).

On Acl-devel they say:

The libattr interfaces predate the glibc interfaces - they were used
when we were originally developing the tools.

These days, you should always use the glibc variant.

thanks anyway.

Offline

Board footer

Powered by FluxBB