l3.libnazgul/src/global.h

47 lines
1 KiB
C
Raw Permalink Normal View History

2019-09-16 15:15:37 +00:00
#ifndef _NZG_GLOBAL
#define _NZG_GLOBAL 1
2020-03-03 23:06:43 +00:00
#include <unistd.h> /* POSIX et al */
2020-03-03 22:41:24 +00:00
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
2020-03-03 23:06:43 +00:00
#include <fcntl.h> /* pour O_RDWR */
2020-03-03 22:41:24 +00:00
#include <sys/types.h>
2020-03-03 23:06:43 +00:00
#include <sys/mman.h> /* shm_open */
2019-09-17 06:58:16 +00:00
#include <errno.h>
2004-02-19 23:30:05 +00:00
#include <semaphore.h>
2020-03-03 22:42:59 +00:00
#define PAGESIZE sysconf(_SC_PAGESIZE)
2019-09-17 12:17:58 +00: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 12:17:58 +00:00
#define MSGSPACE_ID_LEN 32
2004-02-21 16:12:22 +00:00
#define ERR_UNHANDLED "G<>rer mieu les erreurs"
2004-02-22 17:49:02 +00:00
#define ANYPOOL -1
#define SPECIFICPOOL 0
#ifndef SEM_FAILED
#define SEM_FAILED ((sem_t *)0)
#endif
#ifndef MAP_FAILED
#define MAP_FAILED ((void *)-1)
#endif
2004-02-25 21:28:11 +00:00
#ifdef _NZG_REALFILEID
#define DEFAULT_MSGSPACELISTID "/tmp/nzgSpaceList"
#else
#define DEFAULT_MSGSPACELISTID "/nzgSpaceList"
#endif
#ifdef _NZG_REALFILEID
#define DEFAULT_MSGSPACELISTSEMID "/tmp/nzgSpaceListSem"
#else
#define DEFAULT_MSGSPACELISTSEMID "/nzgSpaceListSem"
#endif
2004-02-23 16:51:20 +00:00
#define NZG_ERROR(func,str) fprintf(stderr,"*** %s: %s***\n%s in %s:%d\n",func,strerror(errno),str,__FILE__,__LINE__);
2004-02-22 15:29:36 +00:00
2019-09-16 15:15:37 +00:00
#endif