Discussion:
[1003.1(2013)/Issue7+TC1 0000850]: Standardize MAP_ANON
Austin Group Bug Tracker
2014-07-10 05:23:15 UTC
Permalink
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=850
======================================================================
Reported By: mdempsky
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 850
Category: System Interfaces
Type: Enhancement Request
Severity: Editorial
Priority: normal
Status: New
Name: Matthew Dempsky
Organization: OpenBSD
User Reference:
Section: mmap
Page Number:
Line Number:
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-06-24 22:11 UTC
Last Modified: 2014-07-10 05:23 UTC
======================================================================
Summary: Standardize MAP_ANON
======================================================================

----------------------------------------------------------------------
(0002305) rhansen (reporter) - 2014-07-10 05:23
http://austingroupbugs.net/view.php?id=850#c2305
----------------------------------------------------------------------
On page 37 after line 1195 (XBD 3.15 definition of Angle Brackets), add a
new section (and renumber subsequent entries as appropriate):

<blockquote>3.16 Anonymous Memory Object<blockquote>An object that
represents memory not associated with any other memory
objects.</blockquote></blockquote>

On page 68 after line 1972 (XBD 3.22 definition of Memory Object), add:

<blockquote><ul><li>An anonymous memory object (see Section 3.16 on page
37).</li></ul></blockquote>

On page 372 after line 12515 (XBD <sys/mman.h> description), add:

<blockquote>MAP_ANON Synonym for MAP_ANONYMOUS.
MAP_ANONYMOUS Map anonymous memory.</blockquote>

On page 1322 after line 43724 (XSH mmap() description), add:

<blockquote><ul><li>Anonymous memory objects.</li></ul></blockquote>

On page 1322 line 43730 (XSH mmap() description) change:

<blockquote>The <i>mmap</i>() function shall establish a mapping between
the address space of the process at an address <i>pa</i> for <i>len</i>
bytes to the memory object represented by the file descriptor <i>fildes</i>
at offset <i>off</i> for <i>len</i> bytes.</blockquote>

to:

<blockquote>The <i>mmap</i>() function shall establish a mapping between
the address space of the process at an address <i>pa</i> for <i>len</i>
bytes to the memory object represented by the file descriptor <i>fildes</i>
at offset <i>off</i> for <i>len</i> bytes, or to an anonymous memory object
of <i>len</i> bytes.</blockquote>

On page 1323 after line 43773 (XSH mmap() description, table about MAP_*
symbolic constants), add a row:

<blockquote>MAP_ANON | Synonym for MAP_ANONYMOUS.
MAP_ANONYMOUS | Map anonymous memory.</blockquote>

On page 1324 after line 43823 (XSH mmap() description), add a new
paragraph:

<blockquote>If MAP_ANON or MAP_ANONYMOUS is specified, <i>fildes</i> is -1,
and <i>off</i> is 0, then <i>mmap</i>() shall ignore <i>fildes</i> and
instead establish a mapping to a new anonymous memory object of size
<i>len</i>. The effect of specifying MAP_ANON or MAP_ANONYMOUS with other
values of <i>fildes</i> or <i>off</i> is unspecified. Anonymous memory
objects shall be initialized to all bits zero.</blockquote>

On page 1328 after line 43989 (XSH mmap() rationale), add a new paragraph:

<blockquote>Some historical implementations only supported MAP_ANON, some
only supported MAP_ANONYMOUS, and some supported both spellings. This
standard includes both spellings partly for application compatibility and
partly because neither spelling was clearly more popular than the other at
the time this feature was considered for standardization.</blockquote>

On page 1365 lines 45154-45155 (XSH msync() description) change:

<blockquote>[SHM|TYM]The effect of <i>msync</i>() on a shared memory object
or a typed memory object is unspecified.[/]</blockquote>

to:

<blockquote>The effect of <i>msync</i>() on an anonymous memory object,
[SHM]shared memory object[/], or [TYM]typed memory object[/] is
unspecified.</blockquote>

Issue History
Date Modified Username Field Change
======================================================================
2014-06-24 22:11 mdempsky New Issue
2014-06-24 22:11 mdempsky Name => Matthew Dempsky
2014-06-24 22:11 mdempsky Organization => OpenBSD
2014-06-24 22:11 mdempsky Section => mmap
2014-06-24 23:10 eadler Issue Monitored: eadler
2014-06-24 23:21 mdempsky Note Added: 0002274
2014-06-26 16:40 rhansen Note Added: 0002281
2014-06-26 16:50 rhansen Note Added: 0002282
2014-06-26 16:51 geoffclare Note Added: 0002283
2014-06-26 17:49 mdempsky Note Added: 0002284
2014-06-26 18:09 mdempsky Note Added: 0002285
2014-06-28 08:08 geoffclare Note Added: 0002292
2014-06-30 19:02 mdempsky Note Added: 0002295
2014-06-30 19:38 rhansen Note Added: 0002296
2014-07-01 03:16 rhansen Note Added: 0002298
2014-07-01 22:18 mdempsky Note Added: 0002299
2014-07-01 23:37 mdempsky Note Added: 0002300
2014-07-10 05:23 rhansen Note Added: 0002305
======================================================================
Geoff Clare
2014-07-10 08:40:40 UTC
Permalink
Post by Austin Group Bug Tracker
----------------------------------------------------------------------
(0002305) rhansen (reporter) - 2014-07-10 05:23
http://austingroupbugs.net/view.php?id=850#c2305
----------------------------------------------------------------------
<blockquote>MAP_ANON Synonym for MAP_ANONYMOUS.
MAP_ANONYMOUS Map anonymous memory.</blockquote>
Does saying it is a synonym make it sufficiently clear that it must
have the same value? Perhaps we should make that explicit.
Post by Austin Group Bug Tracker
On page 1324 after line 43823 (XSH mmap() description), add a new
<blockquote>If MAP_ANON or MAP_ANONYMOUS is specified, <i>fildes</i> is -1,
and <i>off</i> is 0, then <i>mmap</i>() shall ignore <i>fildes</i> and
instead establish a mapping to a new anonymous memory object of size
<i>len</i>. The effect of specifying MAP_ANON or MAP_ANONYMOUS with other
values of <i>fildes</i> or <i>off</i> is unspecified. Anonymous memory
objects shall be initialized to all bits zero.</blockquote>
I would prefer:

If MAP_ANONYMOUS (or its synonym MAP_ANON) is specified ...
The effect of specifying MAP_ANONYMOUS (or MAP_ANON) with ...

Thinking about how to update the ERRORS section, rather than modify
the text of all the errors that mention fildes, I think it might be
better to add before page 1326 line 43887:

In addition, if MAP_ANONYMOUS (or MAP_ANON) is not set in <i>flags</i>,
the <i>mmap</i>() function shall fail if:

and then move the EACCES, EBADF, ENODEV and EOVERFLOW errors to after
this new text. That just leaves the two ENXIO errors that use "the
object specified by fildes" to sort out.
--
Geoff Clare <g.clare-7882/***@public.gmane.org>
The Open Group, Apex Plaza, Forbury Road, Reading, RG1 1AX, England
Austin Group Bug Tracker
2014-07-10 09:14:04 UTC
Permalink
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=850
======================================================================
Reported By: mdempsky
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 850
Category: System Interfaces
Type: Enhancement Request
Severity: Editorial
Priority: normal
Status: New
Name: Matthew Dempsky
Organization: OpenBSD
User Reference:
Section: mmap
Page Number:
Line Number:
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2014-06-24 22:11 UTC
Last Modified: 2014-07-10 09:14 UTC
======================================================================
Summary: Standardize MAP_ANON
======================================================================

----------------------------------------------------------------------
(0002306) EdSchouten (updater) - 2014-07-10 09:14
http://austingroupbugs.net/view.php?id=850#c2306
----------------------------------------------------------------------
Sorry for hijacking this discussion, but would there be some interest in
unifying this with adding support for anonymous shared memory objects?

FreeBSD has a special value for shm_open()'s path argument called SHM_ANON.
It can be used to create a nameless shared memory object that is
automatically removed when the last reference (descriptor or memory
mapping) is removed.

Ed

Issue History
Date Modified Username Field Change
======================================================================
2014-06-24 22:11 mdempsky New Issue
2014-06-24 22:11 mdempsky Name => Matthew Dempsky
2014-06-24 22:11 mdempsky Organization => OpenBSD
2014-06-24 22:11 mdempsky Section => mmap
2014-06-24 23:10 eadler Issue Monitored: eadler
2014-06-24 23:21 mdempsky Note Added: 0002274
2014-06-26 16:40 rhansen Note Added: 0002281
2014-06-26 16:50 rhansen Note Added: 0002282
2014-06-26 16:51 geoffclare Note Added: 0002283
2014-06-26 17:49 mdempsky Note Added: 0002284
2014-06-26 18:09 mdempsky Note Added: 0002285
2014-06-28 08:08 geoffclare Note Added: 0002292
2014-06-30 19:02 mdempsky Note Added: 0002295
2014-06-30 19:38 rhansen Note Added: 0002296
2014-07-01 03:16 rhansen Note Added: 0002298
2014-07-01 22:18 mdempsky Note Added: 0002299
2014-07-01 23:37 mdempsky Note Added: 0002300
2014-07-10 05:23 rhansen Note Added: 0002305
2014-07-10 05:25 rhansen Note Edited: 0002305
2014-07-10 09:14 EdSchouten Note Added: 0002306
======================================================================
Austin Group Bug Tracker
2014-07-10 15:58:22 UTC
Permalink
The following issue has been RESOLVED.
======================================================================
http://austingroupbugs.net/view.php?id=850
======================================================================
Reported By: mdempsky
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 850
Category: System Interfaces
Type: Enhancement Request
Severity: Editorial
Priority: normal
Status: Resolved
Name: Matthew Dempsky
Organization: OpenBSD
User Reference:
Section: mmap
Page Number:
Line Number:
Interp Status: ---
Final Accepted Text: See bugnote2305.
Resolution: Accepted As Marked
Fixed in Version:
======================================================================
Date Submitted: 2014-06-24 22:11 UTC
Last Modified: 2014-07-10 15:58 UTC
======================================================================
Summary: Standardize MAP_ANON
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-06-24 22:11 mdempsky New Issue
2014-06-24 22:11 mdempsky Name => Matthew Dempsky
2014-06-24 22:11 mdempsky Organization => OpenBSD
2014-06-24 22:11 mdempsky Section => mmap
2014-06-24 23:10 eadler Issue Monitored: eadler
2014-06-24 23:21 mdempsky Note Added: 0002274
2014-06-26 16:40 rhansen Note Added: 0002281
2014-06-26 16:50 rhansen Note Added: 0002282
2014-06-26 16:51 geoffclare Note Added: 0002283
2014-06-26 17:49 mdempsky Note Added: 0002284
2014-06-26 18:09 mdempsky Note Added: 0002285
2014-06-28 08:08 geoffclare Note Added: 0002292
2014-06-30 19:02 mdempsky Note Added: 0002295
2014-06-30 19:38 rhansen Note Added: 0002296
2014-07-01 03:16 rhansen Note Added: 0002298
2014-07-01 22:18 mdempsky Note Added: 0002299
2014-07-01 23:37 mdempsky Note Added: 0002300
2014-07-10 05:23 rhansen Note Added: 0002305
2014-07-10 05:25 rhansen Note Edited: 0002305
2014-07-10 09:14 EdSchouten Note Added: 0002306
2014-07-10 15:50 rhansen Note Edited: 0002305
2014-07-10 15:54 rhansen Note Edited: 0002305
2014-07-10 15:56 rhansen Note Edited: 0002305
2014-07-10 15:57 rhansen Note Edited: 0002281
2014-07-10 15:58 Don Cragun Interp Status => ---
2014-07-10 15:58 Don Cragun Final Accepted Text => See bugnote2305.
2014-07-10 15:58 Don Cragun Status New => Resolved
2014-07-10 15:58 Don Cragun Resolution Open => Accepted As
Marked
======================================================================
Austin Group Bug Tracker
2014-07-10 15:58:42 UTC
Permalink
The following issue has been UPDATED.
======================================================================
http://austingroupbugs.net/view.php?id=850
======================================================================
Reported By: mdempsky
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 850
Category: System Interfaces
Type: Enhancement Request
Severity: Editorial
Priority: normal
Status: Resolved
Name: Matthew Dempsky
Organization: OpenBSD
User Reference:
Section: mmap
Page Number:
Line Number:
Interp Status: ---
Final Accepted Text: See
http://austingroupbugs.net/view.php?id=850#c2305.
Resolution: Accepted As Marked
Fixed in Version:
======================================================================
Date Submitted: 2014-06-24 22:11 UTC
Last Modified: 2014-07-10 15:58 UTC
======================================================================
Summary: Standardize MAP_ANON
======================================================================

Issue History
Date Modified Username Field Change
======================================================================
2014-06-24 22:11 mdempsky New Issue
2014-06-24 22:11 mdempsky Name => Matthew Dempsky
2014-06-24 22:11 mdempsky Organization => OpenBSD
2014-06-24 22:11 mdempsky Section => mmap
2014-06-24 23:10 eadler Issue Monitored: eadler
2014-06-24 23:21 mdempsky Note Added: 0002274
2014-06-26 16:40 rhansen Note Added: 0002281
2014-06-26 16:50 rhansen Note Added: 0002282
2014-06-26 16:51 geoffclare Note Added: 0002283
2014-06-26 17:49 mdempsky Note Added: 0002284
2014-06-26 18:09 mdempsky Note Added: 0002285
2014-06-28 08:08 geoffclare Note Added: 0002292
2014-06-30 19:02 mdempsky Note Added: 0002295
2014-06-30 19:38 rhansen Note Added: 0002296
2014-07-01 03:16 rhansen Note Added: 0002298
2014-07-01 22:18 mdempsky Note Added: 0002299
2014-07-01 23:37 mdempsky Note Added: 0002300
2014-07-10 05:23 rhansen Note Added: 0002305
2014-07-10 05:25 rhansen Note Edited: 0002305
2014-07-10 09:14 EdSchouten Note Added: 0002306
2014-07-10 15:50 rhansen Note Edited: 0002305
2014-07-10 15:54 rhansen Note Edited: 0002305
2014-07-10 15:56 rhansen Note Edited: 0002305
2014-07-10 15:57 rhansen Note Edited: 0002281
2014-07-10 15:58 Don Cragun Interp Status => ---
2014-07-10 15:58 Don Cragun Final Accepted Text => See bugnote2305.
2014-07-10 15:58 Don Cragun Status New => Resolved
2014-07-10 15:58 Don Cragun Resolution Open => Accepted As
Marked
2014-07-10 15:58 Don Cragun Final Accepted Text See bugnote2305. => See
http://austingroupbugs.net/view.php?id=850#c2305.
======================================================================
Austin Group Bug Tracker
2014-07-10 18:22:04 UTC
Permalink
A NOTE has been added to this issue.
======================================================================
http://austingroupbugs.net/view.php?id=850
======================================================================
Reported By: mdempsky
Assigned To:
======================================================================
Project: 1003.1(2013)/Issue7+TC1
Issue ID: 850
Category: System Interfaces
Type: Enhancement Request
Severity: Editorial
Priority: normal
Status: Resolved
Name: Matthew Dempsky
Organization: OpenBSD
User Reference:
Section: mmap
Page Number:
Line Number:
Interp Status: ---
Final Accepted Text: See
http://austingroupbugs.net/view.php?id=850#c2305.
Resolution: Accepted As Marked
Fixed in Version:
======================================================================
Date Submitted: 2014-06-24 22:11 UTC
Last Modified: 2014-07-10 18:22 UTC
======================================================================
Summary: Standardize MAP_ANON
======================================================================

----------------------------------------------------------------------
(0002308) mdempsky (reporter) - 2014-07-10 18:22
http://austingroupbugs.net/view.php?id=850#c2308
----------------------------------------------------------------------
Ed: I think FreeBSD's SHM_ANON is interesting and worth discussing in a new
issue, but I'd think it would be defined simply as returning a shared
memory object without a name (similar to a shared memory object that has
been shm_unlink()'d), not related to anonymous memory objects.

Issue History
Date Modified Username Field Change
======================================================================
2014-06-24 22:11 mdempsky New Issue
2014-06-24 22:11 mdempsky Name => Matthew Dempsky
2014-06-24 22:11 mdempsky Organization => OpenBSD
2014-06-24 22:11 mdempsky Section => mmap
2014-06-24 23:10 eadler Issue Monitored: eadler
2014-06-24 23:21 mdempsky Note Added: 0002274
2014-06-26 16:40 rhansen Note Added: 0002281
2014-06-26 16:50 rhansen Note Added: 0002282
2014-06-26 16:51 geoffclare Note Added: 0002283
2014-06-26 17:49 mdempsky Note Added: 0002284
2014-06-26 18:09 mdempsky Note Added: 0002285
2014-06-28 08:08 geoffclare Note Added: 0002292
2014-06-30 19:02 mdempsky Note Added: 0002295
2014-06-30 19:38 rhansen Note Added: 0002296
2014-07-01 03:16 rhansen Note Added: 0002298
2014-07-01 22:18 mdempsky Note Added: 0002299
2014-07-01 23:37 mdempsky Note Added: 0002300
2014-07-10 05:23 rhansen Note Added: 0002305
2014-07-10 05:25 rhansen Note Edited: 0002305
2014-07-10 09:14 EdSchouten Note Added: 0002306
2014-07-10 15:50 rhansen Note Edited: 0002305
2014-07-10 15:54 rhansen Note Edited: 0002305
2014-07-10 15:56 rhansen Note Edited: 0002305
2014-07-10 15:57 rhansen Note Edited: 0002281
2014-07-10 15:58 Don Cragun Interp Status => ---
2014-07-10 15:58 Don Cragun Final Accepted Text => See bugnote2305.
2014-07-10 15:58 Don Cragun Status New => Resolved
2014-07-10 15:58 Don Cragun Resolution Open => Accepted As
Marked
2014-07-10 15:58 Don Cragun Final Accepted Text See bugnote2305. => See
http://austingroupbugs.net/view.php?id=850#c2305.
2014-07-10 15:58 Don Cragun Tag Attached: issue8
2014-07-10 15:58 rhansen Note Edited: 0002281
2014-07-10 18:22 mdempsky Note Added: 0002308
======================================================================
Loading...