Skip to content
Snippets Groups Projects
Commit 6e5a3c68 authored by deuce's avatar deuce
Browse files

Use XP_ prefix on SEM macros to avoid conflicts.

parent b2688c29
Branches
Tags
No related merge requests found
......@@ -57,7 +57,7 @@ xp_sem_init(xp_sem_t *sem, int pshared, unsigned int value)
goto RETURN;
}
if (value > SEM_VALUE_MAX) {
if (value > XP_SEM_VALUE_MAX) {
errno = EINVAL;
retval = -1;
goto RETURN;
......@@ -90,7 +90,7 @@ xp_sem_init(xp_sem_t *sem, int pshared, unsigned int value)
(*sem)->count = (u_int32_t)value;
(*sem)->nwaiters = 0;
(*sem)->magic = SEM_MAGIC;
(*sem)->magic = XP_SEM_MAGIC;
retval = 0;
RETURN:
......@@ -129,7 +129,7 @@ xp_sem_t *
xp_sem_open(const char *name, int oflag, ...)
{
errno = ENOSYS;
return SEM_FAILED;
return XP_SEM_FAILED;
}
int
......
......@@ -51,8 +51,8 @@
struct xp_sem;
typedef struct xp_sem *xp_sem_t;
#define SEM_FAILED ((xp_sem_t *)0)
#define SEM_VALUE_MAX UINT_MAX
#define XP_SEM_FAILED ((xp_sem_t *)0)
#define XP_SEM_VALUE_MAX UINT_MAX
#if defined(__solaris__)
typedef unsigned int u_int32_t;
......@@ -88,7 +88,7 @@ int xp_sem_timedwait (xp_sem_t *sem, const struct timespec *abs_timeout);
*/
struct xp_sem {
#define SEM_MAGIC ((u_int32_t) 0x09fa4012)
#define XP_SEM_MAGIC ((u_int32_t) 0x09fa4012)
u_int32_t magic;
pthread_mutex_t lock;
pthread_cond_t gtzero;
......@@ -105,7 +105,7 @@ extern void _thread_init (void);
(_threads_initialized != 0)
#define _SEM_CHECK_VALIDITY(sem) \
if (sem==NULL || (*(sem))->magic != SEM_MAGIC) { \
if (sem==NULL || (*(sem))->magic != XP_SEM_MAGIC) { \
errno = EINVAL; \
retval = -1; \
goto RETURN; \
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment