os_uio.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_uio.h
00006  *
00007  *  definitions for vector I/O operations
00008  *
00009  *  os_uio.h,v 1.6 2004/08/25 16:05:42 shuston Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_SYS_OS_UIO_H
00017 #define ACE_OS_INCLUDE_SYS_OS_UIO_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "ace/config-lite.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/os_include/sys/os_types.h"
00028 #include "ace/os_include/os_limits.h"
00029 
00030 #if !defined (ACE_LACKS_SYS_UIO_H)
00031 #  include /**/ <sys/uio.h>
00032 #endif /* !ACE_LACKS_SYS_UIO_H */
00033 
00034 // Place all additions (especially function declarations) within extern "C" {}
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif /* __cplusplus */
00039 
00040 // todo: make this a regular ACE_LACKS macro test...
00041 #if defined(__rtems__)
00042    struct iovec {
00043      /// Base address.
00044      char *iov_base;
00045      /// Length.
00046      size_t iov_len;
00047    };
00048 #elif defined (ACE_WIN32)
00049    /// The ordering of the fields in this struct is important.  It has to
00050    /// match those in WSABUF.
00051    struct iovec
00052    {
00053      /// byte count to read/write
00054      u_long iov_len;
00055      /// data to be read/written
00056      char *iov_base;
00057 
00058      // WSABUF is a Winsock2-only type.
00059 #  if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00060      operator WSABUF &(void) { return *((WSABUF *) this); }
00061 #  endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */
00062    };
00063 #endif /* __rtems__ */
00064 
00065 
00066 # if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES)
00067 
00068   ssize_t readv_timedwait (ACE_HANDLE handle,
00069                            const iovec *iov,
00070                            int iovcnt,
00071                            struct timespec* timeout);
00072 
00073   ssize_t writev_timedwait (ACE_HANDLE handle,
00074                             const iovec *iov,
00075                             int iovcnt,
00076                             struct timespec *timeout);
00077 
00078 # endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */
00079 
00080 #ifdef __cplusplus
00081 }
00082 #endif /* __cplusplus */
00083 
00084 #include /**/ "ace/post.h"
00085 #endif /* ACE_OS_INCLUDE_SYS_OS_UIO_H */

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6