Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

Handle_Ops.cpp

Go to the documentation of this file.
00001 #include "ace_pch.h"
00002 // $Id: Handle_Ops.cpp,v 1.1.1.2.2.1 2003/03/13 19:44:21 chad Exp $
00003 
00004 #include "ace/Handle_Ops.h"
00005 
00006 #if defined (ACE_LACKS_INLINE_FUNCTIONS)
00007 #include "ace/Handle_Ops.i"
00008 #endif /* ACE_LACKS_INLINE_FUNCTIONS */
00009 
00010 ACE_RCSID(ace, Handle_Ops, "$Id: Handle_Ops.cpp,v 1.1.1.2.2.1 2003/03/13 19:44:21 chad Exp $")
00011 
00012 ACE_HANDLE
00013 ACE_Handle_Ops::handle_timed_open (ACE_Time_Value *timeout,
00014                                    const ACE_TCHAR *name,
00015                                    int flags,
00016                                    int perms,
00017                                    LPSECURITY_ATTRIBUTES sa)
00018 {
00019   ACE_TRACE ("ACE_Handle_Ops::handle_timed_open");
00020 
00021   if (timeout != 0)
00022     {
00023 #if !defined (ACE_WIN32)
00024       // On Win32, ACE_NONBLOCK gets recognized as O_WRONLY so we
00025       // don't use it there
00026       flags |= ACE_NONBLOCK;
00027 #endif /* ACE_WIN32 */
00028 
00029       // Open the named pipe or file using non-blocking mode...
00030       ACE_HANDLE handle = ACE_OS::open (name,
00031                                         flags,
00032                                         perms,
00033                                         sa);
00034       if (handle == ACE_INVALID_HANDLE
00035           && (errno == EWOULDBLOCK
00036               && (timeout->sec () > 0 || timeout->usec () > 0)))
00037         // This expression checks if we were polling.
00038         errno = ETIMEDOUT;
00039 
00040       return handle;
00041     }
00042   else
00043     return ACE_OS::open (name, flags, perms, sa);
00044 }

Generated on Mon Jun 16 11:19:45 2003 for ACE by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002