[15/39] keyctl.2: Use syscall(SYS_...); for system calls without a glibc wrapper

Message ID 20210510175546.28445-16-alx.manpages@gmail.com
State New
Headers show
Series
  • man2: SYNOPSIS: Fix headers, use syscall(), and other fixes
Related show

Commit Message

Carlos O'Donell via Libc-alpha May 10, 2021, 5:55 p.m.
Remove the libkeyutils prototype from the synopsis, which isn't
documented in the rest of the page, and as NOTES says, it's
probably better to use the various library functions.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man2/keyctl.2 | 17 +++++++----------
 1 file changed, 7 insertions(+), 10 deletions(-)

-- 
2.31.1

Patch

diff --git a/man2/keyctl.2 b/man2/keyctl.2
index 690781eea..7f5fcb951 100644
--- a/man2/keyctl.2
+++ b/man2/keyctl.2
@@ -30,22 +30,20 @@ 
 keyctl \- manipulate the kernel's key management facility
 .SH SYNOPSIS
 .nf
-.B #include <keyutils.h>
-.PP
-.BI "long keyctl(int " operation ", ...);"
-.PP
-.B "/* For direct call via syscall(2): */"
-.B #include <asm/unistd.h>
-.B #include <linux/keyctl.h>
+.BR "#include <linux/keyctl.h>" "     /* Definition of " KEY* " constants */"
+.BR "#include <sys/syscall.h>" "      /* Definition of " SYS_* " constants */"
 .B #include <unistd.h>
 .PP
-.BI "long syscall(__NR_keyctl, int " operation ", unsigned long " arg2 ,
+.BI "long syscall(SYS_keyctl, int " operation ", unsigned long " arg2 ,
 .BI "             unsigned long " arg3 ", unsigned long " arg4 ,
 .BI "             unsigned long " arg5 );
 .fi
 .PP
 .IR Note :
-There is no glibc wrapper for this system call; see NOTES.
+glibc provides no wrapper for
+.BR keyctl (),
+necessitating the use of
+.BR syscall (2).
 .SH DESCRIPTION
 .BR keyctl ()
 allows user-space programs to perform key manipulation.
@@ -1954,7 +1952,6 @@  This system call first appeared in Linux 2.6.10.
 .SH CONFORMING TO
 This system call is a nonstandard Linux extension.
 .SH NOTES
-Glibc does not provide a wrapper for this system call.
 A wrapper is provided in the
 .IR libkeyutils
 library.