linux/xattr.h and sys/xattr.h conflicts
Allan McRae
allan@archlinux.org
Sun Jan 5 14:31:00 GMT 2014
Hi,
The latest version of libcap (2.23) provides the header
<sys/capability.h> which now includes <linux/xattr.h>. From a quick
look, it appears the libcap now library uses various things in the
<linux/xattr.h> header that are not in the <sys/xattr.h> header.
Anyway... this has lead to bug reports in the form:
1) compiles fine:
#include <sys/xattr.h>
#include <linux/xattr.h>
2) generates compile errors:
#include <linux/xattr.h>
#include <sys/xattr.h>
<linux/xattr.h> has:
#define XATTR_CREATE 0x1 /* set value, fail if attr already exists */
#define XATTR_REPLACE 0x2 /* set value, fail if attr does not exist */
<sys/xattr.h> has:
enum
{
XATTR_CREATE = 1, /* set value, fail if attr already exists. */
#define XATTR_CREATE XATTR_CREATE
XATTR_REPLACE = 2 /* set value, fail if attr does not exist. */
#define XATTR_REPLACE XATTR_REPLACE
};
so if the <linux/xattr.h> header is included first, then XATTR_CREATE is
defined and that enum definition fails.
I some questions on my way to fix this. Is there a point to that enum
that I am missing or can it go? If it needs to stay, can its member
names be altered?
Cheers,
Allan
More information about the Libc-alpha
mailing list