/usr/include/ace/OS_NS_stdlib.inl is in libace-dev 6.0.1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 | // -*- C++ -*-
//
// $Id: OS_NS_stdlib.inl 91683 2010-09-09 09:07:49Z johnnyw $
#include "ace/config-all.h" /* Need ACE_TRACE */
#include "ace/Object_Manager_Base.h"
#include "ace/OS_NS_string.h"
#include "ace/Global_Macros.h"
#include "ace/os_include/os_errno.h"
#include "ace/os_include/os_search.h"
#if defined (ACE_WCHAR_IN_STD_NAMESPACE)
# define ACE_WCHAR_STD_NAMESPACE std
#else
# define ACE_WCHAR_STD_NAMESPACE ACE_STD_NAMESPACE
#endif /* ACE_WCHAR_IN_STD_NAMESPACE */
ACE_BEGIN_VERSIONED_NAMESPACE_DECL
// Doesn't need a macro since it *never* returns!
ACE_INLINE void
ACE_OS::_exit (int status)
{
ACE_OS_TRACE ("ACE_OS::_exit");
#if defined (ACE_VXWORKS)
::exit (status);
#elif !defined (ACE_HAS_WINCE)
::_exit (status);
#else
::TerminateProcess (::GetCurrentProcess (), status);
#endif /* ACE_VXWORKS */
}
ACE_INLINE void
ACE_OS::abort (void)
{
#if !defined (ACE_HAS_WINCE)
::abort ();
#else
// @@ CE doesn't support abort?
exit (1);
#endif /* !ACE_HAS_WINCE */
}
ACE_INLINE int
ACE_OS::atexit (ACE_EXIT_HOOK func, const char* name)
{
return ACE_OS_Object_Manager::instance ()->at_exit (func, name);
}
ACE_INLINE int
ACE_OS::atoi (const char *s)
{
ACE_OSCALL_RETURN (::atoi (s), int, -1);
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE int
ACE_OS::atoi (const wchar_t *s)
{
#if defined (ACE_WIN32) && defined (ACE_HAS_WTOI)
ACE_OSCALL_RETURN (::_wtoi (s), int, -1);
#else /* ACE_WIN32 */
return ACE_OS::atoi (ACE_Wide_To_Ascii (s).char_rep ());
#endif /* ACE_WIN32 */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE long
ACE_OS::atol (const char *s)
{
ACE_OSCALL_RETURN (::atol (s), long, -1);
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE long
ACE_OS::atol (const wchar_t *s)
{
#if defined (ACE_WIN32) && defined (ACE_HAS_WTOL)
ACE_OSCALL_RETURN (::_wtol (s), long, -1);
#else /* ACE_WIN32 */
return ACE_OS::atol (ACE_Wide_To_Ascii (s).char_rep ());
#endif /* ACE_WIN32 */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE double
ACE_OS::atof (const char *s)
{
ACE_OSCALL_RETURN (::atof (s), double, -1);
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE double
ACE_OS::atof (const wchar_t *s)
{
#if !defined (ACE_HAS_WTOF)
return ACE_OS::atof (ACE_Wide_To_Ascii (s).char_rep ());
#elif defined (ACE_WTOF_EQUIVALENT)
ACE_OSCALL_RETURN (ACE_WTOF_EQUIVALENT (s), double, -1);
#else /* ACE_HAS__WTOF */
ACE_OSCALL_RETURN (::wtof (s), double, -1);
#endif /* ACE_HAS_WTOF */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE void *
ACE_OS::atop (const char *s)
{
ACE_TRACE ("ACE_OS::atop");
#if defined (ACE_WIN64)
intptr_t ip = ::_atoi64 (s);
#elif defined (ACE_OPENVMS)
# if !defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64)
int ip = ::atoi (s);
# else
intptr_t ip = ::atoi (s);
# endif
#else
intptr_t ip = ::atoi (s);
#endif /* ACE_WIN64 */
void * p = reinterpret_cast<void *> (ip);
return p;
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE void *
ACE_OS::atop (const wchar_t *s)
{
# if defined (ACE_WIN64)
intptr_t ip = ::_wtoi64 (s);
# elif defined (ACE_OPENVMS)
# if !defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64)
int ip = ACE_OS::atoi (s);
# else
intptr_t ip = ACE_OS::atoi (s);
# endif
# else
intptr_t ip = ACE_OS::atoi (s);
# endif /* ACE_WIN64 */
void * p = reinterpret_cast<void *> (ip);
return p;
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE void *
ACE_OS::bsearch (const void *key,
const void *base,
size_t nel,
size_t size,
ACE_COMPARE_FUNC compar)
{
#if !defined (ACE_LACKS_BSEARCH)
return ::bsearch (key, base, nel, size, compar);
#else
ACE_UNUSED_ARG (key);
ACE_UNUSED_ARG (base);
ACE_UNUSED_ARG (nel);
ACE_UNUSED_ARG (size);
ACE_UNUSED_ARG (compar);
ACE_NOTSUP_RETURN (0);
#endif /* ACE_LACKS_BSEARCH */
}
ACE_INLINE char *
ACE_OS::getenv (const char *symbol)
{
ACE_OS_TRACE ("ACE_OS::getenv");
#if defined (ACE_LACKS_GETENV)
ACE_UNUSED_ARG (symbol);
ACE_NOTSUP_RETURN (0);
#else /* ACE_LACKS_GETENV */
ACE_OSCALL_RETURN (::getenv (symbol), char *, 0);
#endif /* ACE_LACKS_GETENV */
}
#if defined (ACE_HAS_WCHAR) && defined (ACE_WIN32)
ACE_INLINE wchar_t *
ACE_OS::getenv (const wchar_t *symbol)
{
#if defined (ACE_LACKS_GETENV)
ACE_UNUSED_ARG (symbol);
ACE_NOTSUP_RETURN (0);
#else
ACE_OSCALL_RETURN (::_wgetenv (symbol), wchar_t *, 0);
#endif /* ACE_LACKS_GETENV */
}
#endif /* ACE_HAS_WCHAR && ACE_WIN32 */
ACE_INLINE char *
ACE_OS::itoa (int value, char *string, int radix)
{
#if !defined (ACE_HAS_ITOA)
return ACE_OS::itoa_emulation (value, string, radix);
#elif defined (ACE_ITOA_EQUIVALENT)
return ACE_ITOA_EQUIVALENT (value, string, radix);
#else /* !ACE_HAS_ITOA */
return ::itoa (value, string, radix);
#endif /* !ACE_HAS_ITOA */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE wchar_t *
ACE_OS::itoa (int value, wchar_t *string, int radix)
{
#if defined (ACE_LACKS_ITOW)
return ACE_OS::itow_emulation (value, string, radix);
#else /* ACE_LACKS_ITOW */
return ::_itow (value, string, radix);
#endif /* ACE_LACKS_ITOW */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE ACE_HANDLE
ACE_OS::mkstemp (char *s)
{
#if !defined (ACE_LACKS_MKSTEMP)
return ::mkstemp (s);
#elif defined (ACE_USES_WCHAR)
// For wide-char filesystems, we must convert the narrow-char input to
// a wide-char string for mkstemp_emulation(), then convert the name
// back to narrow-char for the caller.
ACE_Ascii_To_Wide wide_s (s);
const ACE_HANDLE fh = ACE_OS::mkstemp_emulation (wide_s.wchar_rep ());
if (fh != ACE_INVALID_HANDLE)
{
ACE_Wide_To_Ascii narrow_s (wide_s.wchar_rep ());
ACE_OS::strcpy (s, narrow_s.char_rep ());
}
return fh;
#else
return ACE_OS::mkstemp_emulation (s);
#endif /* !ACE_LACKS_MKSTEMP */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE ACE_HANDLE
ACE_OS::mkstemp (wchar_t *s)
{
# if !defined (ACE_LACKS_MKSTEMP)
// For wide-char filesystems, we must convert the wide-char input to
// a narrow-char string for mkstemp(), then convert the name
// back to wide-char for the caller.
ACE_Wide_To_Ascii narrow_s (s);
const ACE_HANDLE fh = ::mkstemp (narrow_s.char_rep ());
if (fh != ACE_INVALID_HANDLE)
{
ACE_Ascii_To_Wide wide_s (narrow_s.char_rep ());
ACE_OS::strcpy (s, wide_s.wchar_rep ());
}
return fh;
# elif defined (ACE_USES_WCHAR)
return ACE_OS::mkstemp_emulation (s);
# else
// For wide-char filesystems, we must convert the wide-char input to
// a narrow-char string for mkstemp_emulation(), then convert the name
// back to wide-char for the caller.
ACE_Wide_To_Ascii narrow_s (s);
const ACE_HANDLE fh = ACE_OS::mkstemp_emulation (narrow_s.char_rep ());
if (fh != ACE_INVALID_HANDLE)
{
ACE_Ascii_To_Wide wide_s (narrow_s.char_rep ());
ACE_OS::strcpy (s, wide_s.wchar_rep ());
}
return fh;
# endif /* !ACE_LACKS_MKSTEMP */
}
#endif /* ACE_HAS_WCHAR */
#if !defined (ACE_LACKS_MKTEMP)
ACE_INLINE char *
ACE_OS::mktemp (char *s)
{
# if defined (ACE_WIN32)
return ::_mktemp (s);
# else /* ACE_WIN32 */
return ::mktemp (s);
# endif /* ACE_WIN32 */
}
# if defined (ACE_HAS_WCHAR)
ACE_INLINE wchar_t *
ACE_OS::mktemp (wchar_t *s)
{
# if defined (ACE_WIN32)
return ::_wmktemp (s);
# else
// For narrow-char filesystems, we must convert the wide-char input to
// a narrow-char string for mktemp (), then convert the name back to
// wide-char for the caller.
ACE_Wide_To_Ascii narrow_s (s);
if (::mktemp (narrow_s.char_rep ()) == 0)
return 0;
ACE_Ascii_To_Wide wide_s (narrow_s.char_rep ());
ACE_OS::strcpy (s, wide_s.wchar_rep ());
return s;
# endif
}
# endif /* ACE_HAS_WCHAR */
#endif /* !ACE_LACKS_MKTEMP */
ACE_INLINE int
ACE_OS::putenv (const char *string)
{
ACE_OS_TRACE ("ACE_OS::putenv");
#if defined (ACE_LACKS_PUTENV) && defined (ACE_HAS_SETENV)
int result = 0;
char *sp = ACE_OS::strchr (const_cast <char *> (string), '=');
if (sp)
{
char *stmp = ACE_OS::strdup (string);
if (stmp)
{
stmp[sp - string] = '\0';
result = ACE_OS::setenv (stmp, sp+sizeof (char), 1);
ACE_OS::free (stmp);
}
else
{
errno = ENOMEM;
result = -1;
}
}
else
{
result = ACE_OS::setenv (string, "", 1);
}
return result;
#elif defined (ACE_LACKS_PUTENV)
ACE_UNUSED_ARG (string);
ACE_NOTSUP_RETURN (0);
#else /* ! ACE_HAS_WINCE */
ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::putenv (const_cast <char *> (string)), int, -1);
#endif /* ACE_LACKS_PUTENV && ACE_HAS_SETENV */
}
ACE_INLINE int
ACE_OS::setenv(const char *envname, const char *envval, int overwrite)
{
#if defined (ACE_LACKS_SETENV)
ACE_UNUSED_ARG (envname);
ACE_UNUSED_ARG (envval);
ACE_UNUSED_ARG (overwrite);
ACE_NOTSUP_RETURN (-1);
#else
ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::setenv (envname, envval, overwrite), int, -1);
#endif
}
ACE_INLINE int
ACE_OS::unsetenv(const char *name)
{
#if defined (ACE_LACKS_UNSETENV)
ACE_UNUSED_ARG (name);
ACE_NOTSUP_RETURN (-1);
#else
# if defined (ACE_HAS_VOID_UNSETENV)
::unsetenv (name);
return 0;
#else
ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::unsetenv (name), int, -1);
# endif /* ACE_HAS_VOID_UNSETENV */
#endif /* ACE_LACKS_UNSETENV */
}
#if defined (ACE_HAS_WCHAR) && defined (ACE_WIN32)
ACE_INLINE int
ACE_OS::putenv (const wchar_t *string)
{
ACE_OS_TRACE ("ACE_OS::putenv");
#if defined (ACE_LACKS_PUTENV)
ACE_UNUSED_ARG (string);
ACE_NOTSUP_RETURN (-1);
#else
ACE_OSCALL_RETURN (::_wputenv (string), int, -1);
#endif /* ACE_LACKS_PUTENV */
}
#endif /* ACE_HAS_WCHAR && ACE_WIN32 */
ACE_INLINE void
ACE_OS::qsort (void *base,
size_t nel,
size_t width,
ACE_COMPARE_FUNC compar)
{
#if !defined (ACE_LACKS_QSORT)
::qsort (base, nel, width, compar);
#else
ACE_UNUSED_ARG (base);
ACE_UNUSED_ARG (nel);
ACE_UNUSED_ARG (width);
ACE_UNUSED_ARG (compar);
#endif /* !ACE_LACKS_QSORT */
}
ACE_INLINE int
ACE_OS::rand (void)
{
ACE_OS_TRACE ("ACE_OS::rand");
ACE_OSCALL_RETURN (::rand (), int, -1);
}
#if !defined (ACE_WIN32)
ACE_INLINE int
ACE_OS::rand_r (ACE_RANDR_TYPE &seed)
{
ACE_OS_TRACE ("ACE_OS::rand_r");
# if defined (ACE_HAS_REENTRANT_FUNCTIONS) && \
!defined (ACE_LACKS_RAND_REENTRANT_FUNCTIONS)
# if defined (ACE_HAS_BROKEN_RANDR)
ACE_OSCALL_RETURN (::rand_r (seed), int, -1);
# else
ACE_OSCALL_RETURN (::rand_r (&seed), int, -1);
# endif /* ACE_HAS_BROKEN_RANDR */
# else
ACE_UNUSED_ARG (seed);
ACE_OSCALL_RETURN (::rand (), int, -1);
# endif /* ACE_HAS_REENTRANT_FUNCTIONS */
}
#else /* ACE_WIN32 */
ACE_INLINE int
ACE_OS::rand_r (ACE_RANDR_TYPE& seed)
{
ACE_OS_TRACE ("ACE_OS::rand_r");
long new_seed = (long) (seed);
if (new_seed == 0)
new_seed = 0x12345987;
long temp = new_seed / 127773;
new_seed = 16807 * (new_seed - temp * 127773) - 2836 * temp;
if (new_seed < 0)
new_seed += 2147483647;
(seed) = (unsigned int)new_seed;
return (int) (new_seed & RAND_MAX);
}
#endif /* !ACE_WIN32 */
# if !defined (ACE_LACKS_REALPATH)
ACE_INLINE char *
ACE_OS::realpath (const char *file_name,
char *resolved_name)
{
# if defined (ACE_WIN32)
return ::_fullpath (resolved_name, file_name, PATH_MAX);
# else /* ACE_WIN32 */
return ::realpath (file_name, resolved_name);
# endif /* ! ACE_WIN32 */
}
# if defined (ACE_HAS_WCHAR)
ACE_INLINE wchar_t *
ACE_OS::realpath (const wchar_t *file_name,
wchar_t *resolved_name)
{
# if defined (ACE_WIN32)
return ::_wfullpath (resolved_name, file_name, PATH_MAX);
# else /* ACE_WIN32 */
ACE_Wide_To_Ascii n_file_name (file_name);
char n_resolved[PATH_MAX];
if (0 != ACE_OS::realpath (n_file_name.char_rep (), n_resolved))
{
ACE_Ascii_To_Wide w_resolved (n_resolved);
ACE_OS::strcpy (resolved_name, w_resolved.wchar_rep ());
return resolved_name;
}
return 0;
# endif /* ! ACE_WIN32 */
}
# endif /* ACE_HAS_WCHAR */
#endif /* ACE_HAS_WINCE */
ACE_INLINE ACE_EXIT_HOOK
ACE_OS::set_exit_hook (ACE_EXIT_HOOK exit_hook)
{
ACE_EXIT_HOOK old_hook = exit_hook_;
exit_hook_ = exit_hook;
return old_hook;
}
ACE_INLINE void
ACE_OS::srand (u_int seed)
{
ACE_OS_TRACE ("ACE_OS::srand");
::srand (seed);
}
#if !defined (ACE_LACKS_STRTOD)
ACE_INLINE double
ACE_OS::strtod (const char *s, char **endptr)
{
return ::strtod (s, endptr);
}
#endif /* !ACE_LACKS_STRTOD */
#if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_WCSTOD)
ACE_INLINE double
ACE_OS::strtod (const wchar_t *s, wchar_t **endptr)
{
return ACE_WCHAR_STD_NAMESPACE::wcstod (s, endptr);
}
#endif /* ACE_HAS_WCHAR && !ACE_LACKS_WCSTOD */
ACE_INLINE long
ACE_OS::strtol (const char *s, char **ptr, int base)
{
#if defined (ACE_LACKS_STRTOL)
return ACE_OS::strtol_emulation (s, ptr, base);
#else /* ACE_LACKS_STRTOL */
return ::strtol (s, ptr, base);
#endif /* ACE_LACKS_STRTOL */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE long
ACE_OS::strtol (const wchar_t *s, wchar_t **ptr, int base)
{
#if defined (ACE_LACKS_WCSTOL)
return ACE_OS::wcstol_emulation (s, ptr, base);
#else
return ACE_WCHAR_STD_NAMESPACE::wcstol (s, ptr, base);
#endif /* ACE_LACKS_WCSTOL */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE unsigned long
ACE_OS::strtoul (const char *s, char **ptr, int base)
{
#if defined (ACE_LACKS_STRTOUL)
return ACE_OS::strtoul_emulation (s, ptr, base);
#else /* ACE_LACKS_STRTOUL */
return ::strtoul (s, ptr, base);
#endif /* ACE_LACKS_STRTOUL */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE unsigned long
ACE_OS::strtoul (const wchar_t *s, wchar_t **ptr, int base)
{
#if defined (ACE_LACKS_WCSTOUL)
return ACE_OS::wcstoul_emulation (s, ptr, base);
#else
return ACE_WCHAR_STD_NAMESPACE::wcstoul (s, ptr, base);
#endif /* ACE_LACKS_WCSTOUL */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE ACE_INT64
ACE_OS::strtoll (const char *s, char **ptr, int base)
{
#if defined (ACE_LACKS_STRTOLL)
return ACE_OS::strtoll_emulation (s, ptr, base);
#elif defined (ACE_STRTOLL_EQUIVALENT)
return ACE_STRTOLL_EQUIVALENT (s, ptr, base);
#else
return ace_strtoll_helper (s, ptr, base);
#endif /* ACE_LACKS_STRTOLL */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE ACE_INT64
ACE_OS::strtoll (const wchar_t *s, wchar_t **ptr, int base)
{
#if defined (ACE_LACKS_WCSTOLL)
return ACE_OS::wcstoll_emulation (s, ptr, base);
#elif defined (ACE_WCSTOLL_EQUIVALENT)
return ACE_WCSTOLL_EQUIVALENT (s, ptr, base);
#else
return ACE_WCHAR_STD_NAMESPACE::wcstoll (s, ptr, base);
#endif /* ACE_LACKS_WCSTOLL */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE ACE_UINT64
ACE_OS::strtoull (const char *s, char **ptr, int base)
{
#if defined (ACE_LACKS_STRTOULL)
return ACE_OS::strtoull_emulation (s, ptr, base);
#elif defined (ACE_STRTOULL_EQUIVALENT)
return ACE_STRTOULL_EQUIVALENT (s, ptr, base);
#else
return ace_strtoull_helper (s, ptr, base);
#endif /* ACE_LACKS_STRTOULL */
}
#if defined (ACE_HAS_WCHAR)
ACE_INLINE ACE_UINT64
ACE_OS::strtoull (const wchar_t *s, wchar_t **ptr, int base)
{
#if defined (ACE_LACKS_WCSTOULL)
return ACE_OS::wcstoull_emulation (s, ptr, base);
#elif defined (ACE_WCSTOULL_EQUIVALENT)
return ACE_WCSTOULL_EQUIVALENT (s, ptr, base);
#else
return ACE_WCHAR_STD_NAMESPACE::wcstoull (s, ptr, base);
#endif /* ACE_LACKS_WCSTOULL */
}
#endif /* ACE_HAS_WCHAR */
ACE_INLINE int
ACE_OS::system (const ACE_TCHAR *s)
{
// ACE_OS_TRACE ("ACE_OS::system");
#if defined (ACE_LACKS_SYSTEM)
ACE_UNUSED_ARG (s);
ACE_NOTSUP_RETURN (-1);
#elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
ACE_OSCALL_RETURN (::_wsystem (s), int, -1);
#elif defined (ACE_TANDEM_T1248_PTHREADS)
ACE_OSCALL_RETURN (::spt_system (s), int, -1);
#else
ACE_OSCALL_RETURN (::system (ACE_TEXT_ALWAYS_CHAR (s)), int, -1);
#endif /* ACE_LACKS_SYSTEM */
}
ACE_INLINE const char*
ACE_OS::getprogname ()
{
#if defined (ACE_HAS_GETPROGNAME)
return ::getprogname ();
#else
return ACE_OS::getprogname_emulation ();
#endif /* ACE_HAS_GETPROGNAME */
}
ACE_INLINE void
ACE_OS::setprogname (const char* name)
{
#if defined (ACE_HAS_SETPROGNAME)
::setprogname (name);
#else
ACE_OS::setprogname_emulation (name);
#endif /* ACE_HAS_SETPROGNAME */
}
ACE_END_VERSIONED_NAMESPACE_DECL
|