On Thu, Jul 14, 2011 at 12:05:18PM -0700, Matthew Dempsky wrote:
> I'm unsure what values are best to pick for UTIME_NOW and UTIME_OMIT.
> The only restriction is that they be distinct integer values outside
> the valid range for tv_nsec values (i.e., [0, 999999999]).  Values
> below are from Linux; OpenSolaris uses UTIME_NOW == -1 and UTIME_OMIT
> == -2.

Unless anyone objects, I'm going to change this to UTIME_OMIT == -1
and UTIME_NOW == -2.  Rationale is weak, but:

  - It should be slightly more efficient to check

        (tv_nsec >= 0 && tv_nsec <= 999999999) ||
        tv_nsec == UTIME_OMIT || tv_nsec == UTIME_NOW

    if UTIME_OMIT and UTIME_NOW are contiguous with [0, 999999999].
    The compiler should be able to optimize the test to simply

        ((u_long)tv_nsec + 2) <= 1000000001.)

  - Making UTIME_OMIT == -1 means it has the same bit pattern as
    VNOVAL.  (Code shouldn't rely on this because they're logically
    disjoint types, but I can imagine it being a convenience when
    debugging VFS code that all 'noval' values are -1.)

Reply via email to