From a9db6c1ba3817c79f3f9f74976ffe17f8b2df1c2 Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Thu, 12 Aug 2021 02:47:23 +0200 Subject: [PATCH] open.2: Clarify that openat()'s dirfd must be opened with O_RDONLY or O_PATH Signed-off-by: Michael Kerrisk --- man2/open.2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/man2/open.2 b/man2/open.2 index a4f774b2c..711fd96b8 100644 --- a/man2/open.2 +++ b/man2/open.2 @@ -959,6 +959,13 @@ referred to by the file descriptor the calling process, as is done by .BR open () for a relative pathname). +In this case, +.I dirfd +must be a directory that was opened for reading +.RB ( O_RDONLY ) +or using the +.B O_PATH +flag. .\" .SS openat2(2) The