2 #include "ace/OS_NS_unistd.h"
3 #include "ace/OS_NS_Thread.h"
4 #include "ace/OS_NS_ctype.h"
5 #include "ace/OS_NS_sys_socket.h"
7 // Open versioned namespace, if enabled by the user.
8 ACE_BEGIN_VERSIONED_NAMESPACE_DECL
10 // Wrappers for methods that have been moved to ACE_OS.
13 ACE::read_n (ACE_HANDLE handle,
16 size_t *bytes_transferred)
18 return ACE_OS::read_n (handle,
25 ACE::write_n (ACE_HANDLE handle,
28 size_t *bytes_transferred)
30 return ACE_OS::write_n (handle,
37 ACE::recv_n (ACE_HANDLE handle,
41 const ACE_Time_Value *timeout,
42 size_t *bytes_transferred)
45 return ACE::recv_n_i (handle,
51 return ACE::recv_n_i (handle,
59 #if defined (ACE_HAS_TLI)
62 ACE::t_rcv_n (ACE_HANDLE handle,
66 const ACE_Time_Value *timeout,
67 size_t *bytes_transferred)
70 return ACE::t_rcv_n_i (handle,
76 return ACE::t_rcv_n_i (handle,
84 #endif /* ACE_HAS_TLI */
87 ACE::recv_n (ACE_HANDLE handle,
90 const ACE_Time_Value *timeout,
91 size_t *bytes_transferred)
94 return ACE::recv_n_i (handle,
99 return ACE::recv_n_i (handle,
107 ACE::recvv_n (ACE_HANDLE handle,
110 const ACE_Time_Value *timeout,
111 size_t *bytes_transferred)
114 return ACE::recvv_n_i (handle,
119 return ACE::recvv_n_i (handle,
127 ACE::send_n (ACE_HANDLE handle,
131 const ACE_Time_Value *timeout,
132 size_t *bytes_transferred)
135 return ACE::send_n_i (handle,
141 return ACE::send_n_i (handle,
149 #if defined (ACE_HAS_TLI)
152 ACE::t_snd_n (ACE_HANDLE handle,
156 const ACE_Time_Value *timeout,
157 size_t *bytes_transferred)
160 return ACE::t_snd_n_i (handle,
166 return ACE::t_snd_n_i (handle,
174 #endif /* ACE_HAS_TLI */
177 ACE::send_n (ACE_HANDLE handle,
180 const ACE_Time_Value *timeout,
181 size_t *bytes_transferred)
184 return ACE::send_n_i (handle,
189 return ACE::send_n_i (handle,
197 ACE::sendv_n (ACE_HANDLE handle,
200 const ACE_Time_Value *timeout,
201 size_t *bytes_transferred)
204 return ACE::sendv_n_i (handle,
209 return ACE::sendv_n_i (handle,
217 ACE::send_i (ACE_HANDLE handle, const void *buf, size_t len)
219 #if defined (ACE_WIN32) || defined (ACE_MQX)
220 return ACE_OS::send (handle, (const char *) buf, len);
222 return ACE_OS::write (handle, (const char *) buf, len);
223 #endif /* ACE_WIN32 */
227 ACE::recv_i (ACE_HANDLE handle, void *buf, size_t len)
229 #if defined (ACE_WIN32) || defined (ACE_MQX)
230 return ACE_OS::recv (handle, (char *) buf, len);
232 return ACE_OS::read (handle, (char *) buf, len);
233 #endif /* ACE_WIN32 */
237 ACE::handle_read_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
239 return ACE::handle_ready (handle, timeout, true, false, false);
243 ACE::handle_write_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
245 return ACE::handle_ready (handle, timeout, false, true, false);
249 ACE::handle_exception_ready (ACE_HANDLE handle, const ACE_Time_Value *timeout)
251 return ACE::handle_ready (handle, timeout, false, false, true);
255 ACE::strdelete (char *s)
257 #if defined (ACE_HAS_ALLOC_HOOKS)
258 ACE_Allocator::instance()->free(s);
261 #endif /* ACE_HAS_ALLOC_HOOKS */
264 #if defined (ACE_HAS_WCHAR)
266 ACE::strdelete (wchar_t *s)
270 #endif /* ACE_HAS_WCHAR */
273 ACE::isdotdir (const char *s)
275 return (s[0] == '.' &&
276 ((s[1] == 0) || (s[1] == '.' && s[2] == 0)));
279 #if defined (ACE_HAS_WCHAR)
281 ACE::isdotdir (const wchar_t *s)
283 return (s[0] == ACE_TEXT ('.') &&
284 ((s[1] == 0) || (s[1] == ACE_TEXT ('.') && s[2] == 0)));
286 #endif /* ACE_HAS_WCHAR */
289 ACE::unique_name (const void *object,
293 ACE_OS::unique_name (object, name, length);
297 ACE::log2 (u_long num)
301 for (; num > 1; ++log)
308 ACE::map_errno (int error)
310 #if defined (ACE_WIN32)
314 return EAGAIN; // Same as UNIX errno EWOULDBLOCK.
316 #endif /* ACE_WIN32 */
322 ACE::hex2byte (ACE_TCHAR c)
324 if (ACE_OS::ace_isdigit (c))
325 return (u_char) (c - ACE_TEXT ('0'));
326 else if (ACE_OS::ace_islower (c))
327 return (u_char) (10 + c - ACE_TEXT ('a'));
329 return (u_char) (10 + c - ACE_TEXT ('A'));
332 // Close versioned namespace, if enabled by the user.
333 ACE_END_VERSIONED_NAMESPACE_DECL