forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit08d285e
Simplify replacement code for preadv and pwritev.
preadv() and pwritev() are not standardized by POSIX, but appeared inNetBSD in 1999 and were adopted by at least OpenBSD, FreeBSD,DragonFlyBSD, Linux, AIX, illumos and macOS. We don't use them muchyet, but an active proposal uses them heavily.In 15, we had two replacement implementations for other OSes: one basedon lseek() + -v function if available for true vector I/O, and the otherbased on a loop over p- function.The former would be an obstacle to hypothetical future multi-threadedcode sharing file descriptors, while the latter would not, since commitcf112c1. Furthermore, the number of targeted systems that couldbenefit from the former's potential upside has dwindled to just oneniche OS, since macOS added the functions and we de-supported HP-UX.That doesn't seem like a good trade-off.Therefore, drop the lseek()-based variant, and also the pg_ prefix nowthat the file position portability hazard is gone.At the time of writing, the only systems in our build farm that lacknative preadv/pwritev and thus use fallback code are: * Solaris (but not illumos) * macOS before release 11.0 * WindowsWith this commit, the above systems will now use the *same* fallbackcode, the version that loops over pread()/pwrite(). Windows alreadyused that (though a later proposal may include true vector I/O forWindows), so this decision really only affects Solaris, until it getsaround to adding these system calls.Also remove some useless includes while here.Reviewed-by: Andres Freund <andres@anarazel.de>Discussion:https://postgr.es/m/CA+hUKGJ3LHeP9w5Fgzdr4G8AnEtJ=z=p6hGDEm4qYGEUX5B6fQ@mail.gmail.com1 parent9509ea9 commit08d285e
File tree
8 files changed
+9
-53
lines changed- src
- backend/storage/file
- include
- port
- port
- tools/msvc
8 files changed
+9
-53
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
16039 | 16039 |
| |
16040 | 16040 |
| |
16041 | 16041 |
| |
16042 |
| - | |
| 16042 | + | |
16043 | 16043 |
| |
16044 | 16044 |
| |
16045 | 16045 |
| |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1803 | 1803 |
| |
1804 | 1804 |
| |
1805 | 1805 |
| |
1806 |
| - | |
1807 | 1806 |
| |
1808 | 1807 |
| |
1809 | 1808 |
| |
| |||
1812 | 1811 |
| |
1813 | 1812 |
| |
1814 | 1813 |
| |
1815 |
| - | |
1816 | 1814 |
| |
1817 | 1815 |
| |
1818 | 1816 |
| |
|
Lines changed: 2 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3762 | 3762 |
| |
3763 | 3763 |
| |
3764 | 3764 |
| |
3765 |
| - | |
| 3765 | + | |
3766 | 3766 |
| |
3767 | 3767 |
| |
3768 | 3768 |
| |
| |||
3782 | 3782 |
| |
3783 | 3783 |
| |
3784 | 3784 |
| |
3785 |
| - | |
| 3785 | + | |
3786 | 3786 |
| |
3787 | 3787 |
| |
3788 | 3788 |
| |
|
Lines changed: 0 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
412 | 412 |
| |
413 | 413 |
| |
414 | 414 |
| |
415 |
| - | |
416 |
| - | |
417 |
| - | |
418 | 415 |
| |
419 | 416 |
| |
420 | 417 |
| |
| |||
643 | 640 |
| |
644 | 641 |
| |
645 | 642 |
| |
646 |
| - | |
647 |
| - | |
648 |
| - | |
649 | 643 |
| |
650 | 644 |
| |
651 | 645 |
| |
|
Lines changed: 4 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
39 | 39 |
| |
40 | 40 |
| |
41 | 41 |
| |
42 |
| - | |
43 |
| - | |
44 |
| - | |
45 |
| - | |
| 42 | + | |
| 43 | + | |
46 | 44 |
| |
47 | 45 |
| |
48 |
| - | |
49 |
| - | |
50 |
| - | |
51 |
| - | |
| 46 | + | |
| 47 | + | |
52 | 48 |
| |
53 | 49 |
| |
54 | 50 |
|
Lines changed: 1 addition & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 | 11 |
| |
15 | 12 |
| |
16 | 13 |
| |
17 | 14 |
| |
18 | 15 |
| |
19 | 16 |
| |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 | 17 |
| |
24 |
| - | |
25 | 18 |
| |
26 | 19 |
| |
27 | 20 |
| |
28 | 21 |
| |
29 |
| - | |
| 22 | + | |
30 | 23 |
| |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 | 24 |
| |
39 | 25 |
| |
40 | 26 |
| |
| |||
54 | 40 |
| |
55 | 41 |
| |
56 | 42 |
| |
57 |
| - | |
58 | 43 |
|
Lines changed: 1 addition & 16 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
8 | 8 |
| |
9 | 9 |
| |
10 | 10 |
| |
11 |
| - | |
12 |
| - | |
13 |
| - | |
14 | 11 |
| |
15 | 12 |
| |
16 | 13 |
| |
17 | 14 |
| |
18 | 15 |
| |
19 | 16 |
| |
20 |
| - | |
21 |
| - | |
22 |
| - | |
23 | 17 |
| |
24 |
| - | |
25 | 18 |
| |
26 | 19 |
| |
27 | 20 |
| |
28 | 21 |
| |
29 |
| - | |
| 22 | + | |
30 | 23 |
| |
31 |
| - | |
32 |
| - | |
33 |
| - | |
34 |
| - | |
35 |
| - | |
36 |
| - | |
37 |
| - | |
38 | 24 |
| |
39 | 25 |
| |
40 | 26 |
| |
| |||
54 | 40 |
| |
55 | 41 |
| |
56 | 42 |
| |
57 |
| - | |
58 | 43 |
|
Lines changed: 0 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
332 | 332 |
| |
333 | 333 |
| |
334 | 334 |
| |
335 |
| - | |
336 | 335 |
| |
337 | 336 |
| |
338 | 337 |
| |
| |||
408 | 407 |
| |
409 | 408 |
| |
410 | 409 |
| |
411 |
| - | |
412 | 410 |
| |
413 | 411 |
| |
414 | 412 |
| |
|
0 commit comments
Comments
(0)