summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohnny Willemsen <jwillemsen@remedy.nl>2005-09-01 09:25:24 +0000
committerJohnny Willemsen <jwillemsen@remedy.nl>2005-09-01 09:25:24 +0000
commit591bd7b86d918e3f875535b124a2627a82d81f01 (patch)
tree5d5390c7c1eefd531377dceef7e610853f1bdbd1
parentb0c2b9c1bd8a0628e24d95a221567ee2d6d051df (diff)
downloadATCD-591bd7b86d918e3f875535b124a2627a82d81f01.tar.gz
ChangeLogTag: Thu Sep 1 08:46:12 UTC 2005 Johnny Willemsen <jwillemsen@remedy.nl>
-rw-r--r--ace/OS_NS_sys_socket.h88
-rw-r--r--ace/OS_NS_sys_socket.inl56
-rw-r--r--ace/OS_NS_unistd.inl3
3 files changed, 74 insertions, 73 deletions
diff --git a/ace/OS_NS_sys_socket.h b/ace/OS_NS_sys_socket.h
index a24e2a84759..c984c30758a 100644
--- a/ace/OS_NS_sys_socket.h
+++ b/ace/OS_NS_sys_socket.h
@@ -155,34 +155,34 @@ namespace ACE_OS {
int backlog);
ACE_NAMESPACE_INLINE_FUNCTION
- int recv (ACE_HANDLE handle,
- char *buf,
- size_t len,
- int flags = 0);
-
- ACE_NAMESPACE_INLINE_FUNCTION
- int recvfrom (ACE_HANDLE handle,
+ ssize_t recv (ACE_HANDLE handle,
char *buf,
size_t len,
- int flags,
- struct sockaddr *addr,
- int *addrlen);
+ int flags = 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int recvfrom (ACE_HANDLE handle,
- iovec *buffers,
- int buffer_count,
- size_t &number_of_bytes_recvd,
- int &flags,
- struct sockaddr *addr,
- int *addrlen,
- ACE_OVERLAPPED *overlapped,
- ACE_OVERLAPPED_COMPLETION_FUNC func);
+ ssize_t recvfrom (ACE_HANDLE handle,
+ char *buf,
+ size_t len,
+ int flags,
+ struct sockaddr *addr,
+ int *addrlen);
ACE_NAMESPACE_INLINE_FUNCTION
- int recvmsg (ACE_HANDLE handle,
- struct msghdr *msg,
- int flags);
+ ssize_t recvfrom (ACE_HANDLE handle,
+ iovec *buffers,
+ int buffer_count,
+ size_t &number_of_bytes_recvd,
+ int &flags,
+ struct sockaddr *addr,
+ int *addrlen,
+ ACE_OVERLAPPED *overlapped,
+ ACE_OVERLAPPED_COMPLETION_FUNC func);
+
+ ACE_NAMESPACE_INLINE_FUNCTION
+ ssize_t recvmsg (ACE_HANDLE handle,
+ struct msghdr *msg,
+ int flags);
ACE_NAMESPACE_INLINE_FUNCTION
ssize_t recvv (ACE_HANDLE handle,
@@ -190,34 +190,34 @@ namespace ACE_OS {
int iovlen);
ACE_NAMESPACE_INLINE_FUNCTION
- int send (ACE_HANDLE handle,
- const char *buf,
- size_t len,
- int flags = 0);
+ ssize_t send (ACE_HANDLE handle,
+ const char *buf,
+ size_t len,
+ int flags = 0);
ACE_NAMESPACE_INLINE_FUNCTION
- int sendmsg (ACE_HANDLE handle,
- const struct msghdr *msg,
- int flags);
+ ssize_t sendmsg (ACE_HANDLE handle,
+ const struct msghdr *msg,
+ int flags);
ACE_NAMESPACE_INLINE_FUNCTION
- int sendto (ACE_HANDLE handle,
- const char *buf,
- size_t len,
- int flags,
- const struct sockaddr *addr,
- int addrlen);
+ ssize_t sendto (ACE_HANDLE handle,
+ const char *buf,
+ size_t len,
+ int flags,
+ const struct sockaddr *addr,
+ int addrlen);
ACE_NAMESPACE_INLINE_FUNCTION
- int sendto (ACE_HANDLE handle,
- const iovec *buffers,
- int buffer_count,
- size_t &number_of_bytes_sent,
- int flags,
- const struct sockaddr *addr,
- int addrlen,
- ACE_OVERLAPPED *overlapped,
- ACE_OVERLAPPED_COMPLETION_FUNC func);
+ ssize_t sendto (ACE_HANDLE handle,
+ const iovec *buffers,
+ int buffer_count,
+ size_t &number_of_bytes_sent,
+ int flags,
+ const struct sockaddr *addr,
+ int addrlen,
+ ACE_OVERLAPPED *overlapped,
+ ACE_OVERLAPPED_COMPLETION_FUNC func);
ACE_NAMESPACE_INLINE_FUNCTION
ssize_t sendv (ACE_HANDLE handle,
diff --git a/ace/OS_NS_sys_socket.inl b/ace/OS_NS_sys_socket.inl
index fa6f3a30153..801e6858d02 100644
--- a/ace/OS_NS_sys_socket.inl
+++ b/ace/OS_NS_sys_socket.inl
@@ -312,7 +312,7 @@ ACE_OS::listen (ACE_HANDLE handle, int backlog)
ACE_SOCKCALL_RETURN (::listen ((ACE_SOCKET) handle, backlog), int, -1);
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::recv (ACE_HANDLE handle, char *buf, size_t len, int flags)
{
ACE_OS_TRACE ("ACE_OS::recv");
@@ -328,9 +328,9 @@ ACE_OS::recv (ACE_HANDLE handle, char *buf, size_t len, int flags)
// can be used, as this is not an issue.
#if defined (ACE_WIN32)
ACE_SOCKCALL_RETURN (::recv ((ACE_SOCKET) handle, buf,
- static_cast<int> (len), flags), int, -1);
+ static_cast<int> (len), flags), ssize_t, -1);
#else
- int ace_result_;
+ ssize_t ace_result_;
ace_result_ = ::recv ((ACE_SOCKET) handle, buf, len, flags);
# if !(defined (EAGAIN) && defined (EWOULDBLOCK) && EAGAIN == EWOULDBLOCK)
@@ -353,7 +353,7 @@ ACE_OS::recv (ACE_HANDLE handle, char *buf, size_t len, int flags)
#endif /* defined (ACE_WIN32) */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::recvfrom (ACE_HANDLE handle,
char *buf,
size_t len,
@@ -366,11 +366,11 @@ ACE_OS::recvfrom (ACE_HANDLE handle,
# if !defined ACE_PSOS_DIAB_PPC
ACE_SOCKCALL_RETURN (::recvfrom ((ACE_SOCKET) handle, buf, len, flags,
(struct sockaddr_in *) addr, (ACE_SOCKET_LEN *) addrlen),
- int, -1);
+ ssize_t, -1);
# else
ACE_SOCKCALL_RETURN (::recvfrom ((ACE_SOCKET) handle, buf, len, flags,
(struct sockaddr *) addr, (ACE_SOCKET_LEN *) addrlen),
- int, -1);
+ ssize_t, -1);
# endif /* defined ACE_PSOS_DIAB_PPC */
#elif defined (ACE_WIN32)
int shortened_len = static_cast<int> (len);
@@ -394,11 +394,11 @@ ACE_OS::recvfrom (ACE_HANDLE handle,
#else /* non Win32 and non PSOS */
ACE_SOCKCALL_RETURN (::recvfrom ((ACE_SOCKET) handle, buf, len, flags,
addr, (ACE_SOCKET_LEN *) addrlen),
- int, -1);
+ ssize_t, -1);
#endif /* defined (ACE_PSOS) */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::recvfrom (ACE_HANDLE handle,
iovec *buffers,
int buffer_count,
@@ -443,7 +443,7 @@ ACE_OS::recvfrom (ACE_HANDLE handle,
#endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::recvmsg (ACE_HANDLE handle, struct msghdr *msg, int flags)
{
ACE_OS_TRACE ("ACE_OS::recvmsg");
@@ -469,7 +469,7 @@ ACE_OS::recvmsg (ACE_HANDLE handle, struct msghdr *msg, int flags)
else
return bytes_received;
# else /* ACE_HAS_WINSOCK2 */
- ACE_SOCKCALL_RETURN (::recvmsg (handle, msg, flags), int, -1);
+ ACE_SOCKCALL_RETURN (::recvmsg (handle, msg, flags), ssize_t, -1);
# endif /* ACE_HAS_WINSOCK2 */
#else
ACE_UNUSED_ARG (flags);
@@ -537,7 +537,7 @@ ACE_OS::recvv (ACE_HANDLE handle,
#endif /* ACE_HAS_WINSOCK2 */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::send (ACE_HANDLE handle, const char *buf, size_t len, int flags)
{
ACE_OS_TRACE ("ACE_OS::send");
@@ -555,9 +555,9 @@ ACE_OS::send (ACE_HANDLE handle, const char *buf, size_t len, int flags)
ACE_SOCKCALL_RETURN (::send ((ACE_SOCKET) handle,
buf,
static_cast<int> (len),
- flags), int, -1);
+ flags), ssize_t, -1);
#else
- int ace_result_;
+ ssize_t ace_result_;
# if defined (ACE_PSOS)
ace_result_ = ::send ((ACE_SOCKET) handle, const_cast <char *> (buf), len, flags);
# else
@@ -584,7 +584,7 @@ ACE_OS::send (ACE_HANDLE handle, const char *buf, size_t len, int flags)
#endif /* defined (ACE_WIN32) */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::sendmsg (ACE_HANDLE handle,
const struct msghdr *msg,
int flags)
@@ -609,13 +609,13 @@ ACE_OS::sendmsg (ACE_HANDLE handle,
return -1;
}
else
- return bytes_sent;
+ return (ssize_t) bytes_sent;
# elif defined (ACE_HAS_NONCONST_SENDMSG)
ACE_SOCKCALL_RETURN (::sendmsg (handle,
const_cast<struct msghdr *>(msg),
- flags), int, -1);
+ flags), ssize_t, -1);
# else
- ACE_SOCKCALL_RETURN (::sendmsg (handle, msg, flags), int, -1);
+ ACE_SOCKCALL_RETURN (::sendmsg (handle, msg, flags), ssize_t, -1);
# endif
#else
ACE_UNUSED_ARG (flags);
@@ -626,7 +626,7 @@ ACE_OS::sendmsg (ACE_HANDLE handle,
#endif /* ACE_LACKS_SENDMSG */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::sendto (ACE_HANDLE handle,
const char *buf,
size_t len,
@@ -642,16 +642,16 @@ ACE_OS::sendto (ACE_HANDLE handle,
flags,
const_cast<struct sockaddr *> (addr),
addrlen),
- int, -1);
+ ssize_t, -1);
#elif defined (ACE_PSOS)
# if !defined (ACE_PSOS_DIAB_PPC)
ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, (char *) buf, len, flags,
(struct sockaddr_in *) addr, addrlen),
- int, -1);
+ ssize_t, -1);
# else
ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle, (char *) buf, len, flags,
(struct sockaddr *) addr, addrlen),
- int, -1);
+ ssize_t, -1);
# endif /*defined ACE_PSOS_DIAB_PPC */
#else
# if defined (ACE_WIN32)
@@ -661,7 +661,7 @@ ACE_OS::sendto (ACE_HANDLE handle,
flags,
const_cast<struct sockaddr *> (addr),
addrlen),
- int, -1);
+ ssize_t, -1);
# else
ACE_SOCKCALL_RETURN (::sendto ((ACE_SOCKET) handle,
buf,
@@ -669,12 +669,12 @@ ACE_OS::sendto (ACE_HANDLE handle,
flags,
const_cast<struct sockaddr *> (addr),
addrlen),
- int, -1);
+ ssize_t, -1);
# endif /* ACE_WIN32 */
#endif /* VXWORKS */
}
-ACE_INLINE int
+ACE_INLINE ssize_t
ACE_OS::sendto (ACE_HANDLE handle,
const iovec *buffers,
int buffer_count,
@@ -701,14 +701,14 @@ ACE_OS::sendto (ACE_HANDLE handle,
ACE_OS::set_errno_to_wsa_last_error ();
}
number_of_bytes_sent = static_cast<size_t> (bytes_sent);
- return result;
+ return (ssize_t) result;
#else
ACE_UNUSED_ARG (overlapped);
ACE_UNUSED_ARG (func);
number_of_bytes_sent = 0;
- int result = 0;
+ ssize_t result = 0;
for (int i = 0; i < buffer_count; ++i)
{
@@ -735,7 +735,7 @@ ACE_OS::sendv (ACE_HANDLE handle,
{
#if defined (ACE_HAS_WINSOCK2)
DWORD bytes_sent = 0;
- int result = 0;
+ ssize_t result = 0;
// Winsock 2 has WSASend and can do this directly, but Winsock 1
// needs to do the sends one-by-one.
@@ -795,7 +795,7 @@ ACE_OS::sendv (ACE_HANDLE handle,
// iovec, if necessary, to obey the limit.
iovec local_iov[ACE_IOV_MAX];
long total = 0;
- long new_total;
+ long new_total = 0;
for (int i = 0; i < n; i++)
{
local_iov[i].iov_base = buffers[i].iov_base;
diff --git a/ace/OS_NS_unistd.inl b/ace/OS_NS_unistd.inl
index 0fe449e0cc9..820d28232ac 100644
--- a/ace/OS_NS_unistd.inl
+++ b/ace/OS_NS_unistd.inl
@@ -920,7 +920,8 @@ ACE_OS::readlink (const char *path, char *buf, size_t bufsiz)
# if !defined(ACE_HAS_NONCONST_READLINK)
ACE_OSCALL_RETURN (::readlink (path, buf, bufsiz), int, -1);
# else
- ACE_OSCALL_RETURN (::readlink ((char *)path, buf, bufsiz), int, -1);
+ ACE_OSCALL_RETURN (
+ ::readlink (const_cast <char *>(path), buf, bufsiz), int, -1);
# endif
# endif /* ACE_LACKS_READLINK */
}