]> git.pld-linux.org Git - packages/db.git/blob - patch.4.1.24.4
- fixed optflags passing, release 5
[packages/db.git] / patch.4.1.24.4
1 *** mp/mp_fopen.c.orig  2002/08/26 15:22:01     11.90
2 --- mp/mp_fopen.c       2002/09/27 15:40:36
3 ***************
4 *** 345,350 ****
5 --- 345,367 ----
6         }
7   
8         /*
9 +        * Figure out the file's size.
10 +        *
11 +        * !!!
12 +        * We can't use off_t's here, or in any code in the mainline library
13 +        * for that matter.  (We have to use them in the os stubs, of course,
14 +        * as there are system calls that take them as arguments.)  The reason
15 +        * is some customers build in environments where an off_t is 32-bits,
16 +        * but still run where offsets are 64-bits, and they pay us a lot of
17 +        * money.
18 +        */
19 +       if ((ret = __os_ioinfo(
20 +           dbenv, rpath, dbmfp->fhp, &mbytes, &bytes, NULL)) != 0) {
21 +               __db_err(dbenv, "%s: %s", rpath, db_strerror(ret));
22 +               goto err;
23 +       }
24
25 +       /*
26          * Get the file id if we weren't given one.  Generated file id's
27          * don't use timestamps, otherwise there'd be no chance of any
28          * other process joining the party.
29 ***************
30 *** 470,475 ****
31 --- 487,493 ----
32                 F_SET(mfp, MP_DIRECT);
33         if (LF_ISSET(DB_EXTENT))
34                 F_SET(mfp, MP_EXTENT);
35 +       F_SET(mfp, MP_CAN_MMAP);
36   
37         if (path == NULL)
38                 F_SET(mfp, MP_TEMP);
39 ***************
40 *** 479,499 ****
41                  * and find the number of the last page in the file, all the
42                  * time being careful not to overflow 32 bits.
43                  *
44 -                * !!!
45 -                * We can't use off_t's here, or in any code in the mainline
46 -                * library for that matter.  (We have to use them in the os
47 -                * stubs, of course, as there are system calls that take them
48 -                * as arguments.)  The reason is that some customers build in
49 -                * environments where an off_t is 32-bits, but still run where
50 -                * offsets are 64-bits, and they pay us a lot of money.
51 -                */
52 -               if ((ret = __os_ioinfo(
53 -                   dbenv, rpath, dbmfp->fhp, &mbytes, &bytes, NULL)) != 0) {
54 -                       __db_err(dbenv, "%s: %s", rpath, db_strerror(ret));
55 -                       goto err;
56 -               }
57
58 -               /*
59                  * During verify or recovery, we might have to cope with a
60                  * truncated file; if the file size is not a multiple of the
61                  * page size, round down to a page, we'll take care of the
62 --- 497,502 ----
63 ***************
64 *** 582,588 ****
65          * compiler will perpetrate, doing the comparison in a portable way is
66          * flatly impossible.  Hope that mmap fails if the file is too large.
67          */
68 ! #define       DB_MAXMMAPSIZE  (10 * 1024 * 1024)      /* 10 Mb. */
69         if (F_ISSET(mfp, MP_CAN_MMAP)) {
70                 if (path == NULL)
71                         F_CLR(mfp, MP_CAN_MMAP);
72 --- 585,591 ----
73          * compiler will perpetrate, doing the comparison in a portable way is
74          * flatly impossible.  Hope that mmap fails if the file is too large.
75          */
76 ! #define       DB_MAXMMAPSIZE  (10 * 1024 * 1024)      /* 10 MB. */
77         if (F_ISSET(mfp, MP_CAN_MMAP)) {
78                 if (path == NULL)
79                         F_CLR(mfp, MP_CAN_MMAP);
This page took 0.075478 seconds and 3 git commands to generate.