2019-09-16 17:15:37 +02:00
|
|
|
|
#ifndef _NZG_GLOBAL
|
|
|
|
|
#define _NZG_GLOBAL 1
|
|
|
|
|
|
2020-03-03 23:41:24 +01:00
|
|
|
|
#include <unistd.h> /* POSIX et al */
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
#include <stdlib.h>
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <fcntl.h> /* pour O_RDWR */
|
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
#include <sys/mman.h> /* shm_open */
|
2019-09-17 08:58:16 +02:00
|
|
|
|
#include <errno.h>
|
2004-02-19 23:30:05 +00:00
|
|
|
|
#include <semaphore.h>
|
2020-03-03 23:42:59 +01:00
|
|
|
|
|
|
|
|
|
#define PAGESIZE sysconf(_SC_PAGESIZE)
|
2019-09-17 14:17:58 +02:00
|
|
|
|
#define MSGSPACE_DEFAULT_MODE 0600
|
2004-02-21 16:12:22 +00:00
|
|
|
|
#define SEM_DEFAULT_MODE 0600
|
|
|
|
|
#define SHM_DEFAULT_MODE 0600
|
2019-09-17 14:17:58 +02:00
|
|
|
|
#define MSGSPACE_ID_LEN 32
|
2004-02-21 16:12:22 +00:00
|
|
|
|
#define ERR_UNHANDLED "G<>rer mieu les erreurs"
|
2019-09-17 14:44:44 +02:00
|
|
|
|
|
|
|
|
|
#ifndef SEM_FAILED
|
|
|
|
|
#define SEM_FAILED ((sem_t *)0)
|
|
|
|
|
#endif
|
|
|
|
|
|
2004-02-22 15:29:36 +00:00
|
|
|
|
#define NZG_ERROR(func,str) fprintf(stderr,"%s: %s\n%s in %s:%d\n",func,strerror(errno),str,__FILE__,__LINE__);
|
|
|
|
|
|
2019-09-16 17:15:37 +02:00
|
|
|
|
#endif
|