--- a/src/common/sr_utils.c +++ b/src/common/sr_utils.c @@ -506,14 +506,24 @@ sr_fd_set_nonblock(int fd) #if defined(SO_PEERCRED) +#if defined(__GLIBC__) #if !defined(SCM_CREDENTIALS) -/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */ struct ucred { pid_t pid; /* process ID of the sending process */ uid_t uid; /* user ID of the sending process */ gid_t gid; /* group ID of the sending process */ }; #endif /* !defined(SCM_CREDENTIALS) */ +#else +#if !defined(_GNU_SOURCE) +struct ucred { + pid_t pid; /* process ID of the sending process */ + uid_t uid; /* user ID of the sending process */ + gid_t gid; /* group ID of the sending process */ +}; +/* struct ucred is ifdefined behind __USE_GNU, but __USE_GNU is not defined */ +#endif /* !defined(__GNU_SOURCE) */ +#endif /* defined(__GLIBC__) */ int sr_get_peer_eid(int fd, uid_t *uid, gid_t *gid)