Browse code

- fixed mmap

Andrei Pelinescu-Onciul authored on 11/12/2001 04:25:44
Showing 4 changed files
... ...
@@ -45,8 +45,8 @@ ARCH = $(shell uname -s)
45 45
 #		twice, trying to free a pointer alloc'ed with a different
46 46
 #		malloc etc.)
47 47
 DEFS= -DNAME='"$(NAME)"' -DVERSION='"$(RELEASE)"' -DARCH='"$(ARCH)"' \
48
-	 -DDNS_IP_HACK  -DSHM_MEM -DSHM_MMAP\
49
-	 -DPKG_MALLOC -DNO_DEBUG #-DDBG_QM_MALLOC 
48
+	 -DDNS_IP_HACK  -DPKG_MALLOC -DSHM_MEM  -DSHM_MMAP \
49
+	 -DNO_DEBUG #-DDBG_QM_MALLOC 
50 50
 #-DEXTRA_DEBUG
51 51
 # -DUSE_SHM_MEM
52 52
 #-DNO_DEBUG 
... ...
@@ -65,13 +65,13 @@ int shm_mem_init()
65 65
 	}
66 66
 	
67 67
 #ifdef SHM_MMAP
68
-	fd=open("/dev/zero", O_RDONLY);
68
+	fd=open("/dev/zero", O_RDWR);
69 69
 	if (fd==-1){
70 70
 		LOG(L_CRIT, "ERROR: shm_mem_init: could not open /dev/zero: %s\n",
71 71
 				strerror(errno));
72 72
 		return -1;
73 73
 	}
74
-	shm_mempool=mmap(0, SHM_MEM_SIZE, PROT_READ|PROT_WRITE, MAP_PRIVATE,
74
+	shm_mempool=mmap(0, SHM_MEM_SIZE, PROT_READ|PROT_WRITE, MAP_SHARED,
75 75
 						fd ,0);
76 76
 	/* close /dev/zero */
77 77
 	close(fd);
... ...
@@ -2,7 +2,7 @@ debug=3          # debug level (cmd line: -dddddddddd)
2 2
 check_via=yes     # (cmd. line: -v)
3 3
 dns=on           # (cmd. line: -r)
4 4
 rev_dns=yes      # (cmd. line: -R)
5
-fork=yes          # (cmd. line: -D)
5
+fork=no	         # (cmd. line: -D)
6 6
 children=4
7 7
 log_stderror=yes # (cmd line: -E)
8 8
 #port=5080
... ...
@@ -108,5 +108,6 @@ unsigned int get_ticks()
108 108
 			", returning 0 (probably wrong)");
109 109
 	return 0;
110 110
 #endif
111
+	DBG("- get_ticks:returning %d\n", *jiffies);
111 112
 	return *jiffies;
112 113
 }