summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-14 01:23:13 +0000
committerjtc <jtc@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2004-09-14 01:23:13 +0000
commit10ee28fc92ee72441f40222bf21348575abdf66a (patch)
treea021c8f05bb8e47a8b0c4042277a6228af41a652
parentcb73b075e6f4b0144d972caa863ee76f88c6a61e (diff)
downloadATCD-10ee28fc92ee72441f40222bf21348575abdf66a.tar.gz
ChangeLogTag: Mon Sep 13 18:15:44 2004 J.T. Conklin <jtc@acorntoolworks.com>
-rw-r--r--ChangeLog21
-rw-r--r--ace/OS_NS_stropts.h6
-rw-r--r--ace/OS_NS_stropts.inl2
-rw-r--r--ace/config-netbsd.h1
-rw-r--r--m4/platform.m428
5 files changed, 54 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2c48f314143..3580e9c6612 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+Mon Sep 13 18:15:44 2004 J.T. Conklin <jtc@acorntoolworks.com>
+
+ * ACE_wrappers/m4/platform.m4:
+
+ Added new ACE_FUNC_IOCTL_ARGTYPES macro, used to set
+ ACE_IOCTL_TYPE_ARG2.
+
+ * ACE_wrappers/ace/config-netbsd.h:
+
+ Added ACE_IOCTL_TYPE_ARG2 definition.
+
+ * ACE_wrappers/ace/OS_NS_stropts.h:
+ * ACE_wrappers/ace/OS_NS_stropts.inl:
+
+ Added feature test macro ACE_IOCTL_TYPE_ARG2 (which defaults to
+ int) so that ACE_OS::ioctl uses the same type as ::ioctl. This
+ help avoid sign extension problems on 64 bit platforms that use
+ unsigned long.
+
Mon Sep 13 15:52:04 2004 Dale Wilson <wilson_d@ociweb.com>
* ace/OS_NS_Thread.h:
@@ -11,8 +30,6 @@ Mon Sep 13 15:52:04 2004 Dale Wilson <wilson_d@ociweb.com>
the ACE_TSS<X> (if any) is deleted
which ever comes *last*.
-
-
Mon Sep 13 14:56:53 2004 Balachandran Natarajan <bala@dre.vanderbilt.edu>
* ace/RB_Tree.h (class ACE_RB_Tree):
diff --git a/ace/OS_NS_stropts.h b/ace/OS_NS_stropts.h
index cb585ae685a..9b1f6fc2f56 100644
--- a/ace/OS_NS_stropts.h
+++ b/ace/OS_NS_stropts.h
@@ -25,6 +25,10 @@
# pragma once
# endif /* ACE_LACKS_PRAGMA_ONCE */
+# ifndef ACE_IOCTL_TYPE_ARG2
+# define ACE_IOCTL_TYPE_ARG2 int
+# endif
+
#include "ace/os_include/os_stropts.h"
#include "ace/os_include/os_stdio.h"
#include "ace/ACE_export.h"
@@ -105,7 +109,7 @@ namespace ACE_OS {
/// UNIX-style <ioctl>.
ACE_NAMESPACE_INLINE_FUNCTION
int ioctl (ACE_HANDLE handle,
- int cmd,
+ ACE_IOCTL_TYPE_ARG2 cmd,
void * = 0);
/// QoS-enabled <ioctl>.
diff --git a/ace/OS_NS_stropts.inl b/ace/OS_NS_stropts.inl
index 1e33d9d59d9..6b963ec6e63 100644
--- a/ace/OS_NS_stropts.inl
+++ b/ace/OS_NS_stropts.inl
@@ -103,7 +103,7 @@ ACE_OS::fdetach (const char *file)
ACE_INLINE int
ACE_OS::ioctl (ACE_HANDLE handle,
- int cmd,
+ ACE_IOCTL_TYPE_ARG2 cmd,
void *val)
{
ACE_OS_TRACE ("ACE_OS::ioctl");
diff --git a/ace/config-netbsd.h b/ace/config-netbsd.h
index 30366dfc4ab..3e2b76af37e 100644
--- a/ace/config-netbsd.h
+++ b/ace/config-netbsd.h
@@ -84,6 +84,7 @@
#define ACE_HAS_WCHAR 1
#define ACE_HAS_WORKING_EXPLICIT_TEMPLATE_DESTRUCTOR 1
#define ACE_HAS_XPG4_MULTIBYTE_CHAR 1
+#define ACE_IOCTL_TYPE_ARG2 u_long
#define ACE_LACKS_CONDATTR_PSHARED 1
#define ACE_LACKS_GETHOSTENT 1
#define ACE_LACKS_IOSTREAM_FX 1
diff --git a/m4/platform.m4 b/m4/platform.m4
index c3cdf1cc9ef..c0e477f5695 100644
--- a/m4/platform.m4
+++ b/m4/platform.m4
@@ -345,6 +345,8 @@ dnl AC_DEFINE(ACE_USE_SELECT_REACTOR_FOR_REACTOR_IMPL)
;;
esac
+ACE_FUNC_IOCTL_ARGTYPES
+
ACE_CHECK_FORMAT_SPECIFIERS
ACE_CHECK_LACKS_PERFECT_MULTICAST_FILTERING
@@ -421,6 +423,32 @@ fi
])
+# ACE_FUNC_IOCTL_ARGTYPES
+#
+# Determine the correct type to be passed to ioctl's second argument and
+# define the types in ACE_IOCTL_TYPE_ARG2.
+#
+# FIXME: Should we support ioctl's third argument as well...?
+#
+# FIXME: Is it possible to write a portable feature test, or is checking
+# the the target OS the best we can do?
+#
+#---------------------------------------------------------------------------
+AC_DEFUN([ACE_FUNC_IOCTL_ARGTYPES],
+[AC_CACHE_CHECK([types of arguments for ioctl()],
+ [ace_cv_func_ioctl_arg2],
+ [case "$target_os" in
+ darwin* | freebsd* | netbsd* | openbsd*)
+ ace_cv_func_ioctl_arg2="unsigned long" ;;
+ *)
+ ace_cv_func_ioctl_arg2="int" ;;
+ esac])
+
+AC_DEFINE_UNQUOTED(ACE_IOCTL_TYPE_ARG2, $ace_cv_func_ioctl_arg2,
+ [Define to the type of arg 2 for `ioctl'.])
+])
+
+
# ACE_VAR_TIMEZONE
#
# Checks whether platform has global "timezone" variable.