From bfde52da67b17e680ca5da34f553788ce1cbf7ef Mon Sep 17 00:00:00 2001 From: delphij Date: Wed, 31 May 2017 05:10:03 +0000 Subject: MFC r315272, r315370 r315272: Implement INHERIT_ZERO for minherit(2). INHERIT_ZERO is an OpenBSD feature. When a page is marked as such, it would be zeroed upon fork(). This would be used in new arc4random(3) functions. PR: 182610 Reviewed by: kib (earlier version) Differential Revision: https://reviews.freebsd.org/D427 r315370: The adj_free and max_free values of new_entry will be calculated and assigned by subsequent vm_map_entry_link(), therefore, remove the pointless copying. Submitted by: alc --- lib/libc/sys/minherit.2 | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'lib/libc/sys') diff --git a/lib/libc/sys/minherit.2 b/lib/libc/sys/minherit.2 index dc85d09..f2d437d 100644 --- a/lib/libc/sys/minherit.2 +++ b/lib/libc/sys/minherit.2 @@ -29,7 +29,7 @@ .\" .\" @(#)minherit.2 8.1 (Berkeley) 6/9/93 .\" -.Dd October 30, 2007 +.Dd March 15, 2017 .Dt MINHERIT 2 .Os .Sh NAME @@ -91,6 +91,11 @@ it will no longer be shared in the parent after the parent forks and there is no way to get the previous shared-backing-store mapping without unmapping and remapping the address 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 .Sh RETURN VALUES .Rv -std minherit @@ -130,6 +135,13 @@ system call first appeared in .Ox and then in .Fx 2.2 . +.Pp +The +.Dv INHERIT_ZERO +support first appeared in +.Ox 5.6 +and then in +.Fx 12.0 . .Sh BUGS Once you set inheritance to .Dv MAP_PRIVATE -- cgit v1.1