tech-userlevel archive

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

[PATCH 5/6] setup _POSIX2_C_BIND constant



The SUSv3 requires to setup _POSIX2_C_BIND constant properly. However the
standard doesn't say anything about POSIX2_C_BIND. Actually we can use last as
alias to underscored version.
---
 lib/libc/gen/sysctl.c     |    2 +-
 sys/sys/unistd.h          |    2 ++
 usr.bin/getconf/getconf.c |    2 +-
 3 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/libc/gen/sysctl.c b/lib/libc/gen/sysctl.c
index 8e46cbf..8195e20 100644
--- a/lib/libc/gen/sysctl.c
+++ b/lib/libc/gen/sysctl.c
@@ -176,7 +176,7 @@ user_sysctl(name, namelen, oldp, oldlenp, newp, newlen)
                _INT("posix2_version", USER_POSIX2_VERSION, _POSIX2_VERSION,
                     "The version of POSIX 1003.2 with which the system "
                     "attempts to comply"),
-#ifdef POSIX2_C_BIND
+#ifdef _POSIX2_C_BIND
                _INT("posix2_c_bind", USER_POSIX2_C_BIND, 1,
                     "Whether the system's C-language development facilities "
                     "support the C-Language Bindings Option"),
diff --git a/sys/sys/unistd.h b/sys/sys/unistd.h
index 18a5237..b3f7c06 100644
--- a/sys/sys/unistd.h
+++ b/sys/sys/unistd.h
@@ -113,6 +113,8 @@
 #define        _POSIX_SHELL            1
                                /* regular expressions */
 #define        _POSIX_REGEXP           1
+                               /* C binding */
+#define        _POSIX2_C_BIND          200112L
 
 /* access function */
 #define        F_OK            0       /* test for existence of file */
diff --git a/usr.bin/getconf/getconf.c b/usr.bin/getconf/getconf.c
index 3a4241f..04ddfe3 100644
--- a/usr.bin/getconf/getconf.c
+++ b/usr.bin/getconf/getconf.c
@@ -100,7 +100,7 @@ static const struct conf_variable conf_table[] =
   { "RE_DUP_MAX",              SYSCONF,        _SC_RE_DUP_MAX          },
 
   /* Optional Facility Configuration Values */
-  { "POSIX2_C_BIND",           SYSCONF,        _SC_2_C_BIND            },
+  { "_POSIX2_C_BIND",          SYSCONF,        _SC_2_C_BIND            },
   { "POSIX2_C_DEV",            SYSCONF,        _SC_2_C_DEV             },
   { "POSIX2_CHAR_TERM",                SYSCONF,        _SC_2_CHAR_TERM         
},
   { "POSIX2_FORT_DEV",         SYSCONF,        _SC_2_FORT_DEV          },
-- 
1.5.2.5



Home | Main Index | Thread Index | Old Index