Re: [DragonFlyBSD - Bug #3282] (In Progress) unexpected errno value from fopen()
Michael Neumann
mneumann at ntecs.de
Sun Oct 11 14:05:12 PDT 2026
Run into this same problem yesterday with Ocaml "opam". Had to boot old kernel. So I think this has to be fixed.
Am 11. Oktober 2026 13:24:33 GMT-05:00 schrieb swildner <bugtracker-admin at leaf.dragonflybsd.org>:
>Issue #3282 has been updated by swildner.
>
>Status changed from Resolved to In Progress
>
>I have reopened this issue because nlookup() isn't the right place for fixing the fopen() issue.
>
>nlookup() affects more than just fopen(), such as mkdir() where EISDIR is wrong, like shown by git itself with this patch:
>
># git format-patch master
>fatal: could not create directory './': Is a directory
>
>It has to be revisited.
>
>
>----------------------------------------
>Bug #3282: unexpected errno value from fopen()
>http://bugs.dragonflybsd.org/issues/3282#change-14836
>
>* Author: bhaible
>* Status: In Progress
>* Priority: Normal
>* Category: Kernel
>* Target version: 6.4
>* Start date: 2021-06-14
>----------------------------------------
>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>
>
>---Files--------------------------------
>sys.kern.vfs_nlookup.c.diff (6.7 KB)
>
>
More information about the Bugs
mailing list