IEEE Standards Interpretation for IEEE Std 1003.1™-1990 IEEE Standard for Information Technology--Portable Operating System Interfaces (POSIX®)
Copyright © 2001 by the Institute of Electrical and Electronics Engineers, Inc. 3 Park Avenue New York, New York 10016-5997 USA All Rights Reserved.
Interpretations are issued to explain and clarify the intent of a standard and do not constitute an alteration to the original standard. In addition, interpretations are not intended to supply consulting information. Permission is 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 Standards Department for the appropriate license. Use of the information contained in this document is at your own risk.
IEEE Standards Department Copyrights and Permissions 445 Hoes Lane, Piscataway, New Jersey 08855-1331, USA
Interpretation Request #11
Topic: pipe as a file & characteristics Relevant Sections: 220.127.116.11, 18.104.22.168, 5.6.1
In 22.214.171.124 pipe, page 17, lines 276-280:
"An object accessed by one of the pair of file descriptors created by the pipe() function. Once created, the file descriptors can be used to manipulated it, and it behaves identically to a FIFO special file when accessed in this way. It has no name in the file hierarchy."
In 126.96.36.199 file, page 14, lines 162-165:
"An object that can be written to, or read from, or both. A file has certain attributes, including access permissions and type. File types include regular file, character special file, block special file, FIFO special file, and directory. Other types of file may be defined by the implementation."
In 5.6.1 File Characteristics: Header and Data Structure, page 101,
"The structure members st_mode, st_ino, st_dev, st_uid, st_gid, st_atime, st_ctime, and st_mtime shall have meaningful values for all file types defined in this part of ISO/IEC 9945."
In 188.8.131.52 Description [Pipes], page 113, lines 22-23:
"Upon successful completion, the pipe() function shall mark for update the st_atime, st_ctime, and st_mtime fields of the pipe."
Is a pipe a file? Is pipe a file type defined in POSIX.1? Does POSIX.1 specify that the fields of the stat structure have meaningful values for pipes? The description of the pipe() function does not specify the setting of the st_uid or st_gid fields.
A pipe is an object that behaves identically to a FIFO special file when accessed via file descriptors. The standard does not specify to what extent a pipe "is" a file, and the behaviour of the pipe in respect of "other" file operations is unspecified. The standard specifies that stat() returns a structure that contains meaningful values for st_atime, st_ctime, and st_mtime for a pipe. The values of other fields return by stat() are not specified for a pipe.
Rationale for Interpretation
A pipe does not support all semantics of a file, yet it is not the intention to preclude its implementation as a file on disk.