Opened 4 months ago

Closed 4 months ago

#19054 closed bug (duplicate)

utimensat() does not fail with EBADF when it should

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

Description

POSIX https://pubs.opengroup.org/onlinepubs/9799919799/functions/utimensat.html specifies that the utimensat() function "shall fail" with error code EBADF if "the times argument does not have both tv_nsec fields set to UTIME_OMIT," and "The path argument does not specify an absolute path and the fd argument is neither AT_FDCWD nor a valid file descriptor open for reading or searching."

This does not work in Haiku hrev57823 (from 2024-07-15): it fails with error code ENOENT instead.

How to reproduce: Compile and run the attached test program.

gcc -Wall foo.c
./a.out

Expected output:

ret = -1, errno == EBADF
OK

Actual output:

ret = -1, errno == No such file or directory
a.out: foo.c:26:main: ret < 0 && errno == EBADF
Kill Thread

Attachments (1)

foo.c (605 bytes ) - added by bhaible 4 months ago.
test case foo.c

Download all attachments as: .zip

Change History (2)

by bhaible, 4 months ago

Attachment: foo.c added

test case foo.c

comment:1 by waddlesplash, 4 months ago

Blocked By: 19048 added
Resolution: duplicate
Status: newclosed
Note: See TracTickets for help on using tickets.