Changeset View
Changeset View
Standalone View
Standalone View
lib/libc/sys/minherit.2
Show All 23 Lines | |||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) | ||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||||
.\" SUCH DAMAGE. | .\" SUCH DAMAGE. | ||||
.\" | .\" | ||||
.\" @(#)minherit.2 8.1 (Berkeley) 6/9/93 | .\" @(#)minherit.2 8.1 (Berkeley) 6/9/93 | ||||
.\" | .\" | ||||
.Dd October 30, 2007 | .Dd March 15, 2017 | ||||
.Dt MINHERIT 2 | .Dt MINHERIT 2 | ||||
.Os | .Os | ||||
.Sh NAME | .Sh NAME | ||||
.Nm minherit | .Nm minherit | ||||
.Nd control the inheritance of pages | .Nd control the inheritance of pages | ||||
.Sh LIBRARY | .Sh LIBRARY | ||||
.Lb libc | .Lb libc | ||||
.Sh SYNOPSIS | .Sh SYNOPSIS | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | |||||
This option also has an unfortunate side effect of causing the parent | This option also has an unfortunate side effect of causing the parent | ||||
address space to become copy-on-write when the parent forks. | address space to become copy-on-write when the parent forks. | ||||
If the original mapping was | If the original mapping was | ||||
.Dv MAP_SHARED , | .Dv MAP_SHARED , | ||||
it will no longer be shared in the parent | it will no longer be shared in the parent | ||||
after the parent forks and there is no way to get the previous | after the parent forks and there is no way to get the previous | ||||
shared-backing-store mapping without unmapping and remapping the address | shared-backing-store mapping without unmapping and remapping the address | ||||
space in the parent. | space in the parent. | ||||
.It Dv INHERIT_ZERO | |||||
This option causes the address space in question to be mapped as new | |||||
anonymous pages, | |||||
which would be initialized to all zero bytes, | |||||
in the child process. | |||||
.El | .El | ||||
.Sh RETURN VALUES | .Sh RETURN VALUES | ||||
.Rv -std minherit | .Rv -std minherit | ||||
.Sh ERRORS | .Sh ERRORS | ||||
The | The | ||||
.Fn minherit | .Fn minherit | ||||
system call will fail if: | system call will fail if: | ||||
.Bl -tag -width Er | .Bl -tag -width Er | ||||
Show All 23 Lines | |||||
.Xr rfork 2 | .Xr rfork 2 | ||||
.Sh HISTORY | .Sh HISTORY | ||||
The | The | ||||
.Fn minherit | .Fn minherit | ||||
system call first appeared in | system call first appeared in | ||||
.Ox | .Ox | ||||
and then in | and then in | ||||
.Fx 2.2 . | .Fx 2.2 . | ||||
.Pp | |||||
The | |||||
.Dv INHERIT_ZERO | |||||
support first appeared in | |||||
.Ox 5.6 | |||||
and then in | |||||
.Fx 12.0 . | |||||
.Sh BUGS | .Sh BUGS | ||||
Once you set inheritance to | Once you set inheritance to | ||||
.Dv MAP_PRIVATE | .Dv MAP_PRIVATE | ||||
or | or | ||||
.Dv MAP_SHARED , | .Dv MAP_SHARED , | ||||
there is no way to recover the original copy-on-write semantics | there is no way to recover the original copy-on-write semantics | ||||
short of unmapping and remapping the area. | short of unmapping and remapping the area. |