2 #include "ace/OS_NS_errno.h"
3 #include "ace/OS_NS_macros.h"
4 #include "ace/Time_Value.h"
6 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
8 // It would be really cool to add another version of select that would
9 // function like the one we're defending against below!
11 ACE_OS::select (int width,
12 fd_set *rfds, fd_set *wfds, fd_set *efds,
13 const ACE_Time_Value *timeout)
15 ACE_OS_TRACE ("ACE_OS::select");
16 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL)
17 // We must defend against non-conformity!
29 const timeval *timep = (timeout == 0 ? (const timeval *)0 : *timeout);
30 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */
31 #if defined (ACE_LACKS_SELECT)
32 ACE_UNUSED_ARG (width);
33 ACE_UNUSED_ARG (rfds);
34 ACE_UNUSED_ARG (wfds);
35 ACE_UNUSED_ARG (efds);
36 ACE_UNUSED_ARG (timeout);
37 ACE_NOTSUP_RETURN (-1);
38 #elif defined (ACE_MQX)
39 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timeout->msec()),
42 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timep),
48 ACE_OS::select (int width,
49 fd_set *rfds, fd_set *wfds, fd_set *efds,
50 const ACE_Time_Value &timeout)
52 ACE_OS_TRACE ("ACE_OS::select");
53 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL)
54 # define ___ACE_TIMEOUT ©
55 timeval copy = timeout;
57 # define ___ACE_TIMEOUT timep
58 const timeval *timep = timeout;
59 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */
60 #if defined (ACE_LACKS_SELECT)
61 ACE_UNUSED_ARG (width);
62 ACE_UNUSED_ARG (rfds);
63 ACE_UNUSED_ARG (wfds);
64 ACE_UNUSED_ARG (efds);
65 ACE_UNUSED_ARG (timeout);
66 ACE_NOTSUP_RETURN (-1);
67 #elif defined (ACE_MQX)
68 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timeout.msec()),
71 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, ___ACE_TIMEOUT),
77 ACE_END_VERSIONED_NAMESPACE_DECL