From 0db324e2e5d9d3347ea0e93138372fb65aac09e6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 21:41:09 +0200 Subject: Merging upstream version 6.7. Signed-off-by: Daniel Baumann --- man2/fanotify_mark.2 | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'man2/fanotify_mark.2') diff --git a/man2/fanotify_mark.2 b/man2/fanotify_mark.2 index d1f7eec..c942b0b 100644 --- a/man2/fanotify_mark.2 +++ b/man2/fanotify_mark.2 @@ -1,7 +1,7 @@ .\" Copyright (C) 2013, Heinrich Schuchardt .\" .\" SPDX-License-Identifier: Linux-man-pages-copyleft -.TH fanotify_mark 2 2023-03-30 "Linux man-pages 6.05.01" +.TH fanotify_mark 2 2023-10-31 "Linux man-pages 6.7" .SH NAME fanotify_mark \- add, remove, or modify an fanotify mark on a filesystem object @@ -11,7 +11,7 @@ Standard C library .SH SYNOPSIS .nf .B #include -.PP +.P .BI "int fanotify_mark(int " fanotify_fd ", unsigned int " flags , .BI " uint64_t " mask ", int " dirfd , .BI " const char *_Nullable " pathname ); @@ -19,17 +19,17 @@ Standard C library .SH DESCRIPTION For an overview of the fanotify API, see .BR fanotify (7). -.PP +.P .BR fanotify_mark () adds, removes, or modifies an fanotify mark on a filesystem object. The caller must have read permission on the filesystem object that is to be marked. -.PP +.P The .I fanotify_fd argument is a file descriptor returned by .BR fanotify_init (2). -.PP +.P .I flags is a bit mask describing the modification to perform. It must include exactly one of the following values: @@ -74,11 +74,11 @@ can be used in conjunction with .BR FAN_MARK_FLUSH . .I mask is ignored. -.PP +.P If none of the values above is specified, or more than one is specified, the call fails with the error .BR EINVAL . -.PP +.P In addition, zero or more of the following values may be ORed into .IR flags : @@ -311,7 +311,7 @@ and if it is not, the listener sets a mark with an ignore mask on the directory. Evictable inode marks allow using this method for a large number of directories without the concern of pinning all inodes and exhausting the system's memory. -.PP +.P .I mask defines which events shall be listened for (or which shall be ignored). It is a bit mask composed of the following values: @@ -486,7 +486,7 @@ and are not generated for children of marked directories. To monitor complete directory trees it is necessary to mark the relevant mount or filesystem. -.PP +.P The following composed values are defined: .TP .B FAN_CLOSE @@ -496,7 +496,7 @@ A file is closed .B FAN_MOVE A file or directory has been moved .RB ( FAN_MOVED_FROM | FAN_MOVED_TO ). -.PP +.P The filesystem object to be marked is determined by the file descriptor .I dirfd and the pathname specified in @@ -743,10 +743,17 @@ do not specify a directory. .B EOPNOTSUPP The object indicated by .I pathname -is associated with a filesystem that does not support the encoding of file -handles. +is associated with a filesystem +that does not support the encoding of file handles. This error can be returned only with an fanotify group that identifies filesystem objects by file handles. +Calling +.BR name_to_handle_at (2) +with the flag +.BR AT_HANDLE_FID " (since Linux 6.5)" +.\" commit 96b2b072ee62be8ae68c8ecf14854c4d0505a8f8 +can be used as a test +to check if a filesystem supports reporting events with file handles. .TP .B EPERM The operation is not permitted because the caller lacks a required capability. @@ -784,28 +791,28 @@ or .BR uselib (2). Events of these types will not be raised in the situation where an interpreter is passed (or reads) a file for interpretation. -.PP +.P Additionally, if a mark has also been placed on the Linux dynamic linker, a user should also expect to receive an event for it when an ELF object has been successfully opened using .BR execve (2) or .BR execveat (2). -.PP +.P For example, if the following ELF binary were to be invoked and a .B FAN_OPEN_EXEC mark has been placed on /: -.PP +.P .in +4n .EX $ /bin/echo foo .EE .in -.PP +.P The listening application in this case would receive .B FAN_OPEN_EXEC events for both the ELF binary and interpreter, respectively: -.PP +.P .in +4n .EX /bin/echo -- cgit v1.2.3