1、 Reference number ISO/IEC TR 24715:2006(E) ISO/IEC 2006TECHNICAL REPORT ISO/IEC TR 24715 First edition 2006-11-01 Information technology Programming languages, their environments and system software interfaces Technical Report on the Conflicts between the ISO/IEC 9945 (POSIX) and the Linux Standard
2、Base (ISO/IEC 23360) Technologies de linformation Langages de programmation, leurs environnements et interfaces de logiciel systme Rapport technique sur les conflits entre lISO/CEI 9945 (POSIX) et la base normalise Linux (ISO/CEI 23360) ISO/IEC TR 24715:2006(E) PDF disclaimer This PDF file may conta
3、in embedded typefaces. In accordance with Adobes licensing policy, this file may be printed or viewed but shall not be edited unless the typefaces which are embedded are licensed to and installed on the computer performing the editing. In downloading this file, parties accept therein the responsibil
4、ity of not infringing Adobes licensing policy. The ISO Central Secretariat accepts no liability in this area. Adobe is a trademark of Adobe Systems Incorporated. Details of the software products used to create this PDF file can be found in the General Info relative to the file; the PDF-creation para
5、meters were optimized for printing. Every care has been taken to ensure that the file is suitable for use by ISO member bodies. In the unlikely event that a problem relating to it is found, please inform the Central Secretariat at the address given below. ISO/IEC 2006 All rights reserved. Unless oth
6、erwise specified, no part of this publication may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying and microfilm, without permission in writing from either ISO at the address below or ISOs member body in the country of the requester. ISO copyrig
7、ht office Case postale 56 CH-1211 Geneva 20 Tel. + 41 22 749 01 11 Fax + 41 22 749 09 47 E-mail copyrightiso.org Web www.iso.org Published in Switzerland ii ISO/IEC 2006 All rights reservedISO/IEC TR 24715:2006(E) ISO/IEC 2006 All rights reserved iiiContents Contents .iii Foreword . iv Introduction
8、. v 1 Scope . 1 2 Normative References . 2 3 Terms and Definitions. 3 4 System Interfaces 4 4.1 Headers and Interface Definitions. 4 4.2 ISO/IEC 9945 System Interfaces not in the LSB. 7 5 Shell and Utilities Interfaces 9 5.1 Built-in cd, getopts, read, umask and wait. 9 5.2 Utility Definitions 9 5.3
9、 Internationalization. 15 5.4 ISO/IEC 9945 Utility Interfaces not in the LSB 15 Appendix A: Background Information 17 A.1 POSIX Standards 17 ISO/IEC TR 24715:2006(E) iv ISO/IEC 2006 All rights reservedForeword ISO (the International Organization for Standardization) and IEC (the International Electr
10、otechnical Commission) form the specialized system for worldwide standardization. National bodies that are members of ISO or IEC participate in the development of International Standards through technical committees established by the respective organization to deal with particular fields of technic
11、al activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other international organizations, governmental and non-governmental, in liaison with ISO and IEC, also take part in the work. In the field of information technology, ISO and IEC have established a joint technica
12、l committee, ISO/IEC JTC 1. International Standards are drafted in accordance with the rules given in the ISO/IEC Directives, Part 2. The main task of the joint technical committee is to prepare International Standards. Draft International Standards adopted by the joint technical committee are circu
13、lated to national bodies for voting. Publication as an International Standard requires approval by at least 75 % of the national bodies casting a vote. In exceptional circumstances, the joint technical committee may propose the publication of a Technical Report of one of the following types: type 1,
14、 when the required support cannot be obtained for the publication of an International Standard, despite repeated efforts; type 2, when the subject is still under technical development or where for any other reason there is the future but not immediate possibility of an agreement on an International
15、Standard; type 3, when the joint technical committee has collected data of a different kind from that which is normally published as an International Standard (“state of the art”, for example). Technical Reports of types 1 and 2 are subject to review within three years of publication, to decide whet
16、her they can be transformed into International Standards. Technical Reports of type 3 do not necessarily have to be reviewed until the data they provide are considered to be no longer valid or useful. Attention is drawn to the possibility that some of the elements of this document may be the subject
17、 of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent rights. ISO/IEC TR 24715, which is a Technical Report of type 3, was prepared by Joint Technical Committee ISO/IEC JTC 1, Information technology, Subcommittee SC 22, Programming languages, their envir
18、onments and system software interfaces. ISO/IEC TR 24715:2006(E) ISO/IEC 2006 All rights reserved vIntroduction The purpose of this Type 3 Technical Report (informative) is to document the areas of conflict between ISO/IEC 9945 (POSIX 1 ) and the Free Standards Groups Linux 2Standard Base specificat
19、ion (ISO/IEC 23360) such that it can be utilized by the appropriate technical committees when considering harmonization between the standards efforts. ISO/IEC 9945 (POSIX) is an important International Standard in use throughout the world. There is a significant investment in applications developed
20、for the ISO POSIX International Standard. With the emergence of a standardization initiative for the Linux operating system, there are some areas of conflict that have been identified between the Linux Standard Base specification (ISO/IEC 23360) and the ISO POSIX International Standards. There is an
21、 essential marketrequirement that the conflicts be resolved so that an application can be written to conformto both International Standards. Hundreds of millions of dollars of applications are built upon theseInternational Standards. This Technical Report is intended as a starting point to look at r
22、esolution ofthis issue. 1POSIX is a registered trademark of the IEEE. 2Linux is a registered trademark of Linus Torvalds. ISO/IEC TR 24715:2006(E) vi ISO/IEC 2006 All rights reservedParticipants The following people contributed work to this Technical Report: Stuart Anderson Andrew Josey The Austin G
23、roup Paul Eggert Nick Stoughton The LSB Workgroup TECHNICAL REPORT ISO/IEC TR 24715:2006(E) ISO/IEC 2006 All rights reserved 1 Information technology Programming languages, their environments and system software interfaces Technical Report on the Conflicts between the ISO/IEC 9945 (POSIX) and the Li
24、nux Standard Base (ISO/IEC 23360) 1 Scope The scope of this Technical Report is to identify areas of conflict between the Linux Standard Base (LSB 3 ) 3.1 specification (ISO/IEC 23360) and the ISO/IEC 9945 (POSIX) standard. It is based on the Linux Standard Base Core Specification 3.1, which was sub
25、mitted to ISO/IEC on 2005-10-31 for publication as ISO/IEC 23360; and ISO/IEC 9945:2003 edition dated 2003-08-15 with ISO/IEC 9945:2003/Cor.1:2004 (published 2004-09-15). The audience for this Technical Report is the technical workgroups that develop the standards; that is, the Austin Group and the
26、Linux Standard Base workgroup. It is also intended to be of interest to systems engineers, technical managers and procurement officers. This document is organized in the following clauses: Clause 2 provides a list of normative references. Clause 3 provides the terms and definitions used in this docu
27、ment. Clause 4 provides a list of differences that could be possible conflicts or extensions in the System Interfaces. Clause 5 provides a list of differences that could be possible conflicts or extensions in the Shell and Utilities. Appendix A provides background information on the POSIX standards
28、and the LSB. 3LSB is a trademark of the Free Standards Group. ISO/IEC TR 24715:2006(E) 2 ISO/IEC 2006 All rights reserved2 Normative References The following referenced documents are indispensable for the application of this document. For dated references, only the edition cited applies. For undated
29、 references, the latest edition of the referenced document (including any amendments) applies. ISO/IEC 9945-1:2003, Information technology Portable Operating System Interface (POSIX) Part 1: Base Definitions ISO/IEC 9945-1:2003/Cor 1:2004 ISO/IEC 9945-2:2003, Information technology Portable Operatin
30、g System Interface (POSIX) Part 2: System Interfaces ISO/IEC 9945-2:2003/Cor 1:2004 ISO/IEC 9945-3:2003, Information technology Portable Operating System Interface (POSIX) Part 3: Shell and Utilities ISO/IEC 9945-3:2003/Cor 1:2004 ISO/IEC 9945-4:2003, Information technology Portable Operating System
31、 Interface (POSIX) Part 4: Rationale ISO/IEC 9945-4:2003/Cor 1:2004 ISO/IEC 23360 (all parts), Linux Standard Base (LSB) Core Specification 3.1ISO/IEC TR 24715:2006(E) ISO/IEC 2006 All rights reserved 3 3 Terms and Definitions For the purposes of this document, the terms and definitions of ISO/IEC 9
32、945-1:2003, Information technology Portable Operating System Interface (POSIX) Part 1: Base Definitions apply. ISO/IEC TR 24715:2006(E) 4 ISO/IEC 2006 All rights reserved4 System Interfaces This section describes possible areas of conflict between the LSB and ISO/IEC 9945 (POSIX) for the System Inte
33、rfaces. This description is based on the Linux Standard Base Core Specification 3.1. Note that the descriptions of the known conflicts are taken from the LSB and have not been verified by the Austin Group, thus they may be subject to interpretation of the standard. In some cases, the differences may
34、 be upward-compatible extensions. In cases where the LSB provides its own API reference page rather than referencing ISO/IEC 9945, then that is noted here, and it is possible that further investigation might determine that there is no conflict. 4.1 Headers and Interface Definitions 4.1.1 errno LSB r
35、equires ENOTSUP to be defined the same as EOPNOTSUP, whereas ISO/IEC 9945 requires that these errno values be unique. A defect report has been filed to the Austin Group on this matter. 4.1.2 fcntl LSB permits implementations to set O_LARGEFILE: According to ISO/IEC 9945, only an application sets fcn
36、tl() flags; for example, O_LARGEFILE. However, the LSB specification also allows an implementation to set the O_LARGEFILE flag in the case where the programming environment is one of: _POSIX_V6_ILP32_OFFBIG _POSIX_V6_LP64_OFF64 _POSIX_V6_LPBIG_OFFBIG See getconf and c99 in ISO/IEC 9945 for a descrip
37、tion of these environments. Thus, calling fcntl() with the F_GETFL command may return O_LARGEFILE as well as flags explicitly set by the application in the case that both the implementation and the application support an off_t of at least 64 bits. 4.1.3 fscanf, fwscanf, scanf, vfscanf, vfwscanf, vsc
38、anf, vsscanf, vswscanf,vwscanf, wscanf The LSB states: The %s, %S and % conversion specifiers shall accept an option length modifier a, which shall cause a memory buffer to be allocated to hold the string converted. In such a ISO/IEC TR 24715:2006(E) ISO/IEC 2006 All rights reserved 5 case, the argu
39、ment corresponding to the conversion specifier should be a reference to a pointer value that will receive a pointer to the allocated buffer. If there is insufficient memory to allocate a buffer, the function may set errno to ENOMEM and a conversion error results. According to the LSB this directly c
40、onflicts with the ISO C (1999) usage of %a as a conversion specifier for hexadecimal float values. While this conversion specifier should be supported, a format specifier such as “%aseconds“ will have a different meaning on an LSB conforming system. 4.1.4 getopt The LSB documents a number of GNU ext
41、ensions to getopt() as well as descriptions of the POSIX requirements. Such extensions include argument ordering. The LSB requires LSB implementations to implement the GNU behavior. The POSIXLY_CORRECT environment variable is documented as a method to obtain ISO/IEC 9945 conforming behavior. 4.1.5 k
42、ill Process ID -1 doesnt affect the calling process: If pid is specified as -1, LSB says that sig shall not be sent to the calling process, whereas ISO/IEC 9945 states: “If pid is -1, sig shall be sent to all processes (excluding an unspecified set of system processes) for which the process has perm
43、ission to send that signal.” This was a deliberate Linus decision after an unpopular experiment in including the calling process in the 2.5.1 kernel. See “What does it mean to signal everybody?”. 44.1.6 link link need not follow symbolic links: ISO/IEC 9945 specifies that pathname resolution shall f
44、ollow symbolic links during pathname resolution unless the function is required to act on the symbolic link itself, or certain arguments direct that the function act on the symbolic link itself. The ISO/IEC 9945 link() function contains no such requirement to operate on a symbolic link. However, a c
45、onforming LSB implementation need not follow a symbolic link for the path1 argument, and hence may allow implementations of link() to create a link to a symbolic link itself. 4“What does it mean to signal everybody?”, Linux Weekly News, 20 December 2001, ISO/IEC TR 24715:2006(E) 6 ISO/IEC 2006 All
46、rights reserved4.1.7 regexec The LSB permits certain aspects of regular expression matching to be optional; see Internationalization and Regular Expressions. 4.1.8 strerror_r The SYNOPSIS for strerror_r is defined in the LSB to have a return value of type extern char *, whereas ISO/IEC 9945 defines
47、the return value to be type int. Also, according to the LSB it is optional whether an implementation copies a message into the supplied buffer. Returns string, not error value: The strerror_r() function shall return a pointer to the string corresponding to errno. The returned pointer may point withi
48、n the buffer buf (at most buflen bytes). Return value: On success, strerror_r() shall return a pointer to the generated message string (determined by the setting of the LC_MESSAGES category in the current locale). Otherwise, strerror_r() shall return the string corresponding to “Unknown error”. 4.1.
49、9 strptime The LSB documents an issue with limiting the number of leading zeroes. LSB states: “Number of leading zeroes limited.” The Single UNIX Specification, Version 2 specifies fields for which “leading zeros are permitted but not required”; however, applications must not expect to be able to supply more leading zeroes for these fields than would be implied by the range of the field. Implementations may choose to either match an input with exces