This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
linux/xattr.h and sys/xattr.h conflicts
- From: Allan McRae <allan at archlinux dot org>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Date: Mon, 06 Jan 2014 00:31:35 +1000
- Subject: linux/xattr.h and sys/xattr.h conflicts
- Authentication-results: sourceware.org; auth=none
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