mirror of
https://github.com/mangosfour/server.git
synced 2025-12-12 19:37:03 +00:00
Some missing from merge.
Signed-off-by: Salja <salja2012@hotmail.de>
This commit is contained in:
parent
ec939a5bce
commit
f4be15a7af
1895 changed files with 160408 additions and 53601 deletions
|
|
@ -1,8 +1,7 @@
|
|||
// $Id: DEV_IO.cpp 96985 2013-04-11 15:50:32Z huangh $
|
||||
|
||||
#include "ace/DEV_IO.h"
|
||||
#include "ace/Log_Category.h"
|
||||
#if defined (ACE_HAS_ALLOC_HOOKS)
|
||||
# include "ace/Malloc_Base.h"
|
||||
#endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
|
||||
#if !defined (__ACE_INLINE__)
|
||||
#include "ace/DEV_IO.inl"
|
||||
|
|
@ -65,26 +64,15 @@ ssize_t
|
|||
ACE_DEV_IO::send (size_t n, ...) const
|
||||
{
|
||||
ACE_TRACE ("ACE_DEV_IO::send");
|
||||
#ifdef ACE_LACKS_VA_FUNCTIONS
|
||||
ACE_UNUSED_ARG (n);
|
||||
ACE_NOTSUP_RETURN (-1);
|
||||
#else
|
||||
va_list argp;
|
||||
int total_tuples = static_cast<int> (n / 2);
|
||||
iovec *iovp;
|
||||
#if defined (ACE_HAS_ALLOCA)
|
||||
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
|
||||
#else
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
|
||||
ACE_Allocator::instance ()->malloc (total_tuples *
|
||||
sizeof (iovec)),
|
||||
-1);
|
||||
# else
|
||||
ACE_NEW_RETURN (iovp,
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
|
|
@ -97,15 +85,10 @@ ACE_DEV_IO::send (size_t n, ...) const
|
|||
|
||||
ssize_t result = ACE_OS::writev (this->get_handle (), iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_Allocator::instance ()->free (iovp);
|
||||
# else
|
||||
delete [] iovp;
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
va_end (argp);
|
||||
return result;
|
||||
#endif // ACE_LACKS_VA_FUNCTIONS
|
||||
}
|
||||
|
||||
// This is basically an interface to ACE_OS::readv, that doesn't use the
|
||||
|
|
@ -118,26 +101,15 @@ ssize_t
|
|||
ACE_DEV_IO::recv (size_t n, ...) const
|
||||
{
|
||||
ACE_TRACE ("ACE_DEV_IO::recv");
|
||||
#ifdef ACE_LACKS_VA_FUNCTIONS
|
||||
ACE_UNUSED_ARG (n);
|
||||
ACE_NOTSUP_RETURN (-1);
|
||||
#else
|
||||
va_list argp;
|
||||
int total_tuples = static_cast<int> (n / 2);
|
||||
iovec *iovp;
|
||||
#if defined (ACE_HAS_ALLOCA)
|
||||
iovp = (iovec *) alloca (total_tuples * sizeof (iovec));
|
||||
#else
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_ALLOCATOR_RETURN (iovp, (iovec *)
|
||||
ACE_Allocator::instance ()->malloc (total_tuples *
|
||||
sizeof (iovec)),
|
||||
-1);
|
||||
# else
|
||||
ACE_NEW_RETURN (iovp,
|
||||
iovec[total_tuples],
|
||||
-1);
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
|
||||
va_start (argp, n);
|
||||
|
|
@ -150,15 +122,10 @@ ACE_DEV_IO::recv (size_t n, ...) const
|
|||
|
||||
ssize_t result = ACE_OS::readv (this->get_handle (), iovp, total_tuples);
|
||||
#if !defined (ACE_HAS_ALLOCA)
|
||||
# ifdef ACE_HAS_ALLOC_HOOKS
|
||||
ACE_Allocator::instance ()->free (iovp);
|
||||
# else
|
||||
delete [] iovp;
|
||||
# endif /* ACE_HAS_ALLOC_HOOKS */
|
||||
#endif /* !defined (ACE_HAS_ALLOCA) */
|
||||
va_end (argp);
|
||||
return result;
|
||||
#endif // ACE_LACKS_VA_FUNCTIONS
|
||||
}
|
||||
|
||||
ACE_END_VERSIONED_NAMESPACE_DECL
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue