00001 #include "ace_pch.h"
00002
00003
00004 #include "ace/Handle_Ops.h"
00005
00006 #if defined (ACE_LACKS_INLINE_FUNCTIONS)
00007 #include "ace/Handle_Ops.i"
00008 #endif
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
00025
00026 flags |= ACE_NONBLOCK;
00027 #endif
00028
00029
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
00038 errno = ETIMEDOUT;
00039
00040 return handle;
00041 }
00042 else
00043 return ACE_OS::open (name, flags, perms, sa);
00044 }