[PATCH v2 2/2] landlock: Mention -1 return code on failure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Mention -1 return code on failure for landlock_add_rule(),
landlock_create_ruleset() and landlock_restrict_self().

Although it's a common rule to return -1 on error, it's better to be
explicit (as the other man pages are).

Fixes: a01d04a69 ("landlock_add_rule.2: Document new syscall")
Fixes: ca5163697 ("landlock_create_ruleset.2: Document new syscall")
Fixes: 3f7e4f808 ("landlock_restrict_self.2: Document new syscall")
Reviewed-by: Günther Noack <gnoack@xxxxxxxxxx>
Signed-off-by: Petr Vorel <pvorel@xxxxxxx>
---
changes v1->v2:
* s/the cause of //g

 man/man2/landlock_add_rule.2       | 4 ++++
 man/man2/landlock_create_ruleset.2 | 4 ++++
 man/man2/landlock_restrict_self.2  | 4 ++++
 3 files changed, 12 insertions(+)

diff --git a/man/man2/landlock_add_rule.2 b/man/man2/landlock_add_rule.2
index 4b95afb07..d4ae8f2f6 100644
--- a/man/man2/landlock_add_rule.2
+++ b/man/man2/landlock_add_rule.2
@@ -79,6 +79,10 @@ must be 0.
 On success,
 .BR landlock_add_rule ()
 returns 0.
+On error,
+\-1 is returned and
+.I errno
+is set to indicate the error.
 .SH ERRORS
 .BR landlock_add_rule ()
 can fail for the following reasons:
diff --git a/man/man2/landlock_create_ruleset.2 b/man/man2/landlock_create_ruleset.2
index e62a3f9b9..618d54f37 100644
--- a/man/man2/landlock_create_ruleset.2
+++ b/man/man2/landlock_create_ruleset.2
@@ -86,6 +86,10 @@ returns a new Landlock ruleset file descriptor,
 or a Landlock ABI version,
 according to
 .IR flags .
+On error,
+\-1 is returned and
+.I errno
+is set to indicate the error.
 .SH ERRORS
 .BR landlock_create_ruleset ()
 can fail for the following reasons:
diff --git a/man/man2/landlock_restrict_self.2 b/man/man2/landlock_restrict_self.2
index 43f15c932..d4e5e753c 100644
--- a/man/man2/landlock_restrict_self.2
+++ b/man/man2/landlock_restrict_self.2
@@ -72,6 +72,10 @@ must be 0.
 On success,
 .BR landlock_restrict_self ()
 returns 0.
+On error,
+\-1 is returned and
+.I errno
+is set to indicate the error.
 .SH ERRORS
 .BR landlock_restrict_self ()
 can fail for the following reasons:
-- 
2.45.2





[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux