[v5,27/35] init_module.2: Use syscall(SYS_...); for system calls without a wrapper

Message ID 20210404115847.78166-28-alx.manpages@gmail.com
State New
Headers show
Series
  • Untitled series #36410
Related show

Commit Message

Martin Sebor via Libc-alpha April 4, 2021, 11:58 a.m.
Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

---
 man2/init_module.2 | 20 ++++++++------------
 1 file changed, 8 insertions(+), 12 deletions(-)

-- 
2.31.0

Comments

Martin Sebor via Libc-alpha April 5, 2021, 11:41 a.m. | #1
Hi Alex,

On 4/4/21 1:58 PM, Alejandro Colomar wrote:
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>

> ---

>  man2/init_module.2 | 20 ++++++++------------

>  1 file changed, 8 insertions(+), 12 deletions(-)



Patch applied.

Thanks,

Michael


> diff --git a/man2/init_module.2 b/man2/init_module.2

> index e158ce9fa..13d1b7f0a 100644

> --- a/man2/init_module.2

> +++ b/man2/init_module.2

> @@ -29,14 +29,15 @@

>  init_module, finit_module \- load a kernel module

>  .SH SYNOPSIS

>  .nf

> -.BI "int init_module(void *" module_image ", unsigned long " len ,

> -.BI "                const char *" param_values );

> -.BI "int finit_module(int " fd ", const char *" param_values ,

> -.BI "                 int " flags );

> -.fi

> +.BR "#include <linux/module.h>" "    /* Definition of " MODULE_* " constants */"

> +.BR "#include <sys/syscall.h>" "     /* Definition of " SYS_* " constants */"

> +.B #include <unistd.h>

>  .PP

> -.IR Note :

> -There are no glibc wrappers for these system calls; see NOTES.

> +.BI "int syscall(SYS_init_module, void *" module_image ", unsigned long " len ,

> +.BI "            const char *" param_values );

> +.BI "int syscall(SYS_finit_module, int " fd ", const char *" param_values ,

> +.BI "            int " flags );

> +.fi

>  .SH DESCRIPTION

>  .BR init_module ()

>  loads an ELF image into kernel space,

> @@ -268,11 +269,6 @@ manually declare the interface in your code;

>  alternatively, you can invoke the system call using

>  .BR syscall (2).

>  .PP

> -Glibc does not provide a wrapper for

> -.BR finit_module ();

> -call it using

> -.BR syscall (2).

> -.PP

>  Information about currently loaded modules can be found in

>  .IR /proc/modules

>  and in the file trees under the per-module subdirectories under

> 



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

Patch

diff --git a/man2/init_module.2 b/man2/init_module.2
index e158ce9fa..13d1b7f0a 100644
--- a/man2/init_module.2
+++ b/man2/init_module.2
@@ -29,14 +29,15 @@ 
 init_module, finit_module \- load a kernel module
 .SH SYNOPSIS
 .nf
-.BI "int init_module(void *" module_image ", unsigned long " len ,
-.BI "                const char *" param_values );
-.BI "int finit_module(int " fd ", const char *" param_values ,
-.BI "                 int " flags );
-.fi
+.BR "#include <linux/module.h>" "    /* Definition of " MODULE_* " constants */"
+.BR "#include <sys/syscall.h>" "     /* Definition of " SYS_* " constants */"
+.B #include <unistd.h>
 .PP
-.IR Note :
-There are no glibc wrappers for these system calls; see NOTES.
+.BI "int syscall(SYS_init_module, void *" module_image ", unsigned long " len ,
+.BI "            const char *" param_values );
+.BI "int syscall(SYS_finit_module, int " fd ", const char *" param_values ,
+.BI "            int " flags );
+.fi
 .SH DESCRIPTION
 .BR init_module ()
 loads an ELF image into kernel space,
@@ -268,11 +269,6 @@  manually declare the interface in your code;
 alternatively, you can invoke the system call using
 .BR syscall (2).
 .PP
-Glibc does not provide a wrapper for
-.BR finit_module ();
-call it using
-.BR syscall (2).
-.PP
 Information about currently loaded modules can be found in
 .IR /proc/modules
 and in the file trees under the per-module subdirectories under