Project

General

Profile

Actions

Bug #3282

open

unexpected errno value from fopen()

Added by bhaible 6 months ago. Updated 5 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Userland
Target version:
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 #1

Updated by tuxillo 5 months ago

  • Target version set to 6.2
Actions

Also available in: Atom PDF