View Issue Details

IDProjectCategoryView StatusLast Update
00005011003.1(2008)/Issue 7System Interfacespublic2019-06-10 08:55
Reportergeoffclare Assigned Toajosey  
PrioritynormalSeverityObjectionTypeError
Status ClosedResolutionAccepted As Marked 
NameGeoff Clare
OrganizationThe Open Group
User Reference
Sectionfdatasync
Page Number815
Line Number27225
Interp StatusApproved
Final Accepted Textsee 0000501:0000995
Summary0000501: fdatasync() EBADF and "open for writing"
DescriptionDiscussion on the mailing list identified an editorial mistake in
the description of the fdatasync() EBADF error: "open for writing"
should originally have been "open for reading or writing".

However, with the addition of O_EXEC and O_SEARCH this is no longer
an editorial matter, as the group needs to decide whether to require,
allow, or disallow EBADF for file descriptors opened with O_EXEC or
O_SEARCH.

Currently the fsync() EBADF just says "The fildes argument is not a
valid descriptor", so the proposed change makes fdatasync() the
same for consistency.

Alternatively, if it is felt that implementors should be given the
option of returning an EBADF error for file descriptors opened with
O_EXEC or O_SEARCH, then as well as the proposed change a "may fail"
EBADF error should be added to both pages which says "The fildes
argument is not a valid file descriptor open for reading or writing".
Desired ActionChange:

    The fildes argument is not a valid file descriptor open for writing.

to:

    The fildes argument is not a valid file descriptor.
Tagstc2-2008

Relationships

related to 0000671 Closedajosey aio_fsync() EBADF and "open for writing" 

Activities

eblake

2011-10-20 15:49

manager   bugnote:0000994

In addition to the Desired Action, also make these changes:

At line 27232 (APPLICATION USAGE), change "None." to:

Note that even if the file descriptor is not open for writing, if there are
any pending write requests on the underlying file, then that I/O will be
completed prior to the return of fdatasync( ).

eblake

2011-10-20 15:52

manager   bugnote:0000995

Interpretation response
------------------------
The standard states that fdatasync() shall fail on a read-only file
descriptor, and conforming implementations must conform to this. However,
concerns have been raised about this which are being referred to the
sponsor.

Rationale:
-------------
The access mode of the file descriptor does not affect whether there
are pending I/O operations on the underlying file.

Notes to the Editor (not part of this interpretation):
-------------------------------------------------------
Make the changes in the Desired Action and 0000501:0000994

ajosey

2012-06-29 16:18

manager   bugnote:0001296

Interpretation proposed 29 June 2012 for final 45 day review

ajosey

2012-08-30 09:10

manager   bugnote:0001337

Interpretation approved 30 Aug 2012

xroche

2013-03-19 15:17

reporter   bugnote:0001496

aio_fsync has the same issue regarding EBADF and "must be opened for writing" (a requirement which has been enforced in the glibc implementation, for example, causing the function to be unusable for directory file descriptors, for example)

Issue History

Date Modified Username Field Change
2011-10-12 11:31 geoffclare New Issue
2011-10-12 11:31 geoffclare Status New => Under Review
2011-10-12 11:31 geoffclare Assigned To => ajosey
2011-10-12 11:31 geoffclare Name => Geoff Clare
2011-10-12 11:31 geoffclare Organization => The Open Group
2011-10-12 11:31 geoffclare Section => fdatasync
2011-10-12 11:31 geoffclare Page Number => 815
2011-10-12 11:31 geoffclare Line Number => 27225
2011-10-12 11:31 geoffclare Interp Status => ---
2011-10-20 15:49 eblake Note Added: 0000994
2011-10-20 15:52 eblake Note Added: 0000995
2011-10-20 15:52 eblake Tag Attached: tc2-2008
2011-10-20 15:53 eblake Final Accepted Text => see 0000501:0000995
2011-10-20 15:53 eblake Status Under Review => Interpretation Required
2011-10-20 15:53 eblake Resolution Open => Accepted As Marked
2011-10-20 15:53 eblake Desired Action Updated
2011-10-20 15:53 eblake Interp Status --- => Pending
2012-06-29 16:18 ajosey Interp Status Pending => Proposed
2012-06-29 16:18 ajosey Note Added: 0001296
2012-08-30 09:10 ajosey Interp Status Proposed => Approved
2012-08-30 09:10 ajosey Note Added: 0001337
2013-03-19 15:17 xroche Note Added: 0001496
2013-03-19 15:39 nick Issue cloned: 0000671
2013-03-19 15:39 nick Relationship added related to 0000671
2019-06-10 08:55 agadmin Status Interpretation Required => Closed