|
1097 | 1097 | and does not work well with ASLR (Address Space Layout Randomization) which is |
1098 | 1098 | frequently used in current Unix systems for dynamically linked programs. |
1099 | 1099 | \item \textbf{warning:} w.r.t. \texttt{MAP\_SHARED} -- if the file is truncated |
1100 | | -by another process so that the truncation affects the mapped part, the access |
1101 | | -to such area results in the \texttt{SIGBUS} resp. \texttt{SIGSEGV} or signal |
1102 | | -to be sent to the process. One way how to get around it is to use |
1103 | | -mandatory locking, however it is not implemented in all the systems. |
1104 | | -In case the mapped memory is used as a parameter for \texttt{write}, |
1105 | | -the signal will not be sent and \texttt{write} will return -1 |
1106 | | -with \texttt{errno} set to \texttt{EFAULT}. |
| 1100 | +by another process in such a way that the truncation affects the mapped part, |
| 1101 | +the access to such area results in getting \texttt{SIGBUS} or \texttt{SIGSEGV}. |
| 1102 | +One way how to get around it is to use mandatory locking, however it is not |
| 1103 | +implemented in all the systems. In case the mapped memory is used as a |
| 1104 | +parameter for \texttt{write}, the signal will not be sent and \texttt{write} |
| 1105 | +will return -1 with \texttt{errno} set to \texttt{EFAULT}. |
1107 | 1106 | \item when using \texttt{MAP\_PRIVATE} on Solaris all the changes done by other |
1108 | 1107 | processes that have mapped the file using \texttt{MAP\_SHARED} are visible |
1109 | | -until the process writes to the page. |
1110 | | --- at this moment a copy of the page is created and subsequent changes by |
1111 | | -other processes are not visible anymore. |
1112 | | -On FreeBSD the changes are not visible even before the first write. |
1113 | | -The spec says: |
| 1108 | +until the process writes to the page. At this moment a copy of the page is |
| 1109 | +created and subsequent changes by other processes are not visible anymore. |
| 1110 | +On FreeBSD such changes are never visible. The spec says: |
1114 | 1111 | \emph{,,It is unspecified whether modifications to the underlying object done |
1115 | 1112 | after the \texttt{MAP\_PRIVATE} mapping is established are visible through the |
1116 | 1113 | \texttt{MAP\_PRIVATE} mapping.''} |
|
0 commit comments