1、 POSIX is a registered trademark of the Institute of Electrical and Electronics Engineers, Inc.IEEE Std 1003.5, 1999 Edition(Incorporates IEEE Std 1003.5-1992,IEEE Std 1003.5b-1996, andIEEE Std 1003.5c-1998)IEEE Standard for Information TechnologyPOSIXAda Language InterfacesPart 1: Binding for Syste
2、m ApplicationProgram Interface (API)IncludesAmendment 1: Realtime ExtensionsandAmendment 2: Protocol-Independent InterfacesSponsorPortable Applications Standards Committeeof theIEEE Computer SocietyApproved 8 December 1998IEEE Standards BoardAbstract:This standard is part of the POSIXseries of stand
3、ards for applications and user inter-faces to open systems. It defines the Ada language bindings as package specifications and accom-panying textual descriptions of the application program interface (API). This standard supportsapplication portability at the source code level through the binding bet
4、ween ISO 8652:1995 (Ada)and ISO/IEC 9945-1:1996 (IEEE Std 1003.1-1996) (POSIX) as amended by IEEE P1003.1g/D6.6.Terminology and general requirements, process primitives, the process environment, files anddirectories, input and output primaries, device- and class-specific functions, language-specific
5、services for Ada, system databases, synchronization, memory management, execution scheduling,clocks and timers, message passing, task management, the XTI and socket detailed network inter-faces, event management, network support functions, and protocol-specific mappings are covered.It also specifies
6、 behavior to support the binding that must be proviced by the Ada.Keywords:Ada, API, application portability, computer language bindings, information exchange,interprocess communication, networks, open systems, operating systems, portable application,POSIX, POSIX language bindings, protocol-specific
7、, protocol-independent, real-time, sockets,thread, XTI.The Institute of Electrical and Electronics Engineers, Inc.3 Park Avenue, New York, NY 10016-5997, USACopyright 1999 by the Institute of Electrical and Electronics Engineers, Inc.All rights reserved. Published 3 December 1999. Printed in the Uni
8、ted States of America.Print:ISBN 0-7381-1539-8 SH94710PDF:ISBN 0-7381-1540-1 SS94710No part of this publication may be reproduced in any form, in an electronic retrieval system or otherwise, without the prior written permission of the publisher.IEEE Standardsdocuments are developed within the IEEE S
9、ocieties and the Standards Coordinating Com-mittees of the IEEE Standards Association (IEEE-SA) Standards Board. Members of the committees servevoluntarily and without compensation. They are not necessarily members of the Institute. The standardsdeveloped within IEEE represent a consensus of the bro
10、ad expertise on the subject within the Institute aswell as those activities outside of IEEE that have expressed an interest in participating in the development ofthe standard.Use of an IEEE Standard is wholly voluntary. The existence of an IEEE Standard does not imply that thereare no other ways to
11、produce, test, measure, purchase, market, or provide other goods and services related tothe scope of the IEEE Standard. Furthermore, the viewpoint expressed at the time a standard is approved andissued is subject to change brought about through developments in the state of the art and commentsreceiv
12、ed from users of the standard. Every IEEE Standard is subjected to review at least every five years forrevision or reaffirmation. When a document is more than five years old and has not been reaffirmed, it is rea-sonable to conclude that its contents, although still of some value, do not wholly refl
13、ect the present state ofthe art. Users are cautioned to check to determine that they have the latest edition of any IEEE Standard.Comments for revision of IEEE Standards are welcome from any interested party, regardless of membershipaffiliation with IEEE. Suggestions for changes in documents should
14、be in the form of a proposed change oftext, together with appropriate supporting comments.Interpretations: Occasionally questions may arise regarding the meaning of portions of standards as theyrelate to specific applications. When the need for interpretations is brought to the attention of IEEE, th
15、eInstitute will initiate action to prepare appropriate responses. Since IEEE Standards represent a consensus ofall concerned interests, it is important to ensure that any interpretation has also received the concurrence of abalance of interests. For this reason, IEEE and the members of its societies
16、 and Standards CoordinatingCommittees are not able to provide an instant response to interpretation requests except in those cases wherethe matter has previously received formal consideration. Comments on standards and requests for interpretations should be addressed to:Secretary, IEEE-SA Standards
17、Board445 Hoes LaneP.O. Box 1331Piscataway, NJ 08855-1331USAAuthorization to photocopy portions of any individual standard for internal or personal use is granted by theInstitute of Electrical and Electronics Engineers, Inc., provided that the appropriate fee is paid to CopyrightClearance Center. To
18、arrange for payment of licensing fee, please contact Copyright Clearance Center, Cus-tomer Service, 222 Rosewood Drive, Danvers, MA 01923 USA; (978) 750-8400. Permission to photocopyportions of any individual standard for educational classroom use can also be obtained through the Copy-right Clearanc
19、e Center.Note: Attention is called to the possibility that implementation of this standard mayrequire use of subject matter covered by patent rights. By publication of this standard,no position is taken with respect to the existence or validity of any patent rights inconnection therewith. The IEEE s
20、hall not be responsible for identifying patents forwhich a license may be required by an IEEE standard or for conducting inquiries intothe legal validity or scope of those patents that are brought to its attention.ContentsPAGEIntroduction . . . . . . . viSection 1: General . . . 11.1 Scope . . . . .
21、 . 11.2 Normative References . . . . . . 31.3 Conformance . . 4Section 2: Terminology and General Requirements . . 92.1 Editorial Conventions . 92.2 Definitions . . . 102.3 General Concepts . . . 382.4 Package POSIX. 422.5 Package POSIX_Options 762.6 Package POSIX_Limits . 822.7 Package Ada_Streams
22、872.8 Package System 882.9 Package System_Storage_Elements . 892.10 Package POSIX_Page_Alignment . 902.11 Environment Description . . . . . 91Section 3: Process Primitives . 953.1 Package POSIX_Process_Primitives 953.2 Package POSIX_Unsafe_Process_Primitives . 1083.3 Package POSIX_Signals 115Section
23、 4: Process Environment . . . . . 1494.1 Package POSIX_Process_Identification . 1494.2 Package POSIX_Process_Times 1564.3 Package POSIX_Process_Environment . 1574.4 Package POSIX_Calendar 1644.5 Package POSIX_Configurable_System_Limits 167Section 5: Files and Directories . . . . . . 1755.1 Package P
24、OSIX_Permissions . 1755.2 Package POSIX_Files 1785.3 Package POSIX_File_Status . 1905.4 Package POSIX_Configurable_File_Limits . 194Section 6: I/O Primitives . . . . 2056.1 Package POSIX_IO 205ii 6.2 Package POSIX_File_Locking . 2326.3 Package POSIX_Asynchronous_IO 234Section 7: Device- and Class-Sp
25、ecific Functions . . . . 2537.1 General Terminal Interface . . . 2537.2 Package POSIX_Terminal_Functions 260Section 8: Language-Specific Services for Ada . . . . . 2798.1 Interoperable Ada I/O Services . 2798.2 Package POSIX_Supplement_to_Ada_IO . 283Section 9: System Databases . 2879.1 Package POSI
26、X_User_Database 2879.2 Package POSIX_Group_Database . 289Section 10: Data Interchange Format . . 293Section 11: Synchronization . . 29511.1 Package POSIX_Semaphores 29511.2 Package POSIX_Mutexes 30411.3 Package POSIX_Condition_Variables . 314Section 12: Memory Management . . . . 32312.1 Package POSI
27、X_Memory_Locking . 32412.2 Package POSIX_Memory_Range_Locking. 32612.3 Package POSIX_Memory_Mapping . 32812.4 Package POSIX_Shared_Memory_Objects 33712.5 Package POSIX_Generic_Shared_Memory 341Section 13: Execution Scheduling . . . . . 34913.1 Scheduling Concepts and Terminology . . . . . 34913.2 Pa
28、ckage POSIX_Process_Scheduling 34913.3 Task Scheduling . . . . 35413.4 Synchronization Scheduling . . . 356Section 14: Clocks and Timers . . . . . . 35714.1 Package POSIX_Timers . 35714.2 High Resolution Delay . . . . . . 366Section 15: Message Passing . 36715.1 Package POSIX_Message_Queues . 367Sec
29、tion 16: Task Management . . . . . . 38316.1 Package Ada_Task_Identification . 383Section 17: Detailed Network Interface - XTI . . . . . . 38517.1 Introduction . . 38517.2 States and Events . . . 39117.3 The Use of Options . . 39917.4 Package POSIX_XTI . 410iii Section 18: Detailed Network Interface
30、 - Socket . . . . 48718.1 Introduction . . 48718.2 Events and States . . . 48918.3 Use of Options . 49818.4 Package POSIX_Sockets 498Section 19: Event Management . . . . . . 53519.1 Package POSIX_Event_Management 535Annex A (informative) Bibliography . . . 547Annex B (informative) Rationale and Note
31、s . . . . . . . 549B.1 General . . . . . 549B.2 Terminology and General Requirements . . . . 563B.3 Process Primitives . . . 575B.4 Process Environment . 592B.5 Files and Directories . 598B.6 Input and Output Primitives . . 602B.7 Device- and Class-Specific Functions . . . . . . 610B.8 Language-Spec
32、ific Services for Ada . . . . . . . 610B.9 System Databases . . . 621B.10 Data Interchange Format . . . . 623B.11 Synchronization . . . . 623B.12 Memory Management . 629B.13 Execution Scheduling . 634B.14 Clocks and Timers . . . 639B.15 Message Passing . . . . 642B.16 Task Identification . . 643B.17
33、 Thread-Specific Data . 643B.18 Detailed Network Interface - XTI 643B.19 Detailed Network Interface - Socket . . . . . . 646B.20 Network Support Functions . . . 647B.21 Protocol Mappings Annex . . . . 648Annex C (informative) Ada/C Cross-References . . . . . 651C.1 Ada-to-C Cross-Reference . . . . 6
34、51C.2 C-to-Ada Cross-Reference . . . . 681Annex D (normative) Protocol Mappings . 713D.1 Sockets Protocol Mappings . . . . 713D.2 XTI Protocol Mappings . . . . . . 759Alphabetic Topical Index . . . . 819TABLESTable1.1 Sockets and XTI Package Renaming . . . . . 5Table2.1 Typographical Conventions . .
35、 9iv Table2.2 Constant and Subtype Correspondences . . 52Table2.3 Option Set Comparisons . . . . 60Table2.4 Static Subtypes and Options . 81Table2.5 Portable Constants and Limits 86Table2.6 Static Subtypes and Limits . . 88Table3.1 Default Actions for Job Control Signals . . . 127Table4.1 Functions
36、for System-Wide Options . . . . . 172Table4.2 Configurable System Limits . 174Table6.1 Standard File Descriptors . . . 209Table6.2 Error Codes and AIO Status Values . . . . . 247Table7.1 Terminal_CharacteristicsComponents 263Table7.2 Terminal_ModesValues for Input Control . . . . 265Table7.3 Termina
37、l_ModesValues for Output Control . . . 267Table7.4 Terminal_ModesValues for Hardware Control . . 267Table7.5 Terminal_ModesValues for Local Control Modes . . . . . . 269Table7.6 Special Control Character Usage . . . . . . . 272Table17.1 Events and Look . 389Table17.2 Classification of the XTI Functi
38、ons . . . . . 392Table17.3 Communication Interface States . . . . . . 394Table17.4 Initialization/De-initialization State Table . . . . 396Table17.5 Data Transfer State Table for Connectionless-Mode Service 396Table17.6 Connection/Release/Data Transfer State Table for Connection-Mode Service . . . .
39、 397Table17.7 Event_Requires_AttentionError Indications . . . . . . 399Table18.1 Socket Events . . . 490Table18.2 Socket States . . . 491TableB.1 Correspondence of File Creation Flags . . . 615TableD.1 Port Number Re-Use . . . . . 744TableD.2 Communications_Provider_Info Returned by Get_Info andOpen
40、, mOSI . . . . . 774TableD.3 XTI and ACSE/Presentation Services . . . . 777TableD.4 XTI mOSI Connection-Mode Data Transfer Services . . . . . 779TableD.5 XTI and Association Release Services . . . . 779TableD.6 XTI Connectionless-Mode ACSE Services . 780TableD.7 Communications_Provider_Info Returned
41、 by Get_Info andOpen,ISO 801TableD.8 Communications_Provider_Info Returned by Get_Info andOpen, Internet . . . 810v IEEE Std 1003.5c-1998Introduction(This introduction is not a part of IEEE Std 1003.5c-1998, IEEE Standard for Information Technology POSIX#0DRAda Language Interfaces Part 1: Binding fo
42、r System Application Program Interface (API) Amendment 2: Protocol-Independent Interfaces,cbut is included for information only.)This standard is an amended version of IEEE Std 1003.5b-1996.cThe basic goal ofthis standard is to provide an Ada application program interface for the language-independen
43、t services made accessible to C-language applications programs by theinterfaces defined in ISO/IEC 9945-1:1996 (IEEE Std 1003.1-1996) f2g as amendedby IEEE P1003.1g fB14gc.The intent is to support portability of Ada applications via a standard binding tothe services provided by a POSIX-conforming op
44、erating system. POSIX is definedby the standard C-language interfaces cited above. Therefore, much of the work inproducing this standard was deciding what features of those C-language interfacesrepresented POSIX functionality, as opposed to C-language-specific features.This standard provides package
45、 specifications and accompanying textual descriptionfor a set of Ada packages that represent the POSIX system. This standard also spec-ifies behavior to support the binding that must be provided by the Ada compilationsystem, and further defines behavior specified as implementation defined in the Ada
46、language standard (particularly in the area of Text_IO) for use in a POSIX environ-ment.The emphasis in POSIX is on application program portability, so the interfaces in thisstandard are not intended to be sufficient to implement an Ada compilation systemor a POSIX shell as defined in IEEE Standard
47、1003.2 fB16g. For an application,the intent is that a Strictly Conforming POSIX.5 Application (one that uses onlythe facilities in this standard and that does not depend on implementation-definedbehavior) can be ported to any Conforming Implementation of these interfaces andthat the binding makes it
48、 easy to identify where a program is not strictly conformingand makes such programs easier to port.Organization of This StandardThe standard is divided into three parts: Statement of scope, list of normative references, and conformance information(Section 1) Definitions and global concepts (Section 2) The various interface facilities (Sections 3 through 19)The content of the sections parallels that of the correspondingly numbered sectionsof ISO/IEC 9945-1:1996 and IEEE P1003.1g/D6.6, with a few
copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1