... | ... |
@@ -71,9 +71,6 @@ OS Notes: |
71 | 71 |
- FreeBSD/OpenBSD/NetBSD: make sure gmake, bison or yacc & flex are installed |
72 | 72 |
- Solaris: as above; you can use Solaris's yacc instead of bison. You might |
73 | 73 |
need also gtar and ginstall. |
74 |
-- Windows: it works in windows (only the core, w/o shared mem. support) but you |
|
75 |
- must install a recent cygwin version (http://www.cygwin.com/) and also |
|
76 |
- install a newer regex library version (>=0.12). |
|
77 | 74 |
|
78 | 75 |
|
79 | 76 |
2. Howto Build ser From Source Distribution |
... | ... |
@@ -82,7 +82,6 @@ modules_basenames=$(shell echo $(modules)| \ |
82 | 82 |
#modules_names=$(patsubst modules/%, %.so, $(modules)) |
83 | 83 |
modules_full_path=$(join $(modules), $(addprefix /, $(modules_names))) |
84 | 84 |
|
85 |
-NAME=ser |
|
86 | 85 |
|
87 | 86 |
ALLDEP=Makefile Makefile.sources Makefile.defs Makefile.rules |
88 | 87 |
|
... | ... |
@@ -93,6 +92,8 @@ makefile_defs=0 |
93 | 93 |
DEFS:= |
94 | 94 |
include Makefile.defs |
95 | 95 |
|
96 |
+NAME=$(MAIN_NAME) |
|
97 |
+ |
|
96 | 98 |
#export relevant variables to the sub-makes |
97 | 99 |
export DEFS PROFILE CC LD MKDEP MKTAGS CFLAGS LDFLAGS MOD_CFLAGS MOD_LDFLAGS |
98 | 100 |
export LEX YACC YACC_FLAGS |
... | ... |
@@ -31,6 +31,7 @@ |
31 | 31 |
# code exists (sobomax) |
32 | 32 |
# 2003-11-08 mips1 support introduced (andrei) |
33 | 33 |
# 2003-11-24 openbsd 3.4 (elf) fixes (andrei) |
34 |
+# 2004-07-27 darwin (mac os x) port (andrei) |
|
34 | 35 |
|
35 | 36 |
|
36 | 37 |
# check if already included/exported |
... | ... |
@@ -40,17 +41,19 @@ else |
40 | 40 |
makefile_defs=1 |
41 | 41 |
export makefile_defs |
42 | 42 |
|
43 |
+# main binary name |
|
44 |
+MAIN_NAME=ser |
|
43 | 45 |
|
44 | 46 |
#version number |
45 | 47 |
VERSION = 0 |
46 | 48 |
PATCHLEVEL = 8 |
47 |
-SUBLEVEL = 13 |
|
48 |
-EXTRAVERSION = -dev-36-malloc |
|
49 |
+SUBLEVEL = 99 |
|
50 |
+EXTRAVERSION = -dev |
|
49 | 51 |
|
50 | 52 |
RELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) |
51 | 53 |
OS = $(shell uname -s | sed -e s/SunOS/solaris/ | tr "[A-Z]" "[a-z]") |
52 | 54 |
ARCH = $(shell uname -m |sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \ |
53 |
- -e s/armv4l/arm/) |
|
55 |
+ -e s/armv4l/arm/ -e "s/Power Macintosh/ppc/" ) |
|
54 | 56 |
OSREL = $(shell uname -r) |
55 | 57 |
|
56 | 58 |
# TLS support |
... | ... |
@@ -101,12 +104,17 @@ ifeq ($(OS), netbsd) |
101 | 101 |
doc-dir = share/doc/ser |
102 | 102 |
man-dir = man/ |
103 | 103 |
else |
104 |
+ifeq ($(OS), darwin) |
|
105 |
+ doc-dir = share/doc/ser/ |
|
106 |
+ man-dir = man/ |
|
107 |
+else |
|
104 | 108 |
doc-dir = doc/ser/ |
105 | 109 |
man-dir = man/ |
106 | 110 |
endif |
107 | 111 |
endif |
108 | 112 |
endif |
109 | 113 |
endif |
114 |
+endif |
|
110 | 115 |
ut-prefix = bin/ |
111 | 116 |
# target dirs for various stuff |
112 | 117 |
cfg-target = $(prefix)/$(cfg-dir) |
... | ... |
@@ -154,8 +162,8 @@ MKTAGS=ctags -R . |
154 | 154 |
|
155 | 155 |
ifneq (,$(findstring gcc, $(CC_LONGVER))) |
156 | 156 |
CC_NAME=gcc |
157 |
- CC_VER=$(CC) $(shell $(CC) --version|head -1| \ |
|
158 |
- sed -e 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/' -e 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') |
|
157 |
+ CC_VER=$(CC) $(shell $(CC) --version|head -n 1| \ |
|
158 |
+ sed -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/' -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') |
|
159 | 159 |
# sun sed is a little brain damaged => this complicated expression |
160 | 160 |
MKDEP=$(CC) -MM |
161 | 161 |
#transform gcc version into 2.9x or 3.0 |
... | ... |
@@ -167,7 +175,7 @@ endif |
167 | 167 |
|
168 | 168 |
ifneq (, $(findstring Sun, $(CC_LONGVER))) |
169 | 169 |
CC_NAME=suncc |
170 |
- CC_SHORTVER=$(shell echo "$(CC_LONGVER)"|head -1| \ |
|
170 |
+ CC_SHORTVER=$(shell echo "$(CC_LONGVER)"|head -n 1| \ |
|
171 | 171 |
sed -e 's/.*\([0-9]\.[0-9]\).*/\1/g' ) |
172 | 172 |
CC_VER=$(CC) $(CC_SHORTVER) |
173 | 173 |
MKDEP=$(CC) -xM1 |
... | ... |
@@ -176,7 +184,7 @@ endif |
176 | 176 |
ifneq (, $(findstring Intel(R) C++ Compiler, $(CC_LONGVER))) |
177 | 177 |
# very nice: gcc compatible |
178 | 178 |
CC_NAME=icc |
179 |
- CC_FULLVER=$(shell echo "$(CC_LONGVER)"|head -1| \ |
|
179 |
+ CC_FULLVER=$(shell echo "$(CC_LONGVER)"|head -n 1| \ |
|
180 | 180 |
sed -e 's/.*Version \([0-9]\.[0-9]\.[0-9]*\).*/\1/g' ) |
181 | 181 |
CC_SHORTVER=$(shell echo "$(CC_FULLVER)" | cut -d. -f1,2 ) |
182 | 182 |
CC_VER=$(CC) $(CC_FULLVER) |
... | ... |
@@ -733,6 +741,26 @@ ifeq ($(OS), netbsd) |
733 | 733 |
LIBS= -lfl |
734 | 734 |
endif |
735 | 735 |
|
736 |
+# OS X support, same as freebsd |
|
737 |
+ifeq ($(OS), darwin) |
|
738 |
+ DEFS+=-DHAVE_SOCKADDR_SA_LEN -DHAVE_GETHOSTBYNAME2 -DHAVE_UNION_SEMUN \ |
|
739 |
+ -DHAVE_SCHED_YIELD -DHAVE_MSGHDR_MSG_CONTROL \ |
|
740 |
+ -DUSE_ANON_MMAP \ |
|
741 |
+ -DNDEBUG |
|
742 |
+ # -DNDEBUG used to turn off assert (assert wants to call |
|
743 |
+ # eprintf which doesn't seem to be defined in any shared lib |
|
744 |
+ ifneq ($(found_lock_method), yes) |
|
745 |
+ DEFS+= -DUSE_PTHREAD_MUTEX # try pthread sems |
|
746 |
+ found_lock_method=yes |
|
747 |
+ LIBS= -pthread -lfl -lresolv #dlopen is in libc |
|
748 |
+ else |
|
749 |
+ LIBS= -lfl -lresolv #dlopen is in libc |
|
750 |
+ endif |
|
751 |
+ LDFLAGS= # darwin doesn't like -O2 or -E |
|
752 |
+ MOD_LDFLAGS= -bundle -bundle_loader ../../$(MAIN_NAME) |
|
753 |
+ YACC=yacc |
|
754 |
+endif |
|
755 |
+ |
|
736 | 756 |
ifneq (,$(findstring CYGWIN, $(OS))) |
737 | 757 |
#cygwin is the same as common |
738 | 758 |
ifneq ($(found_lock_method), yes) |
... | ... |
@@ -52,13 +52,6 @@ Maturity: beta |
52 | 52 |
Depends on: auth |
53 | 53 |
Purpose: Radius support for digest authentication |
54 | 54 |
|
55 |
-Name: cpl |
|
56 |
-Owner: bogdan |
|
57 |
-Use: experimental |
|
58 |
-Maturity: alpha |
|
59 |
-Depends on: - |
|
60 |
-Purpose: Call Processing Language |
|
61 |
- |
|
62 | 55 |
Name: cpl-c |
63 | 56 |
Owner: bogdan |
64 | 57 |
Use: experimental |
... | ... |
@@ -235,6 +228,13 @@ Maturity: alpha |
235 | 235 |
Depends on: tm |
236 | 236 |
Purpose: Voicemail interface |
237 | 237 |
|
238 |
+Name: xlog |
|
239 |
+Owner: ramona |
|
240 |
+Use: regular |
|
241 |
+Maturity: stable |
|
242 |
+Depends on: |
|
243 |
+Purpose: formatted logging (printf style) |
|
244 |
+ |
|
238 | 245 |
Contributions |
239 | 246 |
------------- |
240 | 247 |
Name: domain |
... | ... |
@@ -258,6 +258,20 @@ Maturity: beta |
258 | 258 |
Depends on: - |
259 | 259 |
Purpose: support for maintenance of multiple domains |
260 | 260 |
|
261 |
+Name: mediaproxy |
|
262 |
+Owner: danp, agprojects |
|
263 |
+Use: regular |
|
264 |
+Maturity: stable |
|
265 |
+Depends on: mediaproxy media relay |
|
266 |
+Purpose: nat traversal |
|
267 |
+ |
|
268 |
+Name: nathelper |
|
269 |
+Owner: sobomax |
|
270 |
+Use: regular |
|
271 |
+Maturity: stable |
|
272 |
+Depends on: rtpproxy |
|
273 |
+Purpose: nat traversal |
|
274 |
+ |
|
261 | 275 |
Name: permissions |
262 | 276 |
Owner: tirpi |
263 | 277 |
Use: experimental |
... | ... |
@@ -48,18 +48,18 @@ then |
48 | 48 |
if echo "$FULLVER"|grep gcc >/dev/null |
49 | 49 |
then |
50 | 50 |
NAME=gcc |
51 |
- VER=`$CC --version|head -1| \ |
|
52 |
- sed -e 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\ |
|
53 |
- -e 's/.*[^.0-9]\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` |
|
51 |
+ VER=`$CC --version|head -n 1| \ |
|
52 |
+ sed -e 's/^[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/'\ |
|
53 |
+ -e 's/^[^.0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` |
|
54 | 54 |
elif echo "$FULLVER"|grep Sun >/dev/null |
55 | 55 |
then |
56 | 56 |
NAME=suncc |
57 |
- VER=`echo "$FULLVER"|head -1| \ |
|
57 |
+ VER=`echo "$FULLVER"|head -n 1| \ |
|
58 | 58 |
sed -e 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` |
59 | 59 |
elif echo "$FULLVER"|grep "Intel(R) C++ Compiler" >/dev/null |
60 | 60 |
then |
61 | 61 |
NAME=icc |
62 |
- VER=`echo "$FULLVER"|head -1| \ |
|
62 |
+ VER=`echo "$FULLVER"|head -n 1| \ |
|
63 | 63 |
sed -e 's/.*Version \([0-9]\.[0-9]\.[0-9]*\).*/\1/' ` |
64 | 64 |
fi |
65 | 65 |
|
... | ... |
@@ -106,7 +106,7 @@ struct id_list{ |
106 | 106 |
}; |
107 | 107 |
|
108 | 108 |
extern int yylex(); |
109 |
-void yyerror(char* s); |
|
109 |
+static void yyerror(char* s); |
|
110 | 110 |
static char* tmp; |
111 | 111 |
static int i_tmp; |
112 | 112 |
static void* f_tmp; |
... | ... |
@@ -116,7 +116,7 @@ static str* str_tmp; |
116 | 116 |
static str s_tmp; |
117 | 117 |
static struct ip_addr* ip_tmp; |
118 | 118 |
|
119 |
-void warn(char* s); |
|
119 |
+static void warn(char* s); |
|
120 | 120 |
static struct id_list* mk_listen_id(char*, int, int); |
121 | 121 |
|
122 | 122 |
|
... | ... |
@@ -1697,14 +1697,14 @@ cmd: FORWARD LPAREN host RPAREN { $$=mk_action( FORWARD_T, |
1697 | 1697 |
extern int line; |
1698 | 1698 |
extern int column; |
1699 | 1699 |
extern int startcolumn; |
1700 |
-void warn(char* s) |
|
1700 |
+static void warn(char* s) |
|
1701 | 1701 |
{ |
1702 | 1702 |
LOG(L_WARN, "cfg. warning: (%d,%d-%d): %s\n", line, startcolumn, |
1703 | 1703 |
column, s); |
1704 | 1704 |
cfg_errors++; |
1705 | 1705 |
} |
1706 | 1706 |
|
1707 |
-void yyerror(char* s) |
|
1707 |
+static void yyerror(char* s) |
|
1708 | 1708 |
{ |
1709 | 1709 |
LOG(L_CRIT, "parse error (%d,%d-%d): %s\n", line, startcolumn, |
1710 | 1710 |
column, s); |
... | ... |
@@ -28,9 +28,12 @@ |
28 | 28 |
/* |
29 | 29 |
* ser locking library |
30 | 30 |
* WARNING: don't include this directly include instead locking.h! |
31 |
- * |
|
31 |
+ * History: |
|
32 |
+ * -------- |
|
32 | 33 |
* 2003-03-06 created by andrei (contains parts of the original locking.h) |
33 | 34 |
* 2003-03-17 fixed cast warning in shm_free (forced to void*) (andrei) |
35 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
36 |
+ * on darwin (andrei) |
|
34 | 37 |
* |
35 | 38 |
Implements: (see also locking.h) |
36 | 39 |
|
... | ... |
@@ -41,8 +44,8 @@ Implements: (see also locking.h) |
41 | 41 |
|
42 | 42 |
lock sets: [implemented only for FL & SYSV so far] |
43 | 43 |
---------- |
44 |
- lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
45 |
- void lock_set_dealloc(lock_set_t* s); - deallocs the lock set shm. |
|
44 |
+ gen_lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
45 |
+ void lock_set_dealloc(gen_lock_set_t* s); - deallocs the lock set shm. |
|
46 | 46 |
|
47 | 47 |
*/ |
48 | 48 |
|
... | ... |
@@ -63,14 +66,14 @@ Implements: (see also locking.h) |
63 | 63 |
#define lock_dealloc(lock) shm_free((void*)lock) |
64 | 64 |
/* lock sets */ |
65 | 65 |
|
66 |
-inline static lock_set_t* lock_set_alloc(int n) |
|
66 |
+inline static gen_lock_set_t* lock_set_alloc(int n) |
|
67 | 67 |
{ |
68 |
- lock_set_t* ls; |
|
69 |
- ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)+n*sizeof(gen_lock_t)); |
|
68 |
+ gen_lock_set_t* ls; |
|
69 |
+ ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)+n*sizeof(gen_lock_t)); |
|
70 | 70 |
if (ls==0){ |
71 | 71 |
LOG(L_CRIT, "ERROR: lock_set_alloc (FL): could not allocate lock_set\n"); |
72 | 72 |
}else{ |
73 |
- ls->locks=(gen_lock_t*)((char*)ls+sizeof(lock_set_t)); |
|
73 |
+ ls->locks=(gen_lock_t*)((char*)ls+sizeof(gen_lock_set_t)); |
|
74 | 74 |
ls->size=n; |
75 | 75 |
} |
76 | 76 |
return ls; |
... | ... |
@@ -85,10 +88,10 @@ inline static lock_set_t* lock_set_alloc(int n) |
85 | 85 |
#define lock_dealloc(lock) shm_free((void*)lock) |
86 | 86 |
/* lock sets */ |
87 | 87 |
|
88 |
-inline static lock_set_t* lock_set_alloc(int n) |
|
88 |
+inline static gen_lock_set_t* lock_set_alloc(int n) |
|
89 | 89 |
{ |
90 |
- lock_set_t* ls; |
|
91 |
- ls=(lock_set_t*)shm_malloc(sizeof(lock_set_t)); |
|
90 |
+ gen_lock_set_t* ls; |
|
91 |
+ ls=(gen_lock_set_t*)shm_malloc(sizeof(gen_lock_set_t)); |
|
92 | 92 |
if (ls){ |
93 | 93 |
ls->size=n; |
94 | 94 |
ls->semid=-1; |
... | ... |
@@ -40,6 +40,8 @@ |
40 | 40 |
* 2003-03-10 lock set support added also for PTHREAD_MUTEX & POSIX_SEM |
41 | 41 |
* (andrei) |
42 | 42 |
* 2003-03-17 possible signal interruptions treated for sysv (andrei) |
43 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
44 |
+ * on darwin (andrei) |
|
43 | 45 |
* |
44 | 46 |
Implements: |
45 | 47 |
|
... | ... |
@@ -52,10 +54,10 @@ Implements: |
52 | 52 |
|
53 | 53 |
lock sets: [implemented only for FL & SYSV so far] |
54 | 54 |
---------- |
55 |
- lock_set_t* lock_set_init(lock_set_t* set); - inits the lock set |
|
56 |
- void lock_set_destroy(lock_set_t* s); - removes the lock set |
|
57 |
- void lock_set_get(lock_set_t* s, int i); - locks sem i from the set |
|
58 |
- void lock_set_release(lock_set_t* s, int i) - unlocks sem i from the set |
|
55 |
+ gen_lock_set_t* lock_set_init(gen_lock_set_t* set); - inits the lock set |
|
56 |
+ void lock_set_destroy(gen_lock_set_t* s); - removes the lock set |
|
57 |
+ void lock_set_get(gen_lock_set_t* s, int i); - locks sem i from the set |
|
58 |
+ void lock_set_release(gen_lock_set_t* s, int i) - unlocks sem i from the set |
|
59 | 59 |
|
60 | 60 |
WARNING: - lock_set_init may fail for large number of sems (e.g. sysv). |
61 | 61 |
- signals are not treated! (some locks are "awakened" by the signals) |
... | ... |
@@ -209,16 +211,16 @@ tryagain: |
209 | 209 |
#if defined(FAST_LOCK) || defined(USE_PTHREAD_MUTEX) || defined(USE_POSIX_SEM) |
210 | 210 |
#define GEN_LOCK_T_PREFERED |
211 | 211 |
|
212 |
-struct lock_set_t_ { |
|
212 |
+struct gen_lock_set_t_ { |
|
213 | 213 |
long size; |
214 | 214 |
gen_lock_t* locks; |
215 | 215 |
}; /* must be aligned (32 bits or 64 depending on the arch)*/ |
216 |
-typedef struct lock_set_t_ lock_set_t; |
|
216 |
+typedef struct gen_lock_set_t_ gen_lock_set_t; |
|
217 | 217 |
|
218 | 218 |
|
219 | 219 |
#define lock_set_destroy(lock_set) /* do nothing */ |
220 | 220 |
|
221 |
-inline static lock_set_t* lock_set_init(lock_set_t* s) |
|
221 |
+inline static gen_lock_set_t* lock_set_init(gen_lock_set_t* s) |
|
222 | 222 |
{ |
223 | 223 |
int r; |
224 | 224 |
for (r=0; r<s->size; r++) if (lock_init(&s->locks[r])==0) return 0; |
... | ... |
@@ -232,14 +234,14 @@ inline static lock_set_t* lock_set_init(lock_set_t* s) |
232 | 232 |
#elif defined(USE_SYSV_SEM) |
233 | 233 |
#undef GEN_LOCK_T_PREFERED |
234 | 234 |
|
235 |
-struct lock_set_t_ { |
|
235 |
+struct gen_lock_set_t_ { |
|
236 | 236 |
int size; |
237 | 237 |
int semid; |
238 | 238 |
}; |
239 | 239 |
|
240 | 240 |
|
241 |
-typedef struct lock_set_t_ lock_set_t; |
|
242 |
-inline static lock_set_t* lock_set_init(lock_set_t* s) |
|
241 |
+typedef struct gen_lock_set_t_ gen_lock_set_t; |
|
242 |
+inline static gen_lock_set_t* lock_set_init(gen_lock_set_t* s) |
|
243 | 243 |
{ |
244 | 244 |
union semun su; |
245 | 245 |
int r; |
... | ... |
@@ -262,12 +264,12 @@ inline static lock_set_t* lock_set_init(lock_set_t* s) |
262 | 262 |
return s; |
263 | 263 |
} |
264 | 264 |
|
265 |
-inline static void lock_set_destroy(lock_set_t* s) |
|
265 |
+inline static void lock_set_destroy(gen_lock_set_t* s) |
|
266 | 266 |
{ |
267 | 267 |
semctl(s->semid, 0, IPC_RMID, (union semun)(int)0); |
268 | 268 |
} |
269 | 269 |
|
270 |
-inline static void lock_set_get(lock_set_t* s, int n) |
|
270 |
+inline static void lock_set_get(gen_lock_set_t* s, int n) |
|
271 | 271 |
{ |
272 | 272 |
struct sembuf sop; |
273 | 273 |
sop.sem_num=n; |
... | ... |
@@ -285,7 +287,7 @@ tryagain: |
285 | 285 |
} |
286 | 286 |
} |
287 | 287 |
|
288 |
-inline static void lock_set_release(lock_set_t* s, int n) |
|
288 |
+inline static void lock_set_release(gen_lock_set_t* s, int n) |
|
289 | 289 |
{ |
290 | 290 |
struct sembuf sop; |
291 | 291 |
sop.sem_num=n; |
... | ... |
@@ -34,6 +34,8 @@ |
34 | 34 |
* 2003-03-05 lock set support added for FAST_LOCK & SYSV (andrei) |
35 | 35 |
* 2003-03-06 splited in two: lock_ops.h & lock_alloc.h, to avoid |
36 | 36 |
* shm_mem.h<->locking.h interdependency (andrei) |
37 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
38 |
+ * on darwin (andrei) |
|
37 | 39 |
* |
38 | 40 |
Implements (in lock_ops.h & lock_alloc.h): |
39 | 41 |
|
... | ... |
@@ -49,13 +51,13 @@ Implements (in lock_ops.h & lock_alloc.h): |
49 | 49 |
|
50 | 50 |
lock sets: |
51 | 51 |
---------- |
52 |
- type: lock_set_t |
|
53 |
- lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
54 |
- lock_set_t* lock_set_init(lock_set_t* set); - inits the lock set |
|
55 |
- void lock_set_destroy(lock_set_t* s); - removes the lock set |
|
56 |
- void lock_set_dealloc(lock_set_t* s); - deallocs the lock set shm. |
|
57 |
- void lock_set_get(lock_set_t* s, int i); - locks sem i from the set |
|
58 |
- void lock_set_release(lock_set_t* s, int i) - unlocks sem i from the set |
|
52 |
+ type: gen_lock_set_t |
|
53 |
+ gen_lock_set_t* lock_set_alloc(no) - allocs a lock set in shm. |
|
54 |
+ gen_lock_set_t* lock_set_init(gen_lock_set_t* set); - inits the lock set |
|
55 |
+ void lock_set_destroy(gen_lock_set_t* s); - removes the lock set |
|
56 |
+ void lock_set_dealloc(gen_lock_set_t* s); - deallocs the lock set shm. |
|
57 |
+ void lock_set_get(gen_lock_set_t* s, int i); - locks sem i from the set |
|
58 |
+ void lock_set_release(gen_lock_set_t* s, int i) - unlocks sem i from the set |
|
59 | 59 |
|
60 | 60 |
WARNING: - lock_set_init may fail for large number of sems (e.g. sysv). |
61 | 61 |
- signals are not treated! (some locks are "awakened" by the signals) |
... | ... |
@@ -30,6 +30,7 @@ |
30 | 30 |
* -------- |
31 | 31 |
* 2003-03-12 splited shm_mem_init in shm_getmem & shm_mem_init_mallocs |
32 | 32 |
* (andrei) |
33 |
+ * 2004-07-27 ANON mmap support, needed on darwin (andrei) |
|
33 | 34 |
*/ |
34 | 35 |
|
35 | 36 |
|
... | ... |
@@ -140,6 +141,10 @@ int shm_getmem() |
140 | 140 |
} |
141 | 141 |
|
142 | 142 |
#ifdef SHM_MMAP |
143 |
+#ifdef USE_ANON_MMAP |
|
144 |
+ shm_mempool=mmap(0, shm_mem_size, PROT_READ|PROT_WRITE, |
|
145 |
+ MAP_ANON|MAP_SHARED, -1 ,0); |
|
146 |
+#else |
|
143 | 147 |
fd=open("/dev/zero", O_RDWR); |
144 | 148 |
if (fd==-1){ |
145 | 149 |
LOG(L_CRIT, "ERROR: shm_mem_init: could not open /dev/zero: %s\n", |
... | ... |
@@ -149,6 +154,7 @@ int shm_getmem() |
149 | 149 |
shm_mempool=mmap(0, shm_mem_size, PROT_READ|PROT_WRITE, MAP_SHARED, fd ,0); |
150 | 150 |
/* close /dev/zero */ |
151 | 151 |
close(fd); |
152 |
+#endif /* USE_ANON_MMAP */ |
|
152 | 153 |
#else |
153 | 154 |
|
154 | 155 |
shm_shmid=shmget(IPC_PRIVATE, /* SHM_MEM_SIZE */ shm_mem_size , 0700); |
... | ... |
@@ -28,6 +28,8 @@ |
28 | 28 |
* History: |
29 | 29 |
* -------- |
30 | 30 |
* 2003-03-17 converted to locking.h (andrei) |
31 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
32 |
+ * on darwin (andrei) |
|
31 | 33 |
*/ |
32 | 34 |
|
33 | 35 |
|
... | ... |
@@ -70,9 +72,9 @@ |
70 | 70 |
|
71 | 71 |
/* and the maximum number of semaphores in the entry_semaphore set */ |
72 | 72 |
static int sem_nr; |
73 |
-lock_set_t* timer_semaphore=0; |
|
74 |
-lock_set_t* entry_semaphore=0; |
|
75 |
-lock_set_t* reply_semaphore=0; |
|
73 |
+gen_lock_set_t* timer_semaphore=0; |
|
74 |
+gen_lock_set_t* entry_semaphore=0; |
|
75 |
+gen_lock_set_t* reply_semaphore=0; |
|
76 | 76 |
#endif |
77 | 77 |
|
78 | 78 |
/* timer group locks */ |
... | ... |
@@ -28,6 +28,8 @@ |
28 | 28 |
* History: |
29 | 29 |
* -------- |
30 | 30 |
* 2003-03-17 converted to locking.h (andrei) |
31 |
+ * 2004-07-28 s/lock_set_t/gen_lock_set_t/ because of a type conflict |
|
32 |
+ * on darwin (andrei) |
|
31 | 33 |
*/ |
32 | 34 |
|
33 | 35 |
#include "defs.h" |
... | ... |
@@ -47,7 +49,7 @@ |
47 | 47 |
/* typedef to structure we use for mutexing; |
48 | 48 |
currently, index to a semaphore set identifier now */ |
49 | 49 |
typedef struct { |
50 |
- lock_set_t* semaphore_set; |
|
50 |
+ gen_lock_set_t* semaphore_set; |
|
51 | 51 |
int semaphore_index; |
52 | 52 |
} ser_lock_t; |
53 | 53 |
#endif |
... | ... |
@@ -29,6 +29,7 @@ |
29 | 29 |
/* History: |
30 | 30 |
* -------- |
31 | 31 |
* 2003-04-12 support for resolving ipv6 address references added (andrei) |
32 |
+ * 2004-07-28 darwin needs nameser_compat.h (andrei) |
|
32 | 33 |
*/ |
33 | 34 |
|
34 | 35 |
|
... | ... |
@@ -41,6 +42,10 @@ |
41 | 41 |
#include <netdb.h> |
42 | 42 |
#include <arpa/nameser.h> |
43 | 43 |
|
44 |
+#ifdef __OS_darwin |
|
45 |
+#include <arpa/nameser_compat.h> |
|
46 |
+#endif |
|
47 |
+ |
|
44 | 48 |
#include "ip_addr.h" |
45 | 49 |
|
46 | 50 |
|