[DragonFlyBSD - Bug #3282] (New) unexpected errno value from fopen()

bugtracker-admin at leaf.dragonflybsd.org bugtracker-admin at leaf.dragonflybsd.org
Mon Jun 14 08:40:25 PDT 2021


Issue #3282 has been reported by bhaible.

----------------------------------------
Bug #3282: unexpected errno value from fopen()
http://bugs.dragonflybsd.org/issues/3282

* Author: bhaible
* Status: New
* Priority: Normal
* Assignee: 
* Category: Userland
* Target version: 
----------------------------------------
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.

<pre>
#include <errno.h>
#include <stdio.h>

int main ()
{
  FILE *fp = fopen (".", "w");
  if (fp == NULL)
    {
      perror ("fopen");
    }
}

</pre>



-- 
You have received this notification because you have either subscribed to it, or are involved in it.
To change your notification preferences, please click here: http://bugs.dragonflybsd.org/my/account


More information about the Bugs mailing list