欢迎来到麦多课文档分享! | 帮助中心 海量文档,免费浏览,给你所需,享你所想!
麦多课文档分享
全部分类
  • 标准规范>
  • 教学课件>
  • 考试资料>
  • 办公文档>
  • 学术论文>
  • 行业资料>
  • 易语言源码>
  • ImageVerifierCode 换一换
    首页 麦多课文档分享 > 资源分类 > PDF文档下载
    分享到微信 分享到微博 分享到QQ空间

    IEEE 1003 5 INT 1-2006 en Information Technology - POSIX Ada Language Interfaces - Part 1 Binding for System Application Program Interface (API) - Amendment 2 P.pdf

    • 资源ID:1247978       资源大小:11.33KB        全文页数:3页
    • 资源格式: PDF        下载积分:10000积分
    快捷下载 游客一键下载
    账号登录下载
    微信登录下载
    二维码
    微信扫一扫登录
    下载资源需要10000积分(如需开发票,请勿充值!)
    邮箱/手机:
    温馨提示:
    如需开发票,请勿充值!快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。
    如需开发票,请勿充值!如填写123,账号就是123,密码也是123。
    支付方式: 支付宝扫码支付    微信扫码支付   
    验证码:   换一换

    加入VIP,交流精品资源
     
    账号:
    密码:
    验证码:   换一换
      忘记密码?
        
    友情提示
    2、PDF文件下载后,可能会被浏览器默认打开,此种情况可以点击浏览器菜单,保存网页到桌面,就可以正常下载了。
    3、本站不支持迅雷下载,请使用电脑自带的IE浏览器,或者360浏览器、谷歌浏览器下载即可。
    4、本站资源下载后的文档和图纸-无水印,预览文档经过压缩,下载后原文更清晰。
    5、试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。

    IEEE 1003 5 INT 1-2006 en Information Technology - POSIX Ada Language Interfaces - Part 1 Binding for System Application Program Interface (API) - Amendment 2 P.pdf

    1、IEEE-SA - IEEE Std 1003.5-1992 interpretationsIEEE Standards Interpretations for IEEE Std 1003.5 (1999 Edition) - IEEE Standard for Information Technology-POSIX Ada Language Interfaces-PART 1: Binding for System Application Program Interface Copyright 2006 by the Institute of Electrical and Electron

    2、ics Engineers, Inc. All Rights Reserved.This is an interpretation of IEEE Std 1003.5 (1999 Edition). Interpretations are issued to explain and clarify the intent of a standard and are not intended to constitute an alteration to the original standard or to supply consulting information. Permission is

    3、 hereby granted to download and print one copy of this document. Individuals seeking permission to reproduce and/or distribute this document in its entirety or portions of this document must contact the IEEE Standard Department for the appropriate license. Use of the information contained in this do

    4、cument is at your own risk.IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, P. O. Box 1331 Piscataway, New Jersey 08855-1331, USADecember 2006 Interpretation Number: #1 Topic: Open_And_Map_Shared_Memory and Open_Or_Create_And_Map_Shared_Memory functions. Relevant Clauses: 12.5.1.2

    5、Interpretation request #1 This standard states that these functions are equivalent to a sequence of calls. This includes a call to Open_Shared_Memory, with the Mode parameter set as follows: “If the value of Protection is set to Allow_Write, Mode is Read_Write; otherwise Mode is Read_Only.“However,

    6、Protection is a /set/ of options and may be set to “Allow_Write + Allow_Read“. By following the standard literally, this would lead to a Mode of Read_Only, which was clearly not what was intended.This interpretation would make these functions unusable for opening or creating a shared memory mapping

    7、with both read and write access, which this user supposes is the most commonly desired mode of operation.However, this user sees two possible interpretations that would make the functions usable:1. The quoted sentence above should be interpreted as “If the value of Protection /includes/ Allow_Write,

    8、 Mode is Read_Write; otherwise Mode is Read_Only.“2. As it is not specified exactly how the Protection parameter should be used in the subsequent call to Map_Memory, a possible interpretation would be that one should always add the Allow_Read option in the call to Map_Memory.http:/standards.ieee.org

    9、/findstds/interps/1003.5-1999.html (1 of 3)11/4/2011 10:16:17 PMIEEE-SA - IEEE Std 1003.5-1992 interpretationsIn this users opinion, number #2 (above) is counterintuitive, as one would expect the protection parameters passed on to Map_Memory being the same as those initially submitted. And besides t

    10、hat, this would decrease the flexibility by not allowing the user to create a write-only mapping.To illustrate the problematics, a simple example will follow. The example consists of two Ada functions which communicate via a shared memory area. With a common implementation of the IEEE 1003.5 (Floris

    11、t), the problem arises in the form of a Storage_Error when trying to access the shared area:-shmserv.adb- with POSIX_Generic_Shared_Memory, POSIX_IO, POSIX_Memory_Mapping, POSIX.Permissions; with Ada.Text_IO;procedure Shmserv is type Data is record I : Integer; J : Integer; end record; package GSM i

    12、s new Posix_Generic_Shared_Memory(Data); Descriptor : POSIX_IO.File_Descriptor; Data_Access : GSM.Shared_Access; begin Descriptor := GSM.Open_Or_Create_And_Map_Shared_Memory (“/foo“, POSIX_Memory_Mapping.Allow_Write, POSIX.Permissions.Access_Permission_Set); Data_Access := GSM.Access_Shared_Memory(D

    13、escriptor); Data_Access.I := 1; loop Ada.Text_IO.Put_Line(IntegerImage(Data_Access.I); delay(0.5); end loop; end Shmserv; -end shmserv.adb-shmcli.adb- with POSIX_Generic_Shared_Memory, POSIX_IO, POSIX_Memory_Mapping; procedure Shmcli is type Data is record I : Integer; J : Integer; end record; packa

    14、ge GSM is new Posix_Generic_Shared_Memory(Data); Descriptor : POSIX_IO.File_Descriptor; Data_Access : GSM.Shared_Access; begin Descriptor := GSM.Open_And_Map_Shared_Memory (“/foo“, POSIX_Memory_Mapping.Allow_Write); Data_Access := GSM.Access_Shared_Memory(Descriptor); loop Data_Access.I := Data_Acce

    15、ss.I + 1; delay(1.0); end loop; end Shmcli; -end shmcli.adb-The current Florist implementation of Open_And_Map_Shared_Memory is defined as follows:- function Open_And_Map_Shared_Memory (Name : POSIX.POSIX_String; Protection : POSIX.Memory_Mapping.Protection_Options; Masked_Signals : POSIX.Signal_Mas

    16、king := POSIX.RTS_Signals) return POSIX.IO.File_Descriptor is FD : POSIX.IO.File_Descriptor; Mode : POSIX.IO.File_Mode; begin if Protection = POSIX.Memory_Mapping.Allow_Write then Mode := POSIX.IO.Read_Write; else Mode := POSIX.IO.Read_Only; end if; Begin_Critical_Section; begin FD := POSIX.Shared_M

    17、emory_Objects.Open_Shared_Memory (Name, Mode, POSIX.IO.Empty_Set, Masked_Signals); POSIX.IO.Truncate_File (FD, Length); Insert_Node (FD, POSIX.Memory_Mapping.Map_Memory (System.Storage_Elements.Storage_Offset (Length), Protection, POSIX.Memory_Mapping.Map_Shared, FD, 0); End_Critical_Section; except

    18、ion when others = End_Critical_Section; raise; end; return FD; end Open_And_Map_Shared_Memory; -Interpretation Response #1 There is a problem with the wording of 12.5.1.2, and that your suggested intepretation (item 1 above) is correct. That is where the standard says http:/standards.ieee.org/findst

    19、ds/interps/1003.5-1999.html (2 of 3)11/4/2011 10:16:17 PMIEEE-SA - IEEE Std 1003.5-1992 interpretations“If the value of Protection is set to Allow_Write, Mode is Read_Write; otherwise Mode is Read_Only to convey the intended meaning it should instead say“If the value of Protection *includes* Allow_W

    20、rite, Mode is Read_Write; otherwise Mode is Read_Only“.Accordingly, it seems the “=“ test in the Florist implementation code below should be changed to “=“.if Protection = POSIX.Memory_Mapping.Allow_Write then Mode := POSIX.IO.Read_Write; else Mode := POSIX.IO.Read_Only; end if;http:/standards.ieee.org/findstds/interps/1003.5-1999.html (3 of 3)11/4/2011 10:16:17 PM


    注意事项

    本文(IEEE 1003 5 INT 1-2006 en Information Technology - POSIX Ada Language Interfaces - Part 1 Binding for System Application Program Interface (API) - Amendment 2 P.pdf)为本站会员(赵齐羽)主动上传,麦多课文档分享仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知麦多课文档分享(点击联系客服),我们立即给予删除!




    关于我们 - 网站声明 - 网站地图 - 资源地图 - 友情链接 - 网站客服 - 联系我们

    copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
    备案/许可证编号:苏ICP备17064731号-1 

    收起
    展开