summaryrefslogtreecommitdiff
path: root/ace
diff options
context:
space:
mode:
authorschmidt <douglascraigschmidt@users.noreply.github.com>1997-03-22 19:12:24 +0000
committerschmidt <douglascraigschmidt@users.noreply.github.com>1997-03-22 19:12:24 +0000
commite23366181cb87e4bbbb90c9fb15cf1ef41618f93 (patch)
tree8223fe34197cbcaf6cc056367109d59b91802b68 /ace
parent67058e37923cba59203be9b005a84082099ac0f0 (diff)
downloadATCD-e23366181cb87e4bbbb90c9fb15cf1ef41618f93.tar.gz
es
Diffstat (limited to 'ace')
-rw-r--r--ace/DEV_IO.cpp14
-rw-r--r--ace/FILE_IO.cpp16
-rw-r--r--ace/OS.cpp75
-rw-r--r--ace/SOCK_Dgram.cpp136
-rw-r--r--ace/SOCK_Dgram.h40
-rw-r--r--ace/SOCK_Dgram.i20
-rw-r--r--ace/SOCK_IO.cpp17
-rw-r--r--ace/SPIPE_Stream.cpp16
-rw-r--r--ace/config-hpux-10.x-g++.h8
9 files changed, 233 insertions, 109 deletions
diff --git a/ace/DEV_IO.cpp b/ace/DEV_IO.cpp
index afa9a947c04..ce855eb03b7 100644
--- a/ace/DEV_IO.cpp
+++ b/ace/DEV_IO.cpp
@@ -34,11 +34,10 @@ ACE_DEV_IO::send (size_t n, ...) const
ACE_TRACE ("ACE_DEV_IO::send");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -50,7 +49,7 @@ ACE_DEV_IO::send (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -70,11 +69,10 @@ ACE_DEV_IO::recv (size_t n, ...) const
ACE_TRACE ("ACE_DEV_IO::recv");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -86,7 +84,7 @@ ACE_DEV_IO::recv (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
diff --git a/ace/FILE_IO.cpp b/ace/FILE_IO.cpp
index 6f2c57fe50a..a02e38c656d 100644
--- a/ace/FILE_IO.cpp
+++ b/ace/FILE_IO.cpp
@@ -34,12 +34,10 @@ ACE_FILE_IO::send (size_t n, ...) const
ACE_TRACE ("ACE_FILE_IO::send");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
-
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -51,7 +49,7 @@ ACE_FILE_IO::send (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -71,12 +69,10 @@ ACE_FILE_IO::recv (size_t n, ...) const
ACE_TRACE ("ACE_FILE_IO::recv");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
-
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -88,7 +84,7 @@ ACE_FILE_IO::recv (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
diff --git a/ace/OS.cpp b/ace/OS.cpp
index b3d06d77211..1eb715e99a8 100644
--- a/ace/OS.cpp
+++ b/ace/OS.cpp
@@ -1987,43 +1987,88 @@ ACE_OS::fork_exec (char *argv[])
#if defined (ACE_NEEDS_WRITEV)
-// "Fake" writev for sites without it. Note that this is totally
-// broken for multi-threaded applications since the <send_n> calls are
-// not atomic...
+// "Fake" writev for sites without it. Note that this is thread-safe.
extern "C" int
-writev (ACE_HANDLE handle, ACE_WRITEV_TYPE *vp, int vpcount)
+writev (ACE_HANDLE handle, ACE_WRITEV_TYPE iov[], int n)
{
// ACE_TRACE ("::writev");
- int count;
+ size_t length = 0;
+ size_t i;
- for (count = 0; --vpcount >= 0; count += vp->iov_len, vp++)
- if (ACE::send_n (handle, vp->iov_base, vp->iov_len) < 0)
+ // Determine the total length of all the buffers in <iov>.
+ for (i = 0; i < n; i++)
+ if (iov[i].iov_len < 0)
return -1;
+ else
+ length += iov[i].iov_len;
- return count;
+ char *buf;
+
+#if defined (ACE_HAS_ALLOCA)
+ buf = (iovec *) alloca (length);
+#else
+ ACE_NEW_RETURN (buf, length, -1);
+#endif /* !defined (ACE_HAS_ALLOCA) */
+
+ char *ptr = buf;
+
+ for (i = 0; i < n; i++)
+ {
+ ACE_OS::memcpy (ptr, iov[i].iov_base, iov[i].iov_len);
+ ptr += iov[i].iov_len;
+ }
+
+ ssize_t result = ACE_SOCK_Dgram::send_n (handle, buf, length);
+#if !defined (ACE_HAS_ALLOCA)
+ delete [] buf;
+#endif /* !defined (ACE_HAS_ALLOCA) */
+ return result;
}
#endif /* ACE_NEEDS_WRITEV */
#if defined (ACE_NEEDS_READV)
-// "Fake" readv for sites without it. Note that this is totally
-// broken for multi-threaded applications since the <send_n> calls are
-// not atomic...
+// "Fake" readv for sites without it. Note that this is thread-safe.
extern "C" int
readv (ACE_HANDLE handle, struct iovec *vp, int vpcount)
{
// ACE_TRACE ("::readv");
- int count;
+ ssize_t length = 0;
+ size_t i;
- for (count = 0; --vpcount >= 0; count += vp->iov_len, vp++)
- if (ACE::recv_n (handle, vp->iov_base, vp->iov_len) < 0)
+ for (i = 0; i < n; i++)
+ if (iov[i].iov_len < 0)
return -1;
+ else
+ length += iov[i].iov_len;
+
+#if defined (ACE_HAS_ALLOCA)
+ buf = (iovec *) alloca (length);
+#else
+ ACE_NEW_RETURN (buf, length, -1);
+#endif /* !defined (ACE_HAS_ALLOCA) */
+
+ length = ACE_SOCK_Dgram::recv_n (buf, length);
+
+ if (length != -1)
+ {
+ char *ptr = buf;
+
+ for (i = 0; i < n; i++)
+ {
+ ACE_OS::memcpy (iov[i].iov_base, ptr, iov[i].iov_len);
+ ptr += iov[i].iov_len;
+ }
+ }
- return count;
+#if !defined (ACE_HAS_ALLOCA)
+ delete [] buf;
+#endif /* !defined (ACE_HAS_ALLOCA) */
+ return length;
}
#endif /* ACE_NEEDS_READV */
diff --git a/ace/SOCK_Dgram.cpp b/ace/SOCK_Dgram.cpp
index f8b1e07d813..d52b30d3063 100644
--- a/ace/SOCK_Dgram.cpp
+++ b/ace/SOCK_Dgram.cpp
@@ -4,6 +4,7 @@
#define ACE_BUILD_DLL
#include "ace/SOCK_Dgram.h"
+#include "ace/Synch.h"
ACE_ALLOC_HOOK_DEFINE(ACE_SOCK_Dgram)
@@ -28,18 +29,18 @@ ACE_SOCK_Dgram::recv (iovec *io_vec, ACE_Addr &addr, int flags) const
u_long inlen;
if (ACE_OS::ioctl (this->get_handle (),
- FIONREAD, (u_long *) &inlen) == -1)
+ FIONREAD, (u_long *) &inlen) == -1)
return -1;
else if (inlen > 0)
{
ACE_NEW_RETURN (io_vec->iov_base, char[inlen], -1);
io_vec->iov_len = ACE_OS::recvfrom (this->get_handle (),
- (char *) io_vec->iov_base,
- inlen,
- flags,
- (sockaddr *) saddr,
- &addr_len);
+ (char *) io_vec->iov_base,
+ inlen,
+ flags,
+ (sockaddr *) saddr,
+ &addr_len);
addr.set_size (addr_len);
return io_vec->iov_len;
}
@@ -67,10 +68,10 @@ ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, int protocol_family)
if (&local == &ACE_Addr::sap_any && protocol_family == PF_INET)
{
if (ACE::bind_port (this->get_handle ()) == -1)
- error = 1;
+ error = 1;
}
else if (ACE_OS::bind (this->get_handle (), (sockaddr *) local.get_addr (),
- local.get_size ()) == -1)
+ local.get_size ()) == -1)
error = 1;
if (error)
@@ -83,9 +84,9 @@ ACE_SOCK_Dgram::shared_open (const ACE_Addr &local, int protocol_family)
// datagram ``server''...
ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local,
- int protocol_family,
- int protocol,
- int reuse_addr)
+ int protocol_family,
+ int protocol,
+ int reuse_addr)
: ACE_SOCK (SOCK_DGRAM, protocol_family, protocol, reuse_addr)
{
ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram");
@@ -97,13 +98,13 @@ ACE_SOCK_Dgram::ACE_SOCK_Dgram (const ACE_Addr &local,
int
ACE_SOCK_Dgram::open (const ACE_Addr &local,
- int protocol_family,
- int protocol,
- int reuse_addr)
+ int protocol_family,
+ int protocol,
+ int reuse_addr)
{
ACE_TRACE ("ACE_SOCK_Dgram::open");
if (ACE_SOCK::open (SOCK_DGRAM, protocol_family,
- protocol, reuse_addr) == -1)
+ protocol, reuse_addr) == -1)
return -1;
else
return this->shared_open (local, protocol_family);
@@ -115,9 +116,9 @@ ACE_SOCK_Dgram::open (const ACE_Addr &local,
ssize_t
ACE_SOCK_Dgram::send (const iovec iov[],
- size_t n,
- const ACE_Addr &addr,
- int flags) const
+ size_t n,
+ const ACE_Addr &addr,
+ int flags) const
{
ACE_TRACE ("ACE_SOCK_Dgram::send");
msghdr send_msg;
@@ -140,9 +141,9 @@ ACE_SOCK_Dgram::send (const iovec iov[],
ssize_t
ACE_SOCK_Dgram::recv (iovec iov[],
- size_t n,
- ACE_Addr &addr,
- int flags) const
+ size_t n,
+ ACE_Addr &addr,
+ int flags) const
{
ACE_TRACE ("ACE_SOCK_Dgram::recv");
msghdr recv_msg;
@@ -159,9 +160,100 @@ ACE_SOCK_Dgram::recv (iovec iov[],
recv_msg.msg_accrightslen = 0;
ssize_t status = ACE_OS::recvmsg (this->get_handle (),
- &recv_msg, flags);
+ &recv_msg, flags);
addr.set_size (recv_msg.msg_namelen);
return status;
}
+#else /* ACE_HAS_MSG */
+
+// Send an iovec of size N to ADDR as a datagram (connectionless
+// version).
+
+ssize_t
+ACE_SOCK_Dgram::send (const iovec iov[],
+ size_t n,
+ const ACE_Addr &addr,
+ int flags) const
+{
+ ACE_TRACE ("ACE_SOCK_Dgram::send");
+
+ size_t length = 0;
+ size_t i;
+
+ // Determine the total length of all the buffers in <iov>.
+ for (i = 0; i < n; i++)
+ if (iov[i].iov_len < 0)
+ return -1;
+ else
+ length += iov[i].iov_len;
+
+ char *buf;
+
+#if defined (ACE_HAS_ALLOCA)
+ buf = (iovec *) alloca (length);
+#else
+ ACE_NEW_RETURN (buf, length, -1);
+#endif /* !defined (ACE_HAS_ALLOCA) */
+
+ char *ptr = buf;
+
+ for (i = 0; i < n; i++)
+ {
+ ACE_OS::memcpy (ptr, iov[i].iov_base, iov[i].iov_len);
+ ptr += iov[i].iov_len;
+ }
+
+ ssize_t result = ACE_SOCK_Dgram::send (buf, length, addr, flags);
+#if !defined (ACE_HAS_ALLOCA)
+ delete [] buf;
+#endif /* !defined (ACE_HAS_ALLOCA) */
+ return result;
+}
+
+// Recv an iovec of size N to ADDR as a datagram (connectionless
+// version).
+
+ssize_t
+ACE_SOCK_Dgram::recv (iovec iov[],
+ size_t n,
+ ACE_Addr &addr,
+ int flags) const
+{
+ ACE_TRACE ("ACE_SOCK_Dgram::recv");
+
+ ssize_t length = 0;
+ size_t i;
+
+ for (i = 0; i < n; i++)
+ if (iov[i].iov_len < 0)
+ return -1;
+ else
+ length += iov[i].iov_len;
+
+#if defined (ACE_HAS_ALLOCA)
+ buf = (iovec *) alloca (length);
+#else
+ ACE_NEW_RETURN (buf, length, -1);
+#endif /* !defined (ACE_HAS_ALLOCA) */
+
+ length = ACE_SOCK_Dgram::recv (buf, length, addr, flags);
+
+ if (length != -1)
+ {
+ char *ptr = buf;
+
+ for (i = 0; i < n; i++)
+ {
+ ACE_OS::memcpy (iov[i].iov_base, ptr, iov[i].iov_len);
+ ptr += iov[i].iov_len;
+ }
+ }
+
+#if !defined (ACE_HAS_ALLOCA)
+ delete [] buf;
+#endif /* !defined (ACE_HAS_ALLOCA) */
+ return length;
+}
+
#endif /* ACE_HAS_MSG */
diff --git a/ace/SOCK_Dgram.h b/ace/SOCK_Dgram.h
index 9a2f8aefce0..f754d8cb64c 100644
--- a/ace/SOCK_Dgram.h
+++ b/ace/SOCK_Dgram.h
@@ -31,28 +31,28 @@ public:
// Default constructor.
ACE_SOCK_Dgram (const ACE_Addr &local,
- int protocol_family = PF_INET,
- int protocol = 0,
- int reuse_addr = 0);
+ int protocol_family = PF_INET,
+ int protocol = 0,
+ int reuse_addr = 0);
// Initiate a socket dgram.
int open (const ACE_Addr &local,
- int protocol_family = PF_INET,
- int protocol = 0,
- int reuse_addr = 0);
+ int protocol_family = PF_INET,
+ int protocol = 0,
+ int reuse_addr = 0);
// Initiate a socket dgram.
// = Data transfer routines.
ssize_t send (const void *buf,
- size_t n,
- const ACE_Addr &addr,
- int flags = 0) const;
+ size_t n,
+ const ACE_Addr &addr,
+ int flags = 0) const;
// Send an <n> byte <buf> to the datagram socket (uses sendto(3)).
ssize_t recv (void *buf,
- size_t n,
- ACE_Addr &addr,
- int flags = 0) const;
+ size_t n,
+ ACE_Addr &addr,
+ int flags = 0) const;
// Receive an <n> byte <buf> from the datagram socket (uses
// recvfrom(3)).
@@ -63,21 +63,19 @@ public:
// returns the number of bytes read. The caller is responsible for
// deleting the member in the <iov_base> field of <io_vec>.
-#if defined (ACE_HAS_MSG)
ssize_t send (const iovec iov[],
- size_t n,
- const ACE_Addr &addr,
- int flags = 0) const;
+ size_t n,
+ const ACE_Addr &addr,
+ int flags = 0) const;
// Send an <iovec> of size <n> to the datagram socket (uses
// sendmsg(3)).
ssize_t recv (iovec iov[],
- size_t n,
- ACE_Addr &addr,
- int flags = 0) const;
+ size_t n,
+ ACE_Addr &addr,
+ int flags = 0) const;
// Recv an <iovec> of size <n> to the datagram socket (uses
// recvmsg(3)).
-#endif /* ACE_HAS_MSG */
void dump (void) const;
// Dump the state of an object.
@@ -87,7 +85,7 @@ public:
protected:
int shared_open (const ACE_Addr &local,
- int protocol_family);
+ int protocol_family);
// Open is shared by this and by <LSOCK_Dgram>.
private:
diff --git a/ace/SOCK_Dgram.i b/ace/SOCK_Dgram.i
index e88d3906f4c..37af897057c 100644
--- a/ace/SOCK_Dgram.i
+++ b/ace/SOCK_Dgram.i
@@ -11,7 +11,7 @@ ACE_SOCK_Dgram::ACE_SOCK_Dgram (void)
ACE_TRACE ("ACE_SOCK_Dgram::ACE_SOCK_Dgram");
}
-// Send an N byte datagram to ADDR (connectionless version).
+// <sendto> an N byte datagram to <addr> (connectionless version).
inline ssize_t
ACE_SOCK_Dgram::send (const void *buf,
@@ -21,12 +21,13 @@ ACE_SOCK_Dgram::send (const void *buf,
{
ACE_TRACE ("ACE_SOCK_Dgram::send");
sockaddr *saddr = (sockaddr *) addr.get_addr ();
- size_t len = addr.get_size ();
- return ACE_OS::sendto (this->get_handle (), (const char *) buf, n, flags,
- (struct sockaddr *) saddr, len);
+ size_t len = addr.get_size ();
+ return ACE_OS::sendto (this->get_handle (),
+ (const char *) buf, n, flags,
+ (struct sockaddr *) saddr, len);
}
-// Recv an n byte datagram to ADDR (connectionless version).
+// <recvfrom> an n byte datagram (connectionless version).
inline ssize_t
ACE_SOCK_Dgram::recv (void *buf,
@@ -35,11 +36,12 @@ ACE_SOCK_Dgram::recv (void *buf,
int flags) const
{
ACE_TRACE ("ACE_SOCK_Dgram::recv");
- sockaddr *saddr = (sockaddr *) addr.get_addr ();
- int addr_len = addr.get_size ();
+ sockaddr *saddr = (sockaddr *) addr.get_addr ();
+ int addr_len = addr.get_size ();
- ssize_t status = ACE_OS::recvfrom (this->get_handle (), (char *) buf, n, flags,
- (sockaddr *) saddr, &addr_len);
+ ssize_t status = ACE_OS::recvfrom (this->get_handle (),
+ (char *) buf, n, flags,
+ (sockaddr *) saddr, &addr_len);
addr.set_size (addr_len);
return status;
}
diff --git a/ace/SOCK_IO.cpp b/ace/SOCK_IO.cpp
index 2be8c8ce329..5a2e9090046 100644
--- a/ace/SOCK_IO.cpp
+++ b/ace/SOCK_IO.cpp
@@ -52,11 +52,10 @@ ACE_SOCK_IO::send (size_t n, ...) const
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -68,7 +67,7 @@ ACE_SOCK_IO::send (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -88,13 +87,11 @@ ACE_SOCK_IO::recv (size_t n, ...) const
ACE_TRACE ("ACE_SOCK_IO::recv");
va_list argp;
- size_t total_tuples = n / 2;
- ssize_t result;
+ size_t total_tuples = n / 2;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
-
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -106,7 +103,7 @@ ACE_SOCK_IO::recv (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
diff --git a/ace/SPIPE_Stream.cpp b/ace/SPIPE_Stream.cpp
index ab38d87e666..1a57c221e6e 100644
--- a/ace/SPIPE_Stream.cpp
+++ b/ace/SPIPE_Stream.cpp
@@ -30,12 +30,10 @@ ACE_SPIPE_Stream::send (size_t n, ...) const
ACE_TRACE ("ACE_SPIPE_Stream::send");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
-
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -47,7 +45,7 @@ ACE_SPIPE_Stream::send (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -67,12 +65,10 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const
ACE_TRACE ("ACE_SPIPE_Stream::recv");
va_list argp;
size_t total_tuples = n / 2;
- ssize_t result;
+ iovec *iovp;
#if defined (ACE_HAS_ALLOCA)
- iovec *iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
+ iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
#else
- iovec *iovp;
-
ACE_NEW_RETURN (iovp, iovec[total_tuples], -1);
#endif /* !defined (ACE_HAS_ALLOCA) */
@@ -84,7 +80,7 @@ ACE_SPIPE_Stream::recv (size_t n, ...) const
iovp[i].iov_len = va_arg (argp, int);
}
- result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
+ ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
#if !defined (ACE_HAS_ALLOCA)
delete [] iovp;
#endif /* !defined (ACE_HAS_ALLOCA) */
diff --git a/ace/config-hpux-10.x-g++.h b/ace/config-hpux-10.x-g++.h
index ab34959076d..5da70fc0bd3 100644
--- a/ace/config-hpux-10.x-g++.h
+++ b/ace/config-hpux-10.x-g++.h
@@ -82,10 +82,10 @@
#define ACE_HAS_GETRUSAGE
#define ACE_HAS_SIGINFO_T
-#define ACE_HAS_UCONTEXT_T
-
-// Platform uses int for select() rather than fd_set.
-// #define ACE_SELECT_USES_INT
+#define ACE_LACKS_UCONTEXT_T
+#define _CLOCKID_T
+#define ACE_SELECT_USES_INT
+#define ACE_LACKS_SI_ADDR
// Platform has the XLI version of ACE_TLI.
// #define ACE_HAS_XLI