[core] use different getxattr() prototype on MacOS

(thx sevan)

x-ref:
  https://github.com/mistydemeo/tigerbrew/pull/917
This commit is contained in:
Glenn Strauss 2023-08-11 00:28:02 -04:00
parent a466965e07
commit b9ec84f06f
1 changed files with 5 additions and 0 deletions

View File

@ -841,8 +841,13 @@ static int stat_cache_attr_get(const char *name) {
#if defined(HAVE_XATTR)
#if defined(HAVE_SYS_XATTR_H)
ssize_t attrlen;
#if defined(__APPLE__) && defined(__MACH__)
if (0 < (attrlen = getxattr(name, attrname,
attrval, sizeof(attrval)-1, 0, 0)))
#else
if (0 < (attrlen = getxattr(name, attrname,
attrval, sizeof(attrval)-1)))
#endif
#else
int attrlen = sizeof(attrval)-1;
if (0 == attr_get(name, attrname, attrval, &attrlen, 0))