Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 9 Feb 2026 16:14:00 +0100
From:      Lionel Cons <lionelcons1972@gmail.com>
To:        Freebsd hackers list <freebsd-hackers@freebsd.org>
Subject:   Re: Implementing O_SYMLINK in FreeBSD?
Message-ID:  <CAPJSo4Xvp4rx3jOJSQWNaF2OqO5aM7GqQcfcsJE3Nc36fE2qVA@mail.gmail.com>
In-Reply-To: <aYZuY2th1CXXAULX@kib.kiev.ua>
References:  <CAPJSo4VDAb5yPh%2BLV9qDgFPUisuTWk1DhB3boGPenrY3GJo2yQ@mail.gmail.com> <aYZuY2th1CXXAULX@kib.kiev.ua>

index | next in thread | previous in thread | raw e-mail

On Fri, 6 Feb 2026 at 23:43, Konstantin Belousov <kostikbel@gmail.com> wrote:
>
> On Fri, Feb 06, 2026 at 09:09:18PM +0100, Lionel Cons wrote:
> > Would it be possible to implement O_SYMLINK to open a symlink directly
> > in FreeBSD?
> What is the semantic, exactly?

O_SYMLINK opens the symlink itself, and not the file it is referring
to. If the name is not a symlink, the openat() will fail. This is
similar to Win32 FILE_FLAG_OPEN_REPARSE_POINT.

O_PATH is not much of an option, because the Linux definition is fuzzy
at best, basically "save path in fd, and append it to whatever is
used", which has gaping holes in terms of loopholes.
O_PATH is only there because Linux HATES POSIX and didn't want to
implement O_SEARCH.

Lionel


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAPJSo4Xvp4rx3jOJSQWNaF2OqO5aM7GqQcfcsJE3Nc36fE2qVA>