All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] subpage_prot.2: SYNOPSIS: Fix return type: s/long/int/
@ 2020-11-27 23:44 Alejandro Colomar
  2020-11-28  8:56 ` Michael Kerrisk (man-pages)
  0 siblings, 1 reply; 2+ messages in thread
From: Alejandro Colomar @ 2020-11-27 23:44 UTC (permalink / raw)
  To: mtk.manpages; +Cc: Alejandro Colomar, linux-man, linux-kernel

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

......

$ grep -n wrapper man-pages/man2/subpage_prot.2
40:There is no glibc wrapper for this system call; see NOTES.
99:Glibc does not provide a wrapper for this system call; call it using

$ grep -rn SYSCALL_DEFINE.*subpage_prot linux/;
linux/arch/powerpc/mm/book3s64/subpage_prot.c:190:
SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,

$ sed -n /SYSCALL.*subpage_prot/,/^}/p \
  linux/arch/powerpc/mm/book3s64/subpage_prot.c \
  |grep return;
		return -ENOENT;
		return -EINVAL;
		return -EINVAL;
		return 0;
		return -EFAULT;
			return -EFAULT;
	return err;

$ sed -n /SYSCALL.*subpage_prot/,/^}/p \
  linux/arch/powerpc/mm/book3s64/subpage_prot.c \
  |grep '\<err\>';
	int err;
			err = -ENOMEM;
		err = -ENOMEM;
	err = 0;
	return err;

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
---
 man2/subpage_prot.2 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/man2/subpage_prot.2 b/man2/subpage_prot.2
index b38ba718f..d6f016665 100644
--- a/man2/subpage_prot.2
+++ b/man2/subpage_prot.2
@@ -32,7 +32,7 @@
 subpage_prot \- define a subpage protection for an address range
 .SH SYNOPSIS
 .nf
-.BI "long subpage_prot(unsigned long " addr ", unsigned long " len ,
+.BI "int subpage_prot(unsigned long " addr ", unsigned long " len ,
 .BI "                  uint32_t *" map );
 .fi
 .PP
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] subpage_prot.2: SYNOPSIS: Fix return type: s/long/int/
  2020-11-27 23:44 [PATCH] subpage_prot.2: SYNOPSIS: Fix return type: s/long/int/ Alejandro Colomar
@ 2020-11-28  8:56 ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2020-11-28  8:56 UTC (permalink / raw)
  To: Alejandro Colomar; +Cc: mtk.manpages, linux-man, linux-kernel

Hi Alex,

On 11/28/20 12:44 AM, Alejandro Colomar wrote:
> The Linux kernel uses 'int' instead of 'long' for the return type.
> As glibc provides no wrapper, use the same type the kernel uses.

Thanks. Patch applied.

Cheers,

Michael

> ......
> 
> $ grep -n wrapper man-pages/man2/subpage_prot.2
> 40:There is no glibc wrapper for this system call; see NOTES.
> 99:Glibc does not provide a wrapper for this system call; call it using
> 
> $ grep -rn SYSCALL_DEFINE.*subpage_prot linux/;
> linux/arch/powerpc/mm/book3s64/subpage_prot.c:190:
> SYSCALL_DEFINE3(subpage_prot, unsigned long, addr,
> 
> $ sed -n /SYSCALL.*subpage_prot/,/^}/p \
>   linux/arch/powerpc/mm/book3s64/subpage_prot.c \
>   |grep return;
> 		return -ENOENT;
> 		return -EINVAL;
> 		return -EINVAL;
> 		return 0;
> 		return -EFAULT;
> 			return -EFAULT;
> 	return err;
> 
> $ sed -n /SYSCALL.*subpage_prot/,/^}/p \
>   linux/arch/powerpc/mm/book3s64/subpage_prot.c \
>   |grep '\<err\>';
> 	int err;
> 			err = -ENOMEM;
> 		err = -ENOMEM;
> 	err = 0;
> 	return err;
> 
> Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
> ---
>  man2/subpage_prot.2 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/man2/subpage_prot.2 b/man2/subpage_prot.2
> index b38ba718f..d6f016665 100644
> --- a/man2/subpage_prot.2
> +++ b/man2/subpage_prot.2
> @@ -32,7 +32,7 @@
>  subpage_prot \- define a subpage protection for an address range
>  .SH SYNOPSIS
>  .nf
> -.BI "long subpage_prot(unsigned long " addr ", unsigned long " len ,
> +.BI "int subpage_prot(unsigned long " addr ", unsigned long " len ,
>  .BI "                  uint32_t *" map );
>  .fi
>  .PP
> 


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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-28 21:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-27 23:44 [PATCH] subpage_prot.2: SYNOPSIS: Fix return type: s/long/int/ Alejandro Colomar
2020-11-28  8:56 ` Michael Kerrisk (man-pages)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.