- Notifications
You must be signed in to change notification settings - Fork5
Commit1541632
committed
Add code to InternalIpcMemoryCreate() to handle the case where shmget()
returns EINVAL for an existing shared memory segment. Although it's notterribly sensible, that behavior does meet the POSIX spec because EINVALis the appropriate error code when the existing segment is smaller than therequested size, and the spec explicitly disclaims any particular ordering oferror checks. Moreover, it does in fact happen on OS X and probably otherBSD-derived kernels. (We were able to talk NetBSD into changing their code,but purging that behavior from the wild completely seems unlikely to happen.)We need to distinguish collision with a pre-existing segment from invalid sizerequest in order to behave sensibly, so it's worth some extra code here to getit right. Per report from Gavin Kistner and subsequent investigation.Back-patch to all supported versions, since any of them could get usedwith a kernel having the debatable behavior.1 parent170456c commit1541632
1 file changed
+43
-1
lines changedLines changed: 43 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
10 | 10 |
| |
11 | 11 |
| |
12 | 12 |
| |
13 |
| - | |
| 13 | + | |
14 | 14 |
| |
15 | 15 |
| |
16 | 16 |
| |
| |||
92 | 92 |
| |
93 | 93 |
| |
94 | 94 |
| |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
95 | 137 |
| |
96 | 138 |
| |
97 | 139 |
| |
|
0 commit comments
Comments
(0)