All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] getsockopt.2: Corrected the RETURN VALUE
@ 2015-02-20 14:22 Konstantin Shemyak
       [not found] ` <54ed8560054c044dac40e28887da7b7a-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Shemyak @ 2015-02-20 14:22 UTC (permalink / raw)
  To: mtk.manpages-Re5JQEeQqe8AvxtiuMwx3w
  Cc: linux-man-u79uwXL29TY76Z2rM5mHXA, Pavel Emelyanov

[-- Attachment #1: Type: text/plain, Size: 1277 bytes --]

Hello,

An almost trivial patch - but does not fit in any "XXXfix" categories.
'man setsockopt' tells that the return value in case of success is 0.
But since at least 2007, setsockopt() calls the registered handler of
the corresponding option, and returns the result of that call.

Patch is made against master as of 20 Feb. 2015 (commit 35800487b675),
both inline below and attached.

Konstantin Shemyak.

 From 19ac3ce52c7935c8f0792836dc27e02a9f26359a Mon Sep 17 00:00:00 2001
 From: Konstantin Shemyak <konstantin-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org>
Date: Fri, 20 Feb 2015 15:59:19 +0200
Subject: [PATCH] Corrected RETURN VALUE for getsockopt/setsockopt(2)

---
  man2/getsockopt.2 | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man2/getsockopt.2 b/man2/getsockopt.2
index 1287efc..1c78fdc 100644
--- a/man2/getsockopt.2
+++ b/man2/getsockopt.2
@@ -129,7 +129,10 @@ For a description of the available socket options 
see
  .BR socket (7)
  and the appropriate protocol man pages.
  .SH RETURN VALUE
-On success, zero is returned.
+On success, the return value from the corresponding option handler
+previously registered by
+.I nf_register_sockopt()
+is returned.
  On error, \-1 is returned, and
  .I errno
  is set appropriately.
-- 
1.9.1

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Corrected-RETURN-VALUE-for-getsockopt-setsockopt-2.patch --]
[-- Type: text/x-patch; name=0001-Corrected-RETURN-VALUE-for-getsockopt-setsockopt-2.patch, Size: 831 bytes --]

From 19ac3ce52c7935c8f0792836dc27e02a9f26359a Mon Sep 17 00:00:00 2001
From: Konstantin Shemyak <konstantin@shemyak.com>
Date: Fri, 20 Feb 2015 15:59:19 +0200
Subject: [PATCH] Corrected RETURN VALUE for getsockopt/setsockopt(2)

---
 man2/getsockopt.2 | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/man2/getsockopt.2 b/man2/getsockopt.2
index 1287efc..1c78fdc 100644
--- a/man2/getsockopt.2
+++ b/man2/getsockopt.2
@@ -129,7 +129,10 @@ For a description of the available socket options see
 .BR socket (7)
 and the appropriate protocol man pages.
 .SH RETURN VALUE
-On success, zero is returned.
+On success, the return value from the corresponding option handler
+previously registered by
+.I nf_register_sockopt()
+is returned.
 On error, \-1 is returned, and
 .I errno
 is set appropriately.
-- 
1.9.1


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

* Re: [patch] getsockopt.2: Corrected the RETURN VALUE
       [not found] ` <54ed8560054c044dac40e28887da7b7a-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org>
@ 2015-02-20 14:32   ` Michael Kerrisk (man-pages)
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Kerrisk (man-pages) @ 2015-02-20 14:32 UTC (permalink / raw)
  To: Konstantin Shemyak; +Cc: linux-man, Pavel Emelyanov

On 20 February 2015 at 15:22, Konstantin Shemyak <konstantin-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org> wrote:
> Hello,
>
> An almost trivial patch - but does not fit in any "XXXfix" categories.
> 'man setsockopt' tells that the return value in case of success is 0.
> But since at least 2007, setsockopt() calls the registered handler of
> the corresponding option, and returns the result of that call.
>
> Patch is made against master as of 20 Feb. 2015 (commit 35800487b675),
> both inline below and attached.

Hello Konstantin,

Sorry -- I cannot make sense of this patch.

* It seems netfilter-specific
* The man page then conveys less information than before.
  (The reader asks: "what is nf_register_sockopt()?")
* Are you saying there are case where successful
  setsockopt() via nf_register_sockopt() might return a
  value other zero?

Can you elaborate?

Thanks,

Michael

> From 19ac3ce52c7935c8f0792836dc27e02a9f26359a Mon Sep 17 00:00:00 2001
> From: Konstantin Shemyak <konstantin-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org>
> Date: Fri, 20 Feb 2015 15:59:19 +0200
> Subject: [PATCH] Corrected RETURN VALUE for getsockopt/setsockopt(2)
>
> ---
>  man2/getsockopt.2 | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/man2/getsockopt.2 b/man2/getsockopt.2
> index 1287efc..1c78fdc 100644
> --- a/man2/getsockopt.2
> +++ b/man2/getsockopt.2
> @@ -129,7 +129,10 @@ For a description of the available socket options see
>  .BR socket (7)
>  and the appropriate protocol man pages.
>  .SH RETURN VALUE
> -On success, zero is returned.
> +On success, the return value from the corresponding option handler
> +previously registered by
> +.I nf_register_sockopt()
> +is returned.
>  On error, \-1 is returned, and
>  .I errno
>  is set appropriately.
> --
> 1.9.1



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

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

end of thread, other threads:[~2015-02-20 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-20 14:22 [patch] getsockopt.2: Corrected the RETURN VALUE Konstantin Shemyak
     [not found] ` <54ed8560054c044dac40e28887da7b7a-gSWgoXPz5bhBDgjK7y7TUQ@public.gmane.org>
2015-02-20 14:32   ` 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.