Actions
Bug #3282
openunexpected errno value from fopen()
Start date:
06/14/2021
Due date:
% Done:
0%
Estimated time:
Description
fopen(".", "w") fails with errno = EEXIST.
Per POSIX https://pubs.opengroup.org/onlinepubs/9699919799/functions/fopen.html
one would expect one of EISDIR, EINVAL, EACCES.
How to reproduce: Run this program.
#include <errno.h>
#include <stdio.h>
int main ()
{
FILE *fp = fopen (".", "w");
if (fp == NULL)
{
perror ("fopen");
}
}
Actions