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