IEEE P1003.2 Draft 11.2 - September 1991 Copyright (c) 1991 by the Institute of Electrical and Electronics Engineers, Inc. 345 East 47th Street New York, NY 10017, USA All rights reserved as an unpublished work. This is an unapproved and unpublished IEEE Standards Draft, subject to change. The publication, distribution, or copying of this draft, as well as all derivative works based on this draft, is expressly prohibited except as set forth below. Permission is hereby granted for IEEE Standards Committee participants to reproduce this document for purposes of IEEE standardization activities only, and subject to the restrictions contained herein. Permission is hereby also granted for member bodies and technical committees of ISO and IEC to reproduce this document for purposes of developing a national position, subject to the restrictions contained herein. Permission is hereby also granted to the preceding entities to make limited copies of this document in an electronic form only for the stated activities. The following restrictions apply to reproducing or transmitting the document in any form: 1) all copies or portions thereof must identify the document's IEEE project number and draft number, and must be accompanied by this entire notice in a prominent location; 2) no portion of this document may be redistributed in any modified or abridged form without the prior approval of the IEEE Standards Department. Other entities seeking permission to reproduce this document, or any portion thereof, for standardization or other activities, must contact the IEEE Standards Department for the appropriate license. Use of information contained in this unapproved draft is at your own risk. IEEE Standards Department Copyright and Permissions 445 Hoes Lane, P.O. Box 1331 Piscataway, NJ 08855-1331, USA +1 (908) 562-3800 +1 (908) 562-1571 [FAX] P1003.2/D11.2 INFORMATION TECHNOLOGY--POSIX Table B-4 - C Compile-Time Symbolic Constants __________________________________________________________________________________________________________________________________________________ Macro Name Description _________________________________________________________________________ _POSIX2_C_VERSION The integer value 199???L. This value 11 indicates the version of the interfaces in 1 this annex that are provided by the 1 implementation. It will change with each 1 published version of this standard to 1 indicate the 4-digit year and 2-digit month 1 that the standard was approved by the IEEE 1 Standards Board. 1 __________________________________________________________________________________________________________________________________________________ B.2.3 Execution-Time Symbolic Constants for Portability Specifications The macros in Table B-5 can be used by the application at execution time to determine which optional facilities are present. If a macro is defined to have the value -1 in the header , the implementation shall never provide that feature when the application runs under that implementation. If a macro is defined to have a value other than -1, the implementation shall always provide that feature. If the macro is undefined, then the _s_y_s_c_o_n_f() function (see B.10.2) can be used to determine if the feature is provided for a particular invocation of the application. Table B-5 - C Execution-Time Symbolic Constants __________________________________________________________________________________________________________________________________________________ Macro Name Description _________________________________________________________________________ _POSIX2_C_DEV The system supports the C Language Development Utilities Option (see Annex A) _POSIX2_FORT_DEV The system supports the FORTRAN Development Utilities Option (see Annex C) _POSIX2_FORT_RUN The system supports the FORTRAN Runtime Utilities Option (see Annex C) _POSIX2_LOCALEDEF The system supports the creation of locales as described in 4.35. _POSIX2_SW_DEV The system supports the Software Development Utilities Option (see Section 6) __________________________________________________________________________________________________________________________________________________ Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. 914 B C Language Bindings Option Part 2: SHELL AND UTILITIES P1003.2/D11.2 B.2.4 POSIX.1 C Numerical Limits The macros specified in POSIX.1 {8} to provide compile-time values for the configurable variables in Table 7-1 (see 7.8.2) shall also be visible in a POSIX.2 system. Other macros required by POSIX.1 {8} 2.9 (Numerical Limits) and 2.10 (Symbolic Constants) may also be visible in a POSIX.2 system. BEGIN_RATIONALE B.2.4.1 POSIX.1 C Numerical Limits Rationale. (_T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _n_o_t _a _p_a_r_t _o_f _P_1_0_0_3._2) Subclause 7.8.2 requires that certain POSIX.1 {8} configurable variables be visible in POSIX.2. Subclause B.2.4 ensures that POSIX.2 C applications can obtain these variables using the same macros as POSIX.1 {8} C applications. It also allows an implementation to make all of the POSIX.1 {8} macros available even if _POSIX_SOURCE is not set. It 1 also allows an implementation to make all of the POSIX.1 {8} symbols 1 available even if it does not support all of POSIX.1 {8}. 1 END_RATIONALE 1 B.3 C Binding for Shell Command Interface BEGIN_RATIONALE B.3.0.1 C Binding for Shell Command Interface Rationale. (_T_h_i_s _s_u_b_c_l_a_u_s_e _i_s _n_o_t _a _p_a_r_t _o_f _P_1_0_0_3._2) The _s_y_s_t_e_m() and _p_o_p_e_n() functions should not be used by programs that have set user (or group) ID privileges, as defined in POSIX.1 {8}. The _f_o_r_k() and _e_x_e_c family of functions [except _e_x_e_c_l_p() and _e_x_e_c_v_p()], also defined in POSIX.1 {8}, should be used instead. This prevents any unforeseen manipulation of the user's environment that could cause execution of commands not anticipated by the calling program. If the original and ``_p_o_p_e_n()ed'' processes both intend to read or write or read and write a common file, and either will be using FILE-type C functions [_f_r_e_a_d(), _f_w_r_i_t_e(), etc.], the rules in POSIX.1 {8} 8.2.3 must be observed. END_RATIONALE Copyright (c) 1991 IEEE. All rights reserved. This is an unapproved IEEE Standards Draft, subject to change. B.3 C Binding for Shell Command Interface 915