Skip to content

Add UTIME_OMIT and UTIME_NOW

Henri Hannetel requested to merge henritel/relibc:add_utime_consts into master

Add 2 special constants UTIME_OMIT and UTIME_NOW.

When used to set tv_nsec the behavior of futimes() changes as follow:

  • UTIME_OMIT should prevent changes to the file's timestamp.
  • UTIME_NOW should set the file's relevant timestamp to the greatest value supported by the file system that is not greater than the current time.
  • In both cases the value of tv_sec is ignored.

ref: https://pubs.opengroup.org/onlinepubs/9699919799/functions/futimens.html

Solves #172 (closed)

This is my first commit so I probably missed some best practices.

Some of my concerns:

  1. Should I define those values at the platform level?
  2. Should I run E2E tests on each platform?
  3. Is there functions other than futimes() that might use those constants?

Merge request reports