[2/2] Add correct variable names for _POSIX_IPV6 and _POSIX_RAW_SOCKETS
diff mbox

Message ID 20140912111316.GA28404@spoyarek.pnq.redhat.com
State New
Headers show

Commit Message

Siddhesh Poyarekar Sept. 12, 2014, 11:13 a.m. UTC
getconf only recognizes IPV6 and RAW_SOCKETS, when the standard
requires it to recognize the actual configuration variable name[1].  I
have not removed the earlier names for compatibility.

	* posix/getconf.c (vars): Add _POSIX_IPV6 and
	_POSIX_RAW_SOCKETS.

[1] http://pubs.opengroup.org/onlinepubs/007904875/functions/sysconf.html
---
 posix/getconf.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Roland McGrath Sept. 12, 2014, 6:06 p.m. UTC | #1
That looks OK.  But we should consider as a cleanup removing all the
#ifdef's from getconf.c entirely.  All configurations use the same
bits/confname.h, so there is no actual variation being tested here.
I'm not sure that POSIX actually allows us any leeway to omit any of
the _SC_* or _PC_* symbols.  But even if it does, I can't really see
a reason why we'd want to let the GNU API vary that way.

Patch
diff mbox

diff --git a/posix/getconf.c b/posix/getconf.c
index db6acc4..c2c0d3f 100644
--- a/posix/getconf.c
+++ b/posix/getconf.c
@@ -1004,6 +1004,13 @@  static const struct conf vars[] =
     { "RAW_SOCKETS", _SC_RAW_SOCKETS, SYSCONF },
 #endif
 
+#ifdef _SC_IPV6
+    { "_POSIX_IPV6", _SC_IPV6, SYSCONF },
+#endif
+#ifdef _SC_RAW_SOCKETS
+    { "_POSIX_RAW_SOCKETS", _SC_RAW_SOCKETS, SYSCONF },
+#endif
+
     { NULL, 0, SYSCONF }
   };