Opened 2 months ago

#19045 new bug

utime() call does not bump a file's "change" time

Reported by: bhaible Owned by: nobody
Priority: normal Milestone: Unscheduled
Component: System/POSIX Version: R1/beta5
Keywords: Cc:
Blocked By: Blocking:
Platform: All

Description

According to POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/utime.html , "Upon successful completion, the utime() function shall mark the last file status change timestamp for update"; that is, its 'ctime' shall be bumped.

This does not work in Haiku hrev57823 (from 2024-07-15).

How to reproduce:

Compile and run the attached program foo.c.

gcc -Wall foo.c
./a.out

Expected result: st1.st_ctime and st2.st_ctime values where the second one is approximately 1 second higher than the first one. For example:

st1.st_ctime = 1725309340.347705688, st2.st_ctime = 1725309341.347708528
OK

Actual result: st1.st_ctime and st2.st_ctime values where the second one is smaller than the first one, and an assertion failure.

st1.st_ctime = 1725309344.058982400, st2.st_ctime = 1725308540.949485568
a.out: foo.c:63:main: ctime_compare (&st1, &st2) < 0
Kill Thread

Attachments (1)

foo.c (1.5 KB ) - added by bhaible 2 months ago.
test case foo.c

Download all attachments as: .zip

Change History (1)

by bhaible, 2 months ago

Attachment: foo.c added

test case foo.c

Note: See TracTickets for help on using tickets.