Commit 917a9af
committed
std: Clamp max read/write sizes on Unix
Turns out that even though all these functions take a `size_t` they don't
actually work that well with anything larger than the maximum value of
`ssize_t`, the return value. Furthermore it looks like OSX rejects any
read/write requests larger than `INT_MAX - 1`. Handle all these cases by just
clamping the maximum size of a read/write on Unix to a platform-specific value.
Closes #385901 parent e60aa62 commit 917a9af
2 files changed
+24
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | | - | |
| 15 | + | |
15 | 16 | | |
16 | 17 | | |
17 | 18 | | |
| |||
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
26 | 43 | | |
27 | 44 | | |
28 | 45 | | |
| |||
41 | 58 | | |
42 | 59 | | |
43 | 60 | | |
44 | | - | |
| 61 | + | |
45 | 62 | | |
46 | 63 | | |
47 | 64 | | |
| |||
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | | - | |
| 89 | + | |
73 | 90 | | |
74 | 91 | | |
75 | 92 | | |
| |||
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | | - | |
| 99 | + | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
| |||
102 | 119 | | |
103 | 120 | | |
104 | 121 | | |
105 | | - | |
| 122 | + | |
106 | 123 | | |
107 | 124 | | |
108 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | 22 | | |
24 | 23 | | |
25 | 24 | | |
| |||
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | | - | |
87 | | - | |
88 | | - | |
| 85 | + | |
89 | 86 | | |
90 | 87 | | |
91 | 88 | | |
| |||
181 | 178 | | |
182 | 179 | | |
183 | 180 | | |
184 | | - | |
185 | | - | |
186 | | - | |
| 181 | + | |
187 | 182 | | |
188 | 183 | | |
189 | 184 | | |
| |||
0 commit comments