1、 The Institute of Electrical and Electronics Engineers, Inc.3 Park Avenue, New York, NY 10016-5997, USACopyright 2000 by the Institute of Electrical and Electronics Engineers, Inc.All rights reserved. Published November 2000. Printed in the United States of America.Print:ISBN 0-7381-1970-9 SH94827PD
2、F:ISBN 0-7381-1971-7 SS94827No 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 Std 2003.1b-2000(Amendment toIEEE Std 2003.1-1992)IEEE Standard for Information TechnologyTest Methods Spe
3、cifications for Measuring Conformance to POSIXPart 1: System Application Program Interface (API)Amendment 1: Realtime Extension C LanguageSponsorPortable Applications Standards Committeeof theIEEE Computer SocietyApproved 30 March 2000IEEE-SA Standards BoardAbstract:This standard defines the test me
4、thod specifications for IEEE Std 1003.1b-1993 (basedon the document corresponding to the merger of IEEE Std 1003.1-1990 and IEEE Std 1003.1b-1993). The test method specifications consist of assertions to be tested and related test procedures.As an amendment to IEEE Std 1003.1-1990, this standard is
5、structured to amend those portions ofIEEE Std 2003.1-1992 4 (the test method specification for IEEE Std 1003.1-1990) that correspondto the amended parts of IEEE Std 1003.1-1990. This standard is aimed primarily at providers of testmethods for IEEE Std 1003.1b-1993 and at implementors of IEEE Std 100
6、3.1b-1993.Keywords:assertion, assertion test, C programming language, POSIX, POSIX ConformanceDocument, POSIX Conformance Test Procedure, POSIX Conformance Test Suite, realtime, testmethod specification, test result codePOSIX is a registered trademark of the Institute of Electrical and Electronics E
7、ngineers, Inc.IEEE Standardsdocuments are developed within the IEEE Societies 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
8、. The standardsdeveloped within IEEE represent a consensus of the broad 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 existen
9、ce of an IEEE Standard does not imply that thereare no other ways to 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
10、about through developments in the state of the art and commentsreceived 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 conclud
11、e that its contents, although still of some value, do not wholly reflect 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 membersh
12、ipaffiliation with IEEE. Suggestions for changes in documents should 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
13、 the need for interpretations is brought to the attention of IEEE, theInstitute 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
14、 of interests. For this reason, IEEE and the members of its societies 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
15、 interpretations should be addressed to:Secretary, IEEE-SA Standards Board445 Hoes LaneP.O. Box 1331Piscataway, NJ 08855-1331USAIEEE is the sole entity that may authorize the use of certification marks, trademarks, or other designations toindicate compliance with the materials set forth herein.Autho
16、rization 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 arrange for payment of licensing fee, please contact Copyright C
17、learance 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 Clearance Center.Note: Attention is called to the possibility that imple
18、mentation 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 shall not be responsible for identifying patents forwhich a licen
19、se 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.iiContentsIntroductionviiiOrganization of This Standard . viiiHow to Read This Standard . viiiRelated Standards Activities . ixSection 1: General . 11
20、.1 Scope 11.2 Normative References . 21.3 Conformance 31.4 Test Methods 4Section 2: Terminology and General Requirements . 192.1 Conventions 192.2 Definitions . 202.3 General Concepts 282.4 Error Numbers 342.5 Primitive System Data Types . 352.6 Environment Description 352.7 C Language Definitions .
21、 372.8 Numerical Limits 402.9 Symbolic Constants 43Section 3: Process Primitives 483.1 Process Creation and Execution . 483.1.1 Process Creation . 483.1.2 Execute a File . 503.2 Process Termination 533.2.1 Wait for Process Termination . 533.2.2 Terminate a Process . 533.3 Signals 553.3.1 Signal Conc
22、epts 553.3.2 Send a Signal to a Process 653.3.3 Manipulate Signal Sets 653.3.4 Examine and Change Signal Action . 653.3.5 Examine and Change Blocked Signals . 673.3.6 Examine Pending Signals 673.3.7 Wait for a Signal . 683.3.8 Synchronously Accept a Signal 683.3.9 Queue a Signal to a Process . 723.4
23、 Timer Operations 753.4.1 Schedule Alarm 763.4.2 Suspend Process Execution . 763.4.3 Delay Process Execution . 76iiiSection 4: Process Environment . 784.8 Configurable System Variables . 784.8.1 Get Configurable System Variables . 78Section 5: Files and Directories 825.1 Directories . 825.1.1 Format
24、 of Directory Entries . 825.1.2 Directory Operations 825.2 Working Directory . 825.2.1 Change Current Working Directory . 825.2.2 Get Working Directory Pathname 835.3 General File Creation . 835.3.1 Open a File . 835.3.2 Create New File or Rewrite an Existing One 845.3.3 Set File Creation Mask 845.3
25、.4 Link to a File 855.4 Special File Creation . 855.4.1 Make a Directory . 855.4.2 Make a FIFO Special File . 855.5 File Removal . 865.5.1 Remove Directory Entries 865.5.2 Remove a Directory . 865.5.3 Rename a File . 865.6 File Characteristics . 875.6.1 File Characteristics: Header and Data Structur
26、e 875.6.2 Get File Status . 885.6.3 Check File Accessibility . 895.6.4 Change File Modes . 895.6.5 Change Owner and Group of a File . 925.6.6 Set File Access and Modification Times . 935.6.7 Truncate a File to a Specified Length 935.7 Configurable Pathname Variables . 965.7.1 Get Configurable Pathna
27、me Variables . 96Section 6: Input and Output Primitives 996.1 Pipes . 996.1.1 Create an Inter-Process Channel . 996.2 File Descriptor Manipulation . 996.2.1 Duplicate an Open File Descriptor 996.3 File Descriptor Deassignment 1006.3.1 Close a File .1006.4 Input and Output 1016.4.1 Read from a File .
28、1016.4.2 Write to a File .1026.5 Control Operations on Files 1036.5.1 Data Definitions for File Control Operations 1036.5.2 File Control .1036.5.3 Reposition Read/Write File Offset 1066.6 File Synchronization .107iv6.6.1 Synchronize the State of a File .1076.6.2 Synchronize the Data of a File .1106.
29、7 Asynchronous Input and Output .1126.7.1 Data Definitions for Asynchronous Input and Output 1126.7.2 Asynchronous Read .1156.7.3 Asynchronous Write 1216.7.4 List Directed I/O .1286.7.5 Retrieve Error Status of Asynchronous I/O Operation.1386.7.6 Retrieve Return Status of Asynchronous I/O Operation
30、1406.7.7 Cancel Asynchronous I/O Request 1416.7.8 Wait for Asynchronous I/O Request .1446.7.9 Asynchronous File Synchronization .147Section 7: Device- and Class- Specific Functions 153Section 8: Language-Specific Services for the C Programming Language 1548.2.2 Open a Stream on a File Descriptor .15
31、4Section 9: System Databases 155Section 10: Data Interchange Format 156Section 11: Synchronization 15711.1 Semaphore Characteristics 15711.2 Semaphore Functions 15811.2.1 Initialize an Unnamed Semaphore .15811.2.2 Destroy an Unnamed Semaphore 16111.2.3 Initialize/Open a Named Semaphore .16211.2.4 Cl
32、ose a Named Semaphore 16811.2.5 Remove a Named Semaphore 17011.2.6 Lock a Semaphore .17211.2.7 Unlock a Semaphore .18011.2.8 Get the Value of a Semaphore 184Section 12: Memory Management 18712.1 Memory Locking Functions .18912.1.1 Lock/Unlock the Address Space of a Process .18912.1.2 Lock/Unlock a R
33、ange of Process Address Space 19312.2 Memory Mapping Functions 19712.2.1 Map Process Address to a Memory Object .19712.2.3 Change Memory Protection 20712.2.4 Memory Object Synchronization 21112.3 Shared Memory Functions 21512.3.1 Open a Shared Memory Object .21512.3.2 Remove a Shared Memory Object .
34、222Section 13: Execution Scheduling 22513.1 Scheduling Parameters .225v13.2 Scheduling Policies .22513.2.1 SCHED_FIFO 22613.2.2 SCHED_RR .22813.2.3 SCHED_OTHER 22813.3 Process Scheduling Functions .22913.3.1 Set Scheduling Parameters .22913.3.2 Get Scheduling Parameters 23213.3.3 Set Scheduling Poli
35、cy and Scheduling Parameters .23413.3.4 Get Scheduling Policy 23813.3.5 Yield Processor .23913.3.6 Get Scheduling Parameter Limits 240Section 14: Clocks and Timers 24514.1 Data Definitions for Clocks and Timers 24514.1.1 Time Value Specification Structures .24514.1.2 Timer Event Notification Control
36、 Block 24614.1.3 Type Definitions 24614.1.4 Manifest Constants 24614.2 Clocks and Timer Functions .24714.2.1 Clocks 24714.2.2 Create a Per-Process Timer 25314.2.3 Delete a Per-Process Timer 25714.2.4 Per-Process Timers 25914.2.5 High Resolution Sleep 265Section 15: Message Passing 26915.1 Data Defin
37、itions for Message Queues 26915.1.1 Data Structures .26915.2 Message Passing Functions .27015.2.1 Open a Message Queue .27015.2.2 Close a Message Queue .27815.2.3 Remove a Message Queue .28015.2.4 Send a Message to a Message Queue .28215.2.5 Receive a Message From a Message Queue 28515.2.6 Notify Pr
38、ocess that a Message is Available on a Queue .28715.2.7 Set Message Queue Attributes 28915.2.8 Get Message Queue Attributes 291Annex A(normative)Conforming Test Results 293A.1 General .293A.2 Terminology and General Requirements 293A.3 Process Primitives .295A.4 Process Environment .302A.5 Files and
39、 Directories .302A.6 Input and Output Primitives .306A.7 Device- and Class-Specific Functions 314A.8 Language-Specific Services for the C Programming Language .314viA.9 System Databases .314A.10 Data Interchange Format .314A.11 Synchronization .314A.12 Memory Management .319A.13 Execution Scheduling
40、 .326A.14 Clocks and Timers .330A.15 Message Passing .335Annex B(informative)Bibliography .341B.1 Related Open Systems Standards 341B.2 Other Standards .343B.3 Historical Documentation and Introductory Texts .343B.4 Other Sources of Information 345Identifier Index 347Alphabetic Topical Index 350TABL
41、ESTable 1-1 G25 PCTS Symbols and Values . 6Table 2-1 G25 Minimum Values . 40Table 2-2 G25 Run-Time Invariant Values (Possibly Indeterminate) 42Table 2-3 G25 Maximum Values . 43Table 2-4 G25 Compile-Time Symbolic Constants . 44Table 2-5 G25 Execution-Time Symbolic Constants 46Table 3-1 G25 Required S
42、ignals 55Table 3-2 G25 Job Control Signals . 56Table 3-3 G25 Memory Protection Signals 56Table 4-2 G25 Configurable System Variables . 80viiiIntroduction(This Introduction is not a normative part of IEEE Std 2003.1b-2000, IEEE Standard for InformationTechnologyG25Test Methods Specifications for Meas
43、uring Conformance to POSIX-Part 1: SystemApplication Program Interface(API)-Amendment 1: Realtime Extension C Language).This standard defines the test method specifications for IEEE Std 1003.1b-1993 (based on thedocument corresponding to the merger of IEEE Std 1003.1-1990 and IEEE Std 1003.1b-1993).
44、The test method specifications consist of assertions to be tested and related test procedures. Asan amendment to IEEE Std 1003.1-1990, this standard is structured to amend those portions ofIEEE Std. 2003.1-1992 4 (the test method specification for IEEE Std 1003.1-1990) thatcorrespond to the amended
45、parts of IEEE Std 1003.1-1990. This standard is aimed primarily atproviders of test methods for IEEE Std 1003.1b-1993 and at implementors of IEEE Std 1003.1b-1993.Organization of This StandardThis document is organized into five parts, as follows:(1) Statement of scope, normative references, conform
46、ance requirements, and test methods(Section 1)(2) Conventions and definitions (Section 2)(3) Assertions to test POSIX.1b 3 (Sections 2 through 15)(4) Conforming test results (Annex A)(5) Bibliography (Annex B)This introduction, any footnotes, notes accompanying the test, and the informative annexes
47、arenot considered part of this standard. Annex A is normative. Annex B is informative.How to Read This StandardThis document is organized using the same section numbering as POSIX.1b 3, in order tofacilitate finding the testing requirements for a particular element of POSIX.1b 3. Subclause1.4 has be
48、en added to this document to keep the section numbering consistent with POSIX.1b3 and to provide a place to describe features relevant to the test methods. It is stronglyrecommended that the reader review 1.4 after reading 1.1, 1.2, and this introduction. Wherepossible, this document tries to use th
49、e same assertion numbering that was used as IEEE Std2003.1-1992 4. This document skips over the assertion numbers where there are no assertionsthat correspond to an assertion in IEEE Std 2003.1-1992 4. The assertions have beennumbered with a fractional part where more than one assertion takes the place of a singleassertion in IEEE Std 2003.1-1992 4.1)A Standards Status Report that lists all current IEEE Computer Society standards projects is available from theIEEE Computer Society, 1730 Massachusetts Avenue NW, Washington, DC 20036-1903, Telephone: +1 202371-0101; F