- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit79c712a
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 parent25681e0 commit79c712a
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 |
| |
| |||
85 | 85 |
| |
86 | 86 |
| |
87 | 87 |
| |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 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 | + | |
88 | 130 |
| |
89 | 131 |
| |
90 | 132 |
| |
|
0 commit comments
Comments
(0)