Opened 20 months ago
Closed 11 months ago
#18355 closed bug (fixed)
open() fails when the argument is a symbolic link to a nonexistent file
Reported by: | bhaible | Owned by: | nobody |
---|---|---|---|
Priority: | normal | Milestone: | R1/beta5 |
Component: | System/POSIX | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/open.html specifies that "In general, the open() function follows the symbolic link if path names a symbolic link." and lists a few conditions under which open(), when passed an argument that is a symbolic link, must fail. These conditions are not met when the argument is simply a symbolic link to a nonexistent file in an existing directory (such as the current directory). Therefore, in this case, the open() call should succeeds, and a regular file should be created at the place the symbolic link points to.
But in Haiku r1beta4, the open() calls fails with errno ENOENT.
How to reproduce:
$ gcc -Wall foo.c $ ./a.out
Expected output:
symlink -> 0 ret -> 3
Actual output:
symlink -> 0 open: No such file or directory
Attachments (1)
Change History (3)
by , 20 months ago
comment:2 by , 11 months ago
Milestone: | Unscheduled → R1/beta5 |
---|---|
Resolution: | → fixed |
Status: | new → closed |
Fixed in hrev57507.
test case