Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000676 [1003.1(2013)/Issue7+TC1] System Interfaces Editorial Clarification Requested 2013-04-08 04:57 2019-06-10 08:55
Reporter philip-guenther View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Closed  
Name Philip Guenther
Organization OpenBSD
User Reference
Section pread(), pwrite()
Page Number 1754,2288
Line Number 56422,72479
Interp Status ---
Final Accepted Text See Note: 0001543.
Summary 0000676: description of pread()/pwrite() on tty or socket inconsistent
Description The description of pread() says:
   An attempt to perform a pread() on a file that is incapable of
   seeking shall result in an error.

The ERRORS sections then says this:
  [ESPIPE] fildes is associated with a pipe or FIFO.

...but no error is given for using pread() on a socket or tty.

Testing indicates that Solaris 10 and FreeBSD 8.2 treat using pread() on a tty the same as doing a read() on it. For sockets, Solaris 10 treats pread() like read(), while FreeBSD fails with ESPIPE.

Linux 2.6.18 (RHEL 5.8) and OpenBSD 5.3 fail with ESPIPE for both ttys and sockets.

While the pwrite() DESCRIPTION doesn't make a statement about failing on unseekable file type, it does fail to describe ESPIPE as applying in the socket and tty cases. The four platforms tested (Solaris, FreeBSD, Linux, and OpenBSD) have the same behavior with pwrite() as they do with pread().
Desired Action My inclination is that given the description and the underlying reason for using pread(), it should be required to fail with ESPIPE for these, but I can understand a decision to make it a "may fail" instead. If the former, then change:
  [ESPIPE] fildes is associated with a pipe or FIFO.
to
  [ESPIPE] fildes is associated with a pipe, FIFO, socket, or tty.


Otherwise, if the "may fail" route is chosen, then change this:
   An attempt to perform a pread() on a file that is incapable of
   seeking shall result in an error.
to (something like) this:
   An attempt to perform a pread() on a pipe or FIFO shall result in
   an error; an attempt to perform a pread() on other types of files
   that are incapable of seeking may result in an error.

and add to ERRORS:

The pread() function may fail, and the file pointer shall remain unchanged, if:
  [ESPIPE] fildes is associated with a socket or tty.



And then, either way, the same changes should be made to the write()/pwrite() page.
Tags tc2-2008
Attached Files

- Relationships

-  Notes
(0001536)
geoffclare (manager)
2013-04-08 08:48

It appears that this largely duplicates bugs 0000215 and 0000218, which were applied in TC1.
(0001537)
philip-guenther (reporter)
2013-04-08 16:23

Yeah, the socket aspects were covered by those bugs; my apologies for the duplication. The tty aspects do still appear to apply, at least in my check of the preview of the 2013 HTML version (yay!) that was just posted.

Another tweak to make if the pread/pwrite of tty case is made a "shall fail" error: the [EIO] errors that are specific to a background process accessing its controlling terminal should be moved into the part of the ERRORS section which is specific to the read() or write() function.
(0001543)
Don Cragun (manager)
2013-04-21 00:23
edited on: 2013-04-21 00:27

Change the ESPIPE error condition description for pread() on P1754, L56422 from:
    The file is a pipe, FIFO, or socket.

to:
    The file is incapable of seeking.


Make the same change to the ESPIPE error condition description for pwrite() on P2288, L72479.


- Issue History
Date Modified Username Field Change
2013-04-08 04:57 philip-guenther New Issue
2013-04-08 04:57 philip-guenther Status New => Under Review
2013-04-08 04:57 philip-guenther Assigned To => ajosey
2013-04-08 04:57 philip-guenther Name => Philip Guenther
2013-04-08 04:57 philip-guenther Organization => OpenBSD
2013-04-08 04:57 philip-guenther Section => pread
2013-04-08 04:57 philip-guenther Page Number => 1739
2013-04-08 04:57 philip-guenther Line Number => 55479-55480,55525
2013-04-08 08:48 geoffclare Note Added: 0001536
2013-04-08 16:23 philip-guenther Note Added: 0001537
2013-04-18 16:00 Don Cragun Project 1003.1(2008)/Issue 7 => 1003.1(2013)/Issue7+TC1
2013-04-21 00:23 Don Cragun Page Number 1739 => 1754,2288
2013-04-21 00:23 Don Cragun Line Number 55479-55480,55525 => 56422,72479
2013-04-21 00:23 Don Cragun Interp Status => ---
2013-04-21 00:23 Don Cragun Note Added: 0001543
2013-04-21 00:27 Don Cragun Note Edited: 0001543
2013-04-21 00:27 Don Cragun Section pread => pread(), pwrite()
2013-04-25 15:51 Don Cragun Final Accepted Text => See Note: 0001543.
2013-04-25 15:51 Don Cragun Status Under Review => Resolved
2013-04-25 15:51 Don Cragun Resolution Open => Accepted As Marked
2013-04-25 15:52 Don Cragun Tag Attached: tc2-2008
2019-06-10 08:55 agadmin Status Resolved => Closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker