[patch] getsockopt.2: Corrected the RETURN VALUE

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
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
From 19ac3ce52c7935c8f0792836dc27e02a9f26359a Mon Sep 17 00:00:00 2001
From: Konstantin Shemyak <konstantin@xxxxxxxxxxx>
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


[Index of Archives]     [Kernel Documentation]     [Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux