add db.1.85
[nvi.git] / db.1.85 / PORT / linux / OTHER_PATCHES
blobb0387a56353e43bb6ec3e1f431faecd34a63557c
1 *** PORT/db/recno/rec_open.c.orig       1993/10/13 02:01:31
2 --- PORT/db/recno/rec_open.c    1993/10/13 02:20:47
3 ***************
4 *** 159,167 ****
5 --- 159,182 ----
6                                 SET(t, R_EOF);
7                         else {
8                                 t->bt_msize = sb.st_size;
9 + /*
10 +  * hack : 
11 +  *
12 +  * The Linux kernel mmap() semantics are broken :
13 +  * 
14 +  * Under Linux, read only private mappings cause write only and read/write 
15 +  * opens to fail with errno=ETXTBSY.  Shared read only mappings should work
16 +  * fine though, but I'm not familiar enough with the code to ascertain that
17 +  * a MAP_SHARED mapping would be safe so I use the non-mmap'd version 
18 +  * instead.
19 +  *
20 +  */
21
22 + #if !defined(linux) 
23                                 if ((t->bt_smap = mmap(NULL, t->bt_msize,
24                                     PROT_READ, MAP_PRIVATE, rfd,
25                                     (off_t)0)) == (caddr_t)-1)
26 + #endif
27                                         goto slow;
28                                 t->bt_cmap = t->bt_smap;
29                                 t->bt_emap = t->bt_smap + sb.st_size;