git: c1d05b8292ab - stable/15 - Add O_SYMLINK emulation

From: Konstantin Belousov <kib_at_FreeBSD.org>
Date: Sat, 23 May 2026 07:13:47 UTC
The branch stable/15 has been updated by kib:

URL: https://cgit.FreeBSD.org/src/commit/?id=c1d05b8292ab5bcd02ddbf6d334eb62a568f8392

commit c1d05b8292ab5bcd02ddbf6d334eb62a568f8392
Author:     Konstantin Belousov <kib@FreeBSD.org>
AuthorDate: 2026-04-20 20:02:13 +0000
Commit:     Konstantin Belousov <kib@FreeBSD.org>
CommitDate: 2026-05-23 06:56:13 +0000

    Add O_SYMLINK emulation
    
    (cherry picked from commit 428da7d65b1c41c81a8786f66c1ce2f4242ac8bb)
---
 sys/sys/fcntl.h | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/sys/fcntl.h b/sys/sys/fcntl.h
index 0b13241f0ee3..80cbca4ea753 100644
--- a/sys/sys/fcntl.h
+++ b/sys/sys/fcntl.h
@@ -142,6 +142,13 @@ typedef	__pid_t		pid_t;
 #define	O_EMPTY_PATH	0x02000000
 #define	O_NAMEDATTR	0x04000000	/* NFSv4 named attributes */
 #define	O_XATTR		O_NAMEDATTR	/* Solaris compatibility */
+
+/*
+ * Emulate MacOSX compatibility flag without consuming a flags bit.
+ * It is not fully correct since reads over regular files opened with
+ * this definition fail.
+ */
+#define	O_SYMLINK	(O_PATH | O_NOFOLLOW)
 #endif
 
 #if __POSIX_VISIBLE >= 202405