Skip to contentSkip to conversation

delete_module.2: SYNOPSIS: Fix prototype parameter types

PATCH In review Alejandro Colomar 2 participants 2 messages Dec 30, 2020 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 delete_module.2: SYNOPSIS: Fix prototype parameter types

The Linux kernel uses 'unsigned int' instead of 'int' for the 'flags' parameter. As glibc provides no wrapper, use the same type the kernel uses.

......

$ syscall='delete_module';
$ find linux/ -type f -name '*.c' \
  |xargs pcregrep -Mn "(?s)^[\w_]*SYSCALL_DEFINE.\(${syscall},.*?\)";
linux/kernel/module.c:977:
SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
		unsigned int, flags)
---
 man2/delete_module.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/delete_module.2 +1 -1
index e63545d51..1030e9698 100644
@@ -27,7 +27,7 @@
 delete_module \- unload a kernel module
 .SH SYNOPSIS
 .nf
-.BI "int delete_module(const char *" name ", int " flags );
+.BI "int delete_module(const char *" name ", unsigned int " flags );
 .fi
 .PP
 .IR Note :
Signature · 1 line
2.29.2
#1 lore raw

Hi ALex,

Quoted 4 lines · Alejandro Colomar

The Linux kernel uses 'unsigned int' instead of 'int' for the 'flags' parameter. As glibc provides no wrapper, use the same type the kernel uses> ......

Quoted 8 lines
$ syscall='delete_module';
$ find linux/ -type f -name '*.c' \
  |xargs pcregrep -Mn "(?s)^[\w_]*SYSCALL_DEFINE.\(${syscall},.*?\)";
linux/kernel/module.c:977:
SYSCALL_DEFINE2(delete_module, const char __user *, name_user,
		unsigned int, flags)

Thanks. Patch applied.

Cheers,

Michael

Quoted 18 lines
---
 man2/delete_module.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
man2/delete_module.2 +1 -1
index e63545d51..1030e9698 100644
@@ -27,7 +27,7 @@
 delete_module \- unload a kernel module
 .SH SYNOPSIS
 .nf
-.BI "int delete_module(const char *" name ", int " flags );
+.BI "int delete_module(const char *" name ", unsigned int " flags );
 .fi
 .PP
 .IR Note :
Signature · 3 lines
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/