Skip to contentSkip to conversation

ipc.2: Fix prototype parameter types

PATCH New Alejandro Colomar 2 participants 3 messages Feb 4, 2021 – Feb 9, 2021 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ipc.2: Fix prototype parameter types

.../linux$ grep_syscall ipc
ipc/syscall.c:110:
SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
unsigned long, third, void __user *, ptr, long, fifth)
ipc/syscall.c:205:
COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,

	u32, third, compat_uptr_t, ptr, u32, fifth)

include/linux/compat.h:874:
asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32); include/linux/syscalls.h:1221:
asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,

		unsigned long third, void __user *ptr, long fifth);

.../linux$

function grep_syscall()

{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}
---
 man2/ipc.2 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
man2/ipc.2 +2 -3
index 469185638..5cfa3df3e 100644
@@ -27,9 +27,8 @@
 ipc \- System V IPC system calls
 .SH SYNOPSIS
 .nf
-.BI "int ipc(unsigned int " call ", int " first ", int " second \
-", int " third ,
-.BI "        void *" ptr ", long " fifth );
+.BI "int ipc(unsigned int " call ", int " first ", unsigned long " second ,
+.BI "        unsigned long " third ", void *" ptr ", long " fifth );
 .fi
 .SH DESCRIPTION
 .BR ipc ()
Signature · 1 line
2.30.0
#1 lore raw

PATCH v2 1/1 ipc.2: Fix prototype parameter types

The types for some of the parameters are incorrect (different than the kernel). Fix them. Below are shown the types that the kernel uses.

......

.../linux$ grep_syscall ipc
ipc/syscall.c:110:
SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
unsigned long, third, void __user *, ptr, long, fifth)
ipc/syscall.c:205:
COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,

	u32, third, compat_uptr_t, ptr, u32, fifth)

include/linux/compat.h:874:
asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32); include/linux/syscalls.h:1221:
asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,

		unsigned long third, void __user *ptr, long fifth);

.../linux$

function grep_syscall()

{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}
---
 man2/ipc.2 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
man2/ipc.2 +2 -3
index 6589ffae6..a36e895a2 100644
@@ -27,9 +27,8 @@
 ipc \- System V IPC system calls
 .SH SYNOPSIS
 .nf
-.BI "int ipc(unsigned int " call ", int " first ", int " second \
-", int " third ,
-.BI "        void *" ptr ", long " fifth );
+.BI "int ipc(unsigned int " call ", int " first ", unsigned long " second ,
+.BI "        unsigned long " third ", void *" ptr ", long " fifth );
 .fi
 .PP
 .IR Note :
Signature · 1 line
2.30.0
#2 lore raw

Hi Alex,

Quoted 3 lines · Alejandro Colomar

The types for some of the parameters are incorrect (different than the kernel). Fix them. Below are shown the types that the kernel uses.

Thanks. Patch applied.

Cheers,

Michael

Quoted 58 lines

......

.../linux$ grep_syscall ipc
ipc/syscall.c:110:
SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second,
unsigned long, third, void __user *, ptr, long, fifth)
ipc/syscall.c:205:
COMPAT_SYSCALL_DEFINE6(ipc, u32, call, int, first, int, second,

	u32, third, compat_uptr_t, ptr, u32, fifth)

include/linux/compat.h:874:
asmlinkage long compat_sys_ipc(u32, int, int, u32, compat_uptr_t, u32); include/linux/syscalls.h:1221:
asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second,

		unsigned long third, void __user *ptr, long fifth);

.../linux$

function grep_syscall()

{
	if ! [ -v 1 ]; then
		>&2 echo "Usage: ${FUNCNAME[0]} <syscall>";
		return ${EX_USAGE};
	fi

	find * -type f \
	|grep '\.c$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^\w*SYSCALL_DEFINE.\(${1},.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';

	find * -type f \
	|grep '\.[ch]$' \
	|sort -V \
	|xargs pcregrep -Mn "(?s)^asmlinkage\s+[\w\s]+\**sys_${1}\s*\(.*?\)" \
	|sed -E 's/^[^:]+:[0-9]+:/&\n/';
}
---
 man2/ipc.2 | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
man2/ipc.2 +2 -3
index 6589ffae6..a36e895a2 100644
@@ -27,9 +27,8 @@
 ipc \- System V IPC system calls
 .SH SYNOPSIS
 .nf
-.BI "int ipc(unsigned int " call ", int " first ", int " second \
-", int " third ,
-.BI "        void *" ptr ", long " fifth );
+.BI "int ipc(unsigned int " call ", int " first ", unsigned long " second ,
+.BI "        unsigned long " third ", void *" ptr ", long " fifth );
 .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/