View Issue Details

IDProjectCategoryView StatusLast Update
00012801003.1(2016/18)/Issue7+TC2System Interfacespublic2024-06-11 09:08
Reporterdalias Assigned To 
PrioritynormalSeverityEditorialTypeClarification Requested
Status ClosedResolutionAccepted As Marked 
NameRich Felker
Organizationmusl libc
User Reference
Sectionutimensat/futimens
Page Number?
Line Number?
Interp Status---
Final Accepted Text0001280:0004544
Summary0001280: Error requirements with UTIME_OMIT
DescriptionThe DESCRIPTION specifies:

"If both tv_nsec fields are set to UTIME_OMIT, no ownership or permissions check shall be performed for the file, but other error conditions may still be detected (including [EACCES] errors related to the path prefix)."

Note the "may".

However, under ERRORS, there are "shall fail" errors that would apply under the condition where both times are UTIME_OMIT.
Desired ActionClarify whether these errors are required if both times are UTIME_OMIT. Either add exceptions to the error conditions (e.g. "and not both tv_nsec fields are set to UTIME_OMIT") or replace the "may" in the description with appropriate wording not to imply that these errors are optional.

Note: Linux kernel does not detect any errors in the case where both are UTIME_OMIT. I'm not aware of what other implementations do.
Tagstc3-2008

Activities

geoffclare

2019-08-19 08:51

manager   bugnote:0004529

I believe the intention was to allow implementations to notice that both times specify UTIME_OMIT and return straight away without making any use of the path or fd. So the "may" in the DESCRIPTION is right and the ERRORS section needs updating.

Rather than having to repeat most errors in "shall fail" and "may fail" forms, perhaps we can do something like this in the intro to each set of errors that are currently "shall fail":
The utimes() function shall fail, the futimens() and utimensat() functions shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the futimens() and utimensat() functions may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if:

dalias

2019-08-19 14:51

reporter   bugnote:0004531

That looks fine to me. I'm happy with any outcome for this that clarifies the intent. I only hit the issue working on tests for my implementation in conjunction with 64-bit time_t work and wasn't sure what the correct behavior should be.

geoffclare

2019-08-28 09:29

manager   bugnote:0004544

Proposed changes ...

On page 988 line 33571 section futimens(), change:
These functions shall fail if
to:
The utimes() function shall fail, the futimens() and utimensat() functions shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the futimens() and utimensat() functions may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33585 section futimens(), change:
The futimens() function shall fail if
to:
The futimens() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33587 section futimens(), change:
The utimensat() function shall fail if
to:
The utimensat() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

On page 988 line 33595 section futimens(), change:
The utimensat() and utimes() functions shall fail if
to:
The utimes() function shall fail, the utimensat() function shall fail in the case that the times argument does not have both tv_nsec fields set to UTIME_OMIT, and the utimensat() function may fail in the case that the times argument has both tv_nsec fields set to UTIME_OMIT, if

Issue History

Date Modified Username Field Change
2019-08-16 22:45 dalias New Issue
2019-08-16 22:45 dalias Name => Rich Felker
2019-08-16 22:45 dalias Organization => musl libc
2019-08-16 22:45 dalias Section => utimensat/futimens
2019-08-16 22:45 dalias Page Number => ?
2019-08-16 22:45 dalias Line Number => ?
2019-08-19 08:51 geoffclare Note Added: 0004529
2019-08-19 14:51 dalias Note Added: 0004531
2019-08-28 09:29 geoffclare Note Added: 0004544
2019-08-29 15:11 geoffclare Interp Status => ---
2019-08-29 15:11 geoffclare Final Accepted Text => 0001280:0004544
2019-08-29 15:11 geoffclare Status New => Resolved
2019-08-29 15:11 geoffclare Resolution Open => Accepted As Marked
2019-08-29 15:11 geoffclare Tag Attached: tc3-2008
2019-11-21 14:49 geoffclare Status Resolved => Applied
2024-06-11 09:08 agadmin Status Applied => Closed