[RFC v3 05/17] capget.2: Use syscall(SYS_...); for system calls without a wrapper

From: Alejandro Colomar
Date: Sat Mar 13 2021 - 14:28:19 EST


Signed-off-by: Alejandro Colomar <alx.manpages@xxxxxxxxx>
---
man2/capget.2 | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/man2/capget.2 b/man2/capget.2
index ea504c28c..981645f90 100644
--- a/man2/capget.2
+++ b/man2/capget.2
@@ -18,14 +18,15 @@
capget, capset \- set/get capabilities of thread(s)
.SH SYNOPSIS
.nf
-.B #include <sys/capability.h>
+.BR "#include <linux/capability.h>" " /* Definition of types and constants */"
+.BR "#include <sys/syscall.h>" " /* Definition of " SYS_* " constants */"
+.B #include <unistd.h>
.PP
-.BI "int capget(cap_user_header_t " hdrp ", cap_user_data_t " datap );
-.BI "int capset(cap_user_header_t " hdrp ", const cap_user_data_t " datap );
+.BI "int syscall(SYS_capget, cap_user_header_t " hdrp ,
+.BI " cap_user_data_t " datap );
+.BI "int syscall(SYS_capset, cap_user_header_t " hdrp ,
+.BI " const cap_user_data_t " datap );
.fi
-.PP
-.IR Note :
-There are no glibc wrappers for these system calls; see NOTES.
.SH DESCRIPTION
These two system calls are the raw kernel interface for getting and
setting thread capabilities.
@@ -40,7 +41,7 @@ The portable interfaces are
.BR cap_set_proc (3)
and
.BR cap_get_proc (3);
-if possible, you should use those interfaces in applications.
+if possible, you should use those interfaces in applications; see NOTES.
.\"
.SS Current details
Now that you have been warned, some current kernel details.
@@ -239,9 +240,6 @@ No such thread.
.SH CONFORMING TO
These system calls are Linux-specific.
.SH NOTES
-Glibc does not provide a wrapper for this system call; call it using
-.BR syscall (2).
-.PP
The portable interface to the capability querying and setting
functions is provided by the
.I libcap
--
2.30.2