~ubuntu-branches/ubuntu/precise/corosync/precise-proposed

« back to all changes in this revision

Viewing changes to include/corosync/coroipc_ipc.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin Loschwitz
  • Date: 2011-10-19 14:32:18 UTC
  • mfrom: (1.1.6 upstream) (5.1.16 sid)
  • Revision ID: james.westby@ubuntu.com-20111019143218-ew8phl0raqyog844
Tags: 1.4.2-1
* Changed my email address in debian/control
* Add corosync-blackbox to the corosync package
* Imported Upstream version 1.4.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
#include <semaphore.h>
58
58
#else
59
59
#include <sys/sem.h>
 
60
 
 
61
#if defined(_SEM_SEMUN_UNDEFINED)
 
62
union semun {
 
63
  int val;
 
64
  struct semid_ds *buf;
 
65
  unsigned short int *array;
 
66
  struct seminfo *__buf;
 
67
};
 
68
#endif
60
69
#endif
61
70
 
62
71
/*
157
166
        uint64_t server_address;
158
167
};
159
168
 
160
 
#define SOCKET_SERVICE_INIT     0xFFFFFFFF
 
169
#define SOCKET_SERVICE_INIT                                     0xFFFFFFFF
 
170
#define SOCKET_SERVICE_SECURITY_VIOLATION       0xFFFFFFFE
161
171
 
162
172
#define ZC_ALLOC_HEADER         0xFFFFFFFF
163
173
#define ZC_FREE_HEADER          0xFFFFFFFE
330
340
        int *sem_value)
331
341
{
332
342
#if _POSIX_THREAD_PROCESS_SHARED < 1
333
 
        struct sembuf sop;
334
343
        int sem_value_hold;
 
344
        union semun semun;
335
345
#else
336
346
        sem_t *sem = NULL;
337
347
        int res;
358
368
                return (CS_ERR_LIBRARY);
359
369
        }
360
370
#else
361
 
        sop.sem_num = sem_id;
362
 
        sop.sem_op = 1;
363
 
        sop.sem_flg = 0;
364
 
 
365
371
retry_semctl:
366
 
        sem_value_hold = semctl (control_buffer->semid, sem_id, GETVAL);
 
372
        sem_value_hold = semctl (control_buffer->semid, sem_id, GETVAL, semun);
367
373
        if (sem_value_hold == -1 && errno == EINTR) {
368
374
                goto retry_semctl;
369
375
        } else