Opened 2 weeks ago

#19062 new bug

open() does not fail with ENOENT when it should

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

Description

POSIX https://pubs.opengroup.org/onlinepubs/9799919799/functions/open.html specifies that the open() function "shall fail" with error code ENOENT if "O_CREAT is set and a component of the path prefix of path does not name an existing file".

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

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

gcc -Wall foo.c
./a.out

Expected output:

ret = -1, errno == ENOENT
OK

Actual output:

ret = -1, errno == Invalid Argument
a.out: foo.c:31:main: errno == ENOENT
Kill Thread

Attachments (1)

foo.c (736 bytes ) - added by bhaible 2 weeks ago.
test case foo.c

Download all attachments as: .zip

Change History (1)

by bhaible, 2 weeks ago

Attachment: foo.c added

test case foo.c

Note: See TracTickets for help on using tickets.