From c669e53c2a9dff9ffe42d22a8c9cd8344a7e8c2e Mon Sep 17 00:00:00 2001 From: deraadt Date: Sat, 14 Mar 2026 17:10:15 +0000 Subject: [PATCH] document __pledge_open; ok sthen beck guenther --- lib/libc/sys/open.2 | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/lib/libc/sys/open.2 b/lib/libc/sys/open.2 index 635caa979af..3ef5b0afeb3 100644 --- a/lib/libc/sys/open.2 +++ b/lib/libc/sys/open.2 @@ -1,4 +1,4 @@ -.\" $OpenBSD: open.2,v 1.52 2025/08/04 04:59:31 guenther Exp $ +.\" $OpenBSD: open.2,v 1.53 2026/03/14 17:10:15 deraadt Exp $ .\" $NetBSD: open.2,v 1.8 1995/02/27 12:35:14 cgd Exp $ .\" .\" Copyright (c) 1980, 1991, 1993 @@ -30,7 +30,7 @@ .\" .\" @(#)open.2 8.2 (Berkeley) 11/16/93 .\" -.Dd $Mdocdate: August 4 2025 $ +.Dd $Mdocdate: March 14 2026 $ .Dt OPEN 2 .Os .Sh NAME @@ -42,6 +42,8 @@ .Ft int .Fn open "const char *path" "int flags" ... .Ft int +.Fn __pledge_open "const char *path" "int flags" ... +.Ft int .Fn openat "int fd" "const char *path" "int flags" ... .Sh DESCRIPTION The file name specified by @@ -204,6 +206,18 @@ open simultaneously by one process. returns the current system limit. .Pp The +.Fn __pledge_open +function is equivalent to +.Fn open +except it is only called by specific libc internal functions to +indicate intent to the kernel. +The +.Fn __pledge_open +symbol is not exported, but will show up +.Xr kdump 1 +output. +.Pp +The .Fn openat function is equivalent to .Fn open