diff options
author | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
---|---|---|
committer | William R. Otte <wotte@dre.vanderbilt.edu> | 2006-07-24 15:50:30 +0000 |
commit | c44379cc7d9c7aa113989237ab0f56db12aa5219 (patch) | |
tree | 66a84b20d47f2269d8bdc6e0323f338763424d3a /ACE/ace/os_include | |
parent | 3aff90f4a822fcf5d902bbfbcc9fa931d6191a8c (diff) | |
download | ATCD-c44379cc7d9c7aa113989237ab0f56db12aa5219.tar.gz |
Repo restructuring
Diffstat (limited to 'ACE/ace/os_include')
87 files changed, 6405 insertions, 0 deletions
diff --git a/ACE/ace/os_include/arpa/os_inet.h b/ACE/ace/os_include/arpa/os_inet.h new file mode 100644 index 00000000000..3537a956abc --- /dev/null +++ b/ACE/ace/os_include/arpa/os_inet.h @@ -0,0 +1,74 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_inet.h + * + * definitions for internet operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_ARPA_OS_INET_H +#define ACE_OS_INCLUDE_ARPA_OS_INET_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/netinet/os_in.h" + +#if !defined (ACE_LACKS_ARPA_INET_H) + extern "C" { +# include /**/ <arpa/inet.h> + } +#endif /* !ACE_LACKS_ARPA_INET_H */ + +#if defined (ACE_VXWORKS) +# include /**/ <inetLib.h> +#endif /* ACE_VXWORKS */ + +/** + * In some environments it is useful to swap the bytes on write, for + * instance: a fast server can be feeding a lot of slow clients that + * happen to have the wrong byte order. + * Because this is a rarely used feature we disable it by default to + * minimize footprint. + * This macro enables the functionality, but we still need a way to + * activate it on a per-connection basis. + */ +// #define ACE_ENABLE_SWAP_ON_WRITE + +/** + * In some environements we never need to swap bytes when reading, for + * instance embebbed systems (such as avionics) or homogenous + * networks. + * Setting this macro disables the capabilities to demarshall streams + * in the wrong byte order. + */ +// #define ACE_DISABLE_SWAP_ON_READ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_INET_ATON_PROTOTYPE) + int inet_aton (const char *, struct in_addr *); +#endif /* ACE_LACKS_INET_ATON_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_ARPA_OS_INET_H */ diff --git a/ACE/ace/os_include/net/os_if.h b/ACE/ace/os_include/net/os_if.h new file mode 100644 index 00000000000..8ffcea9ff3d --- /dev/null +++ b/ACE/ace/os_include/net/os_if.h @@ -0,0 +1,67 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_if.h + * + * sockets local interfaces + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_NET_OS_IF_H +#define ACE_OS_INCLUDE_NET_OS_IF_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_NEEDS_IPC_1C_H) + // LynxOS 3.1.0 and later need this +# include /**/ <ipc_1c.h> +#endif /* ACE_NEEDS_IPC_1C_H */ + +#if !defined (ACE_LACKS_NET_IF_H) + // This part if to avoid STL name conflict with the map structure + // in net/if.h. +# if defined (ACE_HAS_STL_MAP_CONFLICT) +# define map _Resource_Allocation_Map_ +# endif /* ACE_HAS_STL_MAP_CONFLICT */ + extern "C" { +# include /**/ <net/if.h> + } +# if defined (ACE_HAS_STL_MAP_CONFLICT) +# undef map +# endif /* ACE_HAS_STL_MAP_CONFLICT */ +# if defined (HPUX) && defined (IOR) + /* HP-UX 11.11 defines IOR in /usr/include/pa/inline.h + and we don't want that definition. See IOP_IORC.h. + Thanks to Torsten Kopper <tkue_0931@fastmail.fm> for this patch.*/ +# undef IOR +# endif /* HPUX && IOR */ +#endif /* !ACE_LACKS_NET_IF_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_BROKEN_IF_HEADER) + struct ifafilt; +#endif /* ACE_HAS_BROKEN_IF_HEADER */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_NET_OS_IF_H */ diff --git a/ACE/ace/os_include/netinet/os_in.h b/ACE/ace/os_include/netinet/os_in.h new file mode 100644 index 00000000000..8ad4cd853d6 --- /dev/null +++ b/ACE/ace/os_include/netinet/os_in.h @@ -0,0 +1,140 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_in.h + * + * Internet address family + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_NETINET_OS_IN_H +#define ACE_OS_INCLUDE_NETINET_OS_IN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_inttypes.h" +#include "ace/os_include/sys/os_socket.h" + +#if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) +# include /**/ <ws2tcpip.h> +#endif /* ACE_HAS_WINSOCK2 */ + +#if !defined (ACE_LACKS_NETINET_IN_H) +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# define queue _Queue_ +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ + extern "C" { +# include /**/ <netinet/in.h> + } +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# undef queue +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ +#endif /* !ACE_LACKS_NETINET_IN_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +# if defined (ACE_HAS_PHARLAP_RT) +# define ACE_IPPROTO_TCP SOL_SOCKET +# else +# define ACE_IPPROTO_TCP IPPROTO_TCP +# endif /* ACE_HAS_PHARLAP_RT */ + +# if !defined (ACE_HAS_IP_MULTICAST) && defined (ACE_LACKS_IP_ADD_MEMBERSHIP) + // Even if ACE_HAS_IP_MULTICAST is not defined, if IP_ADD_MEMBERSHIP + // is defined, assume that the ip_mreq struct is also defined + // (presumably in netinet/in.h). + struct ip_mreq + { + /// IP multicast address of group + struct in_addr imr_multiaddr; + /// Local IP address of interface + struct in_addr imr_interface; + }; +# endif /* ! ACE_HAS_IP_MULTICAST && ACE_LACKS_IP_ADD_MEMBERSHIP */ + +#if !defined (IPPORT_RESERVED) +# define IPPORT_RESERVED 1024 +#endif /* !IPPORT_RESERVED */ + +#if !defined (IPPORT_USERRESERVED) +# define IPPORT_USERRESERVED 5000 +#endif /* !IPPORT_USERRESERVED */ + +// Define INET loopback address constant if it hasn't been defined +// Dotted Decimal 127.0.0.1 == Hexidecimal 0x7f000001 +#if !defined (INADDR_LOOPBACK) +# define INADDR_LOOPBACK ((ACE_UINT32) 0x7f000001) +#endif /* INADDR_LOOPBACK */ + +// The INADDR_NONE address is generally 255.255.255.255. +#if !defined (INADDR_NONE) +# define INADDR_NONE ((ACE_UINT32) 0xffffffff) +#endif /* INADDR_NONE */ + +// Define INET string length constants if they haven't been defined +// +// for IPv4 dotted-decimal +#if !defined (INET_ADDRSTRLEN) +# define INET_ADDRSTRLEN 16 +#endif /* INET_ADDRSTRLEN */ +// +// for IPv6 hex string +#if !defined (INET6_ADDRSTRLEN) +# define INET6_ADDRSTRLEN 46 +#endif /* INET6_ADDRSTRLEN */ + +# if !defined (IP_DROP_MEMBERSHIP) +# define IP_DROP_MEMBERSHIP 0 +# endif /* IP_DROP_MEMBERSHIP */ + +# if !defined (IP_ADD_MEMBERSHIP) +# define IP_ADD_MEMBERSHIP 0 +# define ACE_LACKS_IP_ADD_MEMBERSHIP +# endif /* IP_ADD_MEMBERSHIP */ + +# if !defined (IP_DEFAULT_MULTICAST_TTL) +# define IP_DEFAULT_MULTICAST_TTL 0 +# endif /* IP_DEFAULT_MULTICAST_TTL */ + +# if !defined (IP_DEFAULT_MULTICAST_LOOP) +# define IP_DEFAULT_MULTICAST_LOOP 0 +# endif /* IP_DEFAULT_MULTICAST_LOOP */ + +# if !defined (IP_MULTICAST_IF) +# define IP_MULTICAST_IF 0 +# endif /* IP_MULTICAST_IF */ + +# if !defined (IP_MULTICAST_TTL) +# define IP_MULTICAST_TTL 1 +# endif /* IP_MULTICAST_TTL */ + +# if !defined (IP_MULTICAST_LOOP) +# define IP_MULTICAST_LOOP 2 +# endif /* IP_MULTICAST_LOOP */ + +# if !defined (IP_MAX_MEMBERSHIPS) +# define IP_MAX_MEMBERSHIPS 0 +# endif /* IP_MAX_MEMBERSHIP */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_NETINET_OS_IN_H */ diff --git a/ACE/ace/os_include/netinet/os_tcp.h b/ACE/ace/os_include/netinet/os_tcp.h new file mode 100644 index 00000000000..2d829320b45 --- /dev/null +++ b/ACE/ace/os_include/netinet/os_tcp.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_tcp.h + * + * definitions for the Internet Transmission Control Protocol (TCP) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_NETINET_OS_TCP_H +#define ACE_OS_INCLUDE_NETINET_OS_TCP_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_NETINET_TCP_H) +# include /**/ <netinet/tcp.h> +#endif /* !ACE_LACKS_NETIINET_TCP_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_NETINET_OS_TCP_H */ diff --git a/ACE/ace/os_include/os_aio.h b/ACE/ace/os_include/os_aio.h new file mode 100644 index 00000000000..ea5dae9dfda --- /dev/null +++ b/ACE/ace/os_include/os_aio.h @@ -0,0 +1,47 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_aio.h + * + * asynchronous input and output (REALTIME) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_AIO_H +#define ACE_OS_INCLUDE_OS_AIO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// Inclusion of the <aio.h> header may make visible symbols defined in +// the headers <fcntl.h>, <signal.h>, <sys/types.h>, and <time.h>. + +#include "ace/os_include/os_signal.h" // for sigevent + +#if !defined (ACE_LACKS_AIO_H) +# include /**/ <aio.h> +#endif /* !ACE_LACKS_AIO_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_AIO_H */ diff --git a/ACE/ace/os_include/os_assert.h b/ACE/ace/os_include/os_assert.h new file mode 100644 index 00000000000..bb39909b74e --- /dev/null +++ b/ACE/ace/os_include/os_assert.h @@ -0,0 +1,46 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_assert.h + * + * verify program assertion + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ASSERT_H +#define ACE_OS_INCLUDE_OS_ASSERT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_ASSERT_H) +# include /**/ <assert.h> +#endif /* !ACE_LACKS_ASSERT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_ASSERT_MACRO) +# define assert(expr) +#endif + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ASSERT_H */ diff --git a/ACE/ace/os_include/os_complex.h b/ACE/ace/os_include/os_complex.h new file mode 100644 index 00000000000..ce9f87fa8cb --- /dev/null +++ b/ACE/ace/os_include/os_complex.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_complex.h + * + * complex arithmetic + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_COMPLEX_H +#define ACE_OS_INCLUDE_OS_COMPLEX_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_COMPLEX_H) +# include /**/ <complex.h> +#endif /* !ACE_LACKS_COMPLEX_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_COMPLEX_H */ diff --git a/ACE/ace/os_include/os_cpio.h b/ACE/ace/os_include/os_cpio.h new file mode 100644 index 00000000000..efd108e8d0e --- /dev/null +++ b/ACE/ace/os_include/os_cpio.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_cpio.h + * + * cpio archive values + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_CPIO_H +#define ACE_OS_INCLUDE_OS_CPIO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_CPIO_H) +# include /**/ <cpio.h> +#endif /* !ACE_LACKS_CPIO_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_CPIO_H */ diff --git a/ACE/ace/os_include/os_ctype.h b/ACE/ace/os_include/os_ctype.h new file mode 100644 index 00000000000..8dd449ad6af --- /dev/null +++ b/ACE/ace/os_include/os_ctype.h @@ -0,0 +1,45 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ctype.h + * + * character types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_CTYPE_H +#define ACE_OS_INCLUDE_OS_CTYPE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_CTYPE_H) +# include /**/ <ctype.h> +#endif /* !ACE_LACKS_CTYPE_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// @todo move the is* and is* emulation methods in ACE_OS here +// and let ACE_OS just call them. + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_CTYPE_H */ diff --git a/ACE/ace/os_include/os_dirent.h b/ACE/ace/os_include/os_dirent.h new file mode 100644 index 00000000000..0d17677c16c --- /dev/null +++ b/ACE/ace/os_include/os_dirent.h @@ -0,0 +1,108 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_dirent.h + * + * format of directory entries + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_DIRENT_H +#define ACE_OS_INCLUDE_OS_DIRENT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" +#include "ace/os_include/os_limits.h" + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +# include "ace/os_include/os_unistd.h" // VxWorks needs this to compile +#endif /* ACE_VXWORKS */ + +#if !defined (ACE_LACKS_DIRENT_H) +# include /**/ <dirent.h> +#endif /* !ACE_LACKS_DIRENT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if !defined (MAXNAMLEN) +# define MAXNAMLEN NAME_MAX +#endif /* !MAXNAMLEN */ + +// At least compile on some of the platforms without <ACE_DIR> info yet. +#if !defined (ACE_HAS_DIRENT) +typedef int ACE_DIR; +struct dirent { +}; +#endif /* ACE_HAS_DIRENT */ + +#if defined (ACE_LACKS_STRUCT_DIR) +struct dirent { + unsigned short d_ino; + unsigned short d_off; + unsigned short d_reclen; + // This must be a ACE_TCHAR * and not a one element + // ACE_TCHAR array. It causes problems on wide + // character builds with Visual C++ 6.0. + ACE_TCHAR *d_name; +}; + +#define ACE_DIRENT dirent + +struct ACE_DIR { + /// The name of the directory we are looking into + ACE_TCHAR *directory_name_; + + /// Remember the handle between calls. + HANDLE current_handle_; + + /// The struct for the results + ACE_DIRENT *dirent_; + + /// The struct for intermediate results. + ACE_TEXT_WIN32_FIND_DATA fdata_; + + /// A flag to remember if we started reading already. + int started_reading_; +}; +#elif defined (ACE_WIN32) && (__BORLANDC__) && defined (ACE_USES_WCHAR) +#define ACE_DIRENT wdirent +typedef wDIR ACE_DIR; +#else +#define ACE_DIRENT dirent +typedef DIR ACE_DIR; +#endif /* ACE_LACKS_STRUCT_DIR */ + +#if defined rewinddir +# undef rewinddir +#endif /* rewinddir */ + +#if defined (ACE_LACKS_SCANDIR_PROTOTYPE) +int scandir (const char *, + struct dirent ***, + int (*) (const struct dirent *), + int (*) (const void *, const void *)); +#endif /* ACE_LACKS_SCANDIR_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_DIRENT_H */ diff --git a/ACE/ace/os_include/os_dlfcn.h b/ACE/ace/os_include/os_dlfcn.h new file mode 100644 index 00000000000..373d345c196 --- /dev/null +++ b/ACE/ace/os_include/os_dlfcn.h @@ -0,0 +1,107 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_dlfcn.h + * + * dynamic linking + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_DLFCN_H +#define ACE_OS_INCLUDE_OS_DLFCN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_DLFCN_H) +# if defined (ACE_HAS_DLFCN_H_BROKEN_EXTERN_C) + extern "C" { +# endif /* ACE_HAS_DLFCN_H_BROKEN_EXTERN_C */ +# include /**/ <dlfcn.h> +# if defined (ACE_HAS_DLFCN_H_BROKEN_EXTERN_C) + } +# endif /* ACE_HAS_DLFCN_H_BROKEN_EXTERN_C */ +#endif /* !ACE_LACKS_DLFCN_H */ + +#if defined (__hpux) +# if defined(__GNUC__) || __cplusplus >= 199707L +# include /**/ <dl.h> +# else +# include /**/ <cxxdl.h> +# endif /* (g++ || HP aC++) vs. HP C++ */ +#endif /* __hpux */ + +#if defined (ACE_VXWORKS) && !defined (__RTP__) +# include /**/ <loadLib.h> /* for module load */ +# include /**/ <unldLib.h> /* for module unload */ +# include /**/ <symLib.h> /* for findSymbol */ +# include /**/ <sysSymTbl.h> /* for global symbol table */ +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (_M_UNIX) + int _dlclose (void *); + char *_dlerror (void); + void *_dlopen (const char *, int); + void * _dlsym (void *, const char *); +#endif /* _M_UNIX */ + +/* Set the proper handle type for dynamically-loaded libraries. */ +/* Also define a default 'mode' for loading a library - the names and values */ +/* differ between OSes, so if you write code that uses the mode, be careful */ +/* of the platform differences. */ +#if defined (ACE_WIN32) + // Dynamic loading-related types - used for dlopen and family. + typedef HINSTANCE ACE_SHLIB_HANDLE; +# define ACE_SHLIB_INVALID_HANDLE 0 +# define ACE_DEFAULT_SHLIB_MODE 0 +#elif defined (ACE_HAS_SVR4_DYNAMIC_LINKING) + typedef void *ACE_SHLIB_HANDLE; +# define ACE_SHLIB_INVALID_HANDLE 0 + // This is needed to for dynamic_cast to work properly on objects passed to + // libraries. +# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY | RTLD_GLOBAL +#elif defined (__hpux) + typedef shl_t ACE_SHLIB_HANDLE; +# define ACE_SHLIB_INVALID_HANDLE 0 +# define ACE_DEFAULT_SHLIB_MODE BIND_DEFERRED +#else /* !ACE_WIN32 && !ACE_HAS_SVR4_DYNAMIC_LINKING && !__hpux */ + typedef void *ACE_SHLIB_HANDLE; +# define ACE_SHLIB_INVALID_HANDLE 0 +# define ACE_DEFAULT_SHLIB_MODE RTLD_LAZY +#endif /* ACE_WIN32 */ + +#if !defined (RTLD_LAZY) +#define RTLD_LAZY 1 +#endif /* !RTLD_LAZY */ + +#if !defined (RTLD_NOW) +#define RTLD_NOW 2 +#endif /* !RTLD_NOW */ + +#if !defined (RTLD_GLOBAL) +#define RTLD_GLOBAL 3 +#endif /* !RTLD_GLOBAL */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_DLFCN_H */ diff --git a/ACE/ace/os_include/os_errno.h b/ACE/ace/os_include/os_errno.h new file mode 100644 index 00000000000..9c9be161384 --- /dev/null +++ b/ACE/ace/os_include/os_errno.h @@ -0,0 +1,149 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_errno.h + * + * system error numbers + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ERRNO_H +#define ACE_OS_INCLUDE_OS_ERRNO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_ERRNO_H) +# include /**/ <errno.h> +#endif /* !ACE_LACKS_ERRNO_H */ + +#if defined (ACE_VXWORKS) +// Needed for VxWorks to pickup errnoSet() +#include /**/ <errnoLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_WIN32) + // error code mapping for windows +# define ETIME ERROR_SEM_TIMEOUT +# define EWOULDBLOCK WSAEWOULDBLOCK +# define EINPROGRESS WSAEINPROGRESS +# define EALREADY WSAEALREADY +# define ENOTSOCK WSAENOTSOCK +# define EDESTADDRREQ WSAEDESTADDRREQ +# define EMSGSIZE WSAEMSGSIZE +# define EPROTOTYPE WSAEPROTOTYPE +# define ENOPROTOOPT WSAENOPROTOOPT +# define EPROTONOSUPPORT WSAEPROTONOSUPPORT +# define ESOCKTNOSUPPORT WSAESOCKTNOSUPPORT +# define EOPNOTSUPP WSAEOPNOTSUPP +# define EPFNOSUPPORT WSAEPFNOSUPPORT +# define EAFNOSUPPORT WSAEAFNOSUPPORT +# define EADDRINUSE WSAEADDRINUSE +# define EADDRNOTAVAIL WSAEADDRNOTAVAIL +# define ENETDOWN WSAENETDOWN +# define ENETUNREACH WSAENETUNREACH +# define ENETRESET WSAENETRESET +# define ECONNABORTED WSAECONNABORTED +# define ECONNRESET WSAECONNRESET +# define ENOBUFS WSAENOBUFS +# define EISCONN WSAEISCONN +# define ENOTCONN WSAENOTCONN +# define ESHUTDOWN WSAESHUTDOWN +# define ETOOMANYREFS WSAETOOMANYREFS +# define ETIMEDOUT WSAETIMEDOUT +# define ECONNREFUSED WSAECONNREFUSED +# define ELOOP WSAELOOP +# define EHOSTDOWN WSAEHOSTDOWN +# define EHOSTUNREACH WSAEHOSTUNREACH +# define EPROCLIM WSAEPROCLIM +# define EUSERS WSAEUSERS +# define EDQUOT WSAEDQUOT +# define ESTALE WSAESTALE +# define EREMOTE WSAEREMOTE + // Grrr! ENAMETOOLONG and ENOTEMPTY are already defined by the horrible + // 'standard' library. + // #define ENAMETOOLONG WSAENAMETOOLONG +# define EADDRINUSE WSAEADDRINUSE + + // CE needs this... +# if !defined (EPERM) +# define EPERM ERROR_ACCESS_DENIED +# endif +#endif /* ACE_WIN32 */ + +#if defined (ACE_HAS_H_ERRNO) +void herror (const char *str); +#endif /* ACE_HAS_H_ERRNO */ + +#if !defined (ACE_WIN32) && defined (ACE_LACKS_T_ERRNO) +extern int t_errno; +#endif /* ACE_WIN32 && ACE_LACKS_T_ERRNO */ + +#if !defined (ENOSYS) +# define ENOSYS EFAULT /* Operation not supported or unknown error. */ +#endif /* !ENOSYS */ + +#if !defined (ENOTSUP) +# define ENOTSUP ENOSYS /* Operation not supported. */ +#endif /* !ENOTSUP */ + +#if !defined (ESUCCESS) +# define ESUCCESS 0 +#endif /* !ESUCCESS */ + +#if !defined (EIDRM) +# define EIDRM 0 +#endif /* !EIDRM */ + +#if !defined (ENFILE) +# define ENFILE EMFILE /* No more socket descriptors are available. */ +#endif /* !ENFILE */ + +#if !defined (ECOMM) + // Not the same, but ECONNABORTED is provided on NT. +# define ECOMM ECONNABORTED +#endif /* ECOMM */ + +#if !defined (EDEADLK) +# define EDEADLK 1000 /* Some large number.... */ +#endif /* !EDEADLK */ + +#if !defined (ENXIO) /* Needed in SOCK_Dgram_Mcast */ +# define ENXIO 6 +#endif /* ENXIO */ + +#if !defined (ETIMEDOUT) && defined (ETIME) +# define ETIMEDOUT ETIME +#endif /* ETIMEDOUT */ + +#if !defined (ETIME) && defined (ETIMEDOUT) +# define ETIME ETIMEDOUT +#endif /* ETIMED */ + +#if !defined (EBUSY) +# define EBUSY ETIME +#endif /* EBUSY */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ERRNO_H */ diff --git a/ACE/ace/os_include/os_fcntl.h b/ACE/ace/os_include/os_fcntl.h new file mode 100644 index 00000000000..275d131bb8f --- /dev/null +++ b/ACE/ace/os_include/os_fcntl.h @@ -0,0 +1,106 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_fcntl.h + * + * file control options + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FCNTL_H +#define ACE_OS_INCLUDE_OS_FCNTL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_stat.h" +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_FCNTL_H) +# include /**/ <fcntl.h> +#endif /* !ACE_LACKS_FCNTL_H */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +// for creat(), open() +# include /**/ <ioLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (__BORLANDC__) +# define _O_CREAT O_CREAT +# define _O_EXCL O_EXCL +# define _O_TRUNC O_TRUNC + // 0x0800 is used for O_APPEND. 0x08 looks free. +# define _O_TEMPORARY 0x08 /* see fcntl.h */ +# define _O_RDWR O_RDWR +# define _O_WRONLY O_WRONLY +# define _O_RDONLY O_RDONLY +# define _O_APPEND O_APPEND +# define _O_BINARY O_BINARY +# define _O_TEXT O_TEXT +#endif /* __BORLANDC__ */ + +#if defined (__DMC__) +# define _O_TEMPORARY 0x08 /* see fcntl.h */ +#endif /* __DMC__ */ + +// defined Win32 specific macros for UNIX platforms +#if !defined (O_BINARY) +# define O_BINARY 0 +#endif /* O_BINARY */ +#if !defined (_O_BINARY) +# define _O_BINARY O_BINARY +#endif /* _O_BINARY */ +#if !defined (O_TEXT) +# define O_TEXT 0 +#endif /* O_TEXT */ +#if !defined (_O_TEXT) +# define _O_TEXT O_TEXT +#endif /* _O_TEXT */ +#if !defined (O_RAW) +# define O_RAW 0 +#endif /* O_RAW */ +#if !defined (_O_RAW) +# define _O_RAW O_RAW +#endif /* _O_RAW */ + +#if defined (ACE_WIN32) +# define O_NDELAY 1 +#endif /* ACE_WIN32 */ + +# if !defined (O_NONBLOCK) +# define O_NONBLOCK 1 +# endif /* O_NONBLOCK */ + +#if defined (ACE_HAS_POSIX_NONBLOCK) +# define ACE_NONBLOCK O_NONBLOCK +#else +# define ACE_NONBLOCK O_NDELAY +#endif /* ACE_HAS_POSIX_NONBLOCK */ + +# if !defined (F_GETFL) +# define F_GETFL 0 +# endif /* F_GETFL */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FCNTL_H */ diff --git a/ACE/ace/os_include/os_fenv.h b/ACE/ace/os_include/os_fenv.h new file mode 100644 index 00000000000..68df26c2d67 --- /dev/null +++ b/ACE/ace/os_include/os_fenv.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_fenv.h + * + * floating-point environment + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FENV_H +#define ACE_OS_INCLUDE_OS_FENV_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_FENV_H) +# include /**/ <fenv.h> +#endif /* !ACE_LACKS_FENV_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FENV_H */ diff --git a/ACE/ace/os_include/os_float.h b/ACE/ace/os_include/os_float.h new file mode 100644 index 00000000000..94cfb3dc5ef --- /dev/null +++ b/ACE/ace/os_include/os_float.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_float.h + * + * floating types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FLOAT_H +#define ACE_OS_INCLUDE_OS_FLOAT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_FLOAT_H) +# include /**/ <float.h> +#endif /* !ACE_LACKS_FLOAT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FLOAT_H */ diff --git a/ACE/ace/os_include/os_fmtmsg.h b/ACE/ace/os_include/os_fmtmsg.h new file mode 100644 index 00000000000..5b779e4b3a0 --- /dev/null +++ b/ACE/ace/os_include/os_fmtmsg.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_fmtmsg.h + * + * message display structures + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FMTMSG_H +#define ACE_OS_INCLUDE_OS_FMTMSG_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_FMTMSG_H) +# include /**/ <fmtmsg.h> +#endif /* !ACE_LACKS_FMTMSG_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FMTMSG_H */ diff --git a/ACE/ace/os_include/os_fnmatch.h b/ACE/ace/os_include/os_fnmatch.h new file mode 100644 index 00000000000..779e05b32f5 --- /dev/null +++ b/ACE/ace/os_include/os_fnmatch.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_fnmatch.h + * + * filename-matching types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FNMATCH_H +#define ACE_OS_INCLUDE_OS_FNMATCH_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_FNMATCH_H) +# include /**/ <fnmatch.h> +#endif /* !ACE_LACKS_FNMATCH_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FNMATCH_H */ diff --git a/ACE/ace/os_include/os_ftw.h b/ACE/ace/os_include/os_ftw.h new file mode 100644 index 00000000000..b77bf18ead1 --- /dev/null +++ b/ACE/ace/os_include/os_ftw.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ftw.h + * + * file tree traversal + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_FTW_H +#define ACE_OS_INCLUDE_OS_FTW_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_stat.h" + +#if !defined (ACE_LACKS_FTW_H) +# include /**/ <ftw.h> +#endif /* !ACE_LACKS_FTW_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_FTW_H */ diff --git a/ACE/ace/os_include/os_glob.h b/ACE/ace/os_include/os_glob.h new file mode 100644 index 00000000000..daa47417e5f --- /dev/null +++ b/ACE/ace/os_include/os_glob.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_glob.h + * + * pathname pattern-matching types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_GLOB_H +#define ACE_OS_INCLUDE_OS_GLOB_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_GLOB_H) +# include /**/ <glob.h> +#endif /* !ACE_LACKS_GLOB_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_GLOB_H */ diff --git a/ACE/ace/os_include/os_grp.h b/ACE/ace/os_include/os_grp.h new file mode 100644 index 00000000000..9f912a0750c --- /dev/null +++ b/ACE/ace/os_include/os_grp.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_grp.h + * + * group structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_GRP_H +#define ACE_OS_INCLUDE_OS_GRP_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" // for gid_t + +#if !defined (ACE_LACKS_GRP_H) +# include /**/ <grp.h> +#endif /* !ACE_LACKS_GRP_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_GRP_H */ diff --git a/ACE/ace/os_include/os_iconv.h b/ACE/ace/os_include/os_iconv.h new file mode 100644 index 00000000000..36a81b3e25c --- /dev/null +++ b/ACE/ace/os_include/os_iconv.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_iconv.h + * + * codeset conversion facility + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ICONV_H +#define ACE_OS_INCLUDE_OS_ICONV_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_ICONV_H) +# include /**/ <iconv.h> +#endif /* !ACE_LACKS_ICONV_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ICONV_H */ diff --git a/ACE/ace/os_include/os_inttypes.h b/ACE/ace/os_include/os_inttypes.h new file mode 100644 index 00000000000..12ce23d9b8c --- /dev/null +++ b/ACE/ace/os_include/os_inttypes.h @@ -0,0 +1,46 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_inttypes.h + * + * fixed size integer types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_INTTYPES_H +#define ACE_OS_INCLUDE_OS_INTTYPES_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stdint.h" + +#if !defined (ACE_LACKS_INTTYPES_H) +# include /**/ <inttypes.h> +#endif /* !ACE_LACKS_INTTYPES_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// @todo if needbe, we can define the macros if they aren't available. + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_INTTYPES_H */ diff --git a/ACE/ace/os_include/os_iso646.h b/ACE/ace/os_include/os_iso646.h new file mode 100644 index 00000000000..3d724a9bb62 --- /dev/null +++ b/ACE/ace/os_include/os_iso646.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_iso646.h + * + * alternative spellings + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ISO646_H +#define ACE_OS_INCLUDE_OS_ISO646_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_ISO646_H) +# include /**/ <iso646.h> +#endif /* !ACE_LACKS_ISO646_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ISO646_H */ diff --git a/ACE/ace/os_include/os_langinfo.h b/ACE/ace/os_include/os_langinfo.h new file mode 100644 index 00000000000..9023750f8cd --- /dev/null +++ b/ACE/ace/os_include/os_langinfo.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_langinfo.h + * + * language information constants + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystem.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_LANGINFO_H +#define ACE_OS_INCLUDE_OS_LANGINFO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_nl_types.h" + +#if !defined (ACE_LACKS_LANGINFO_H) +# include /**/ <langinfo.h> +#endif /* !ACE_LACKS_LANGINFO_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_LANGINFO_H */ diff --git a/ACE/ace/os_include/os_libgen.h b/ACE/ace/os_include/os_libgen.h new file mode 100644 index 00000000000..d4043f02480 --- /dev/null +++ b/ACE/ace/os_include/os_libgen.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_libgen.h + * + * definitions for pattern matching functions + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_LIBGEN_H +#define ACE_OS_INCLUDE_OS_LIBGEN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_LIBGEN_H) +# include /**/ <libgen.h> +#endif /* !ACE_LACKS_LIBGEN_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_LIBGEN_H */ diff --git a/ACE/ace/os_include/os_limits.h b/ACE/ace/os_include/os_limits.h new file mode 100644 index 00000000000..17dba75622a --- /dev/null +++ b/ACE/ace/os_include/os_limits.h @@ -0,0 +1,143 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_limits.h + * + * implementation-defined constants + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_LIMITS_H +#define ACE_OS_INCLUDE_OS_LIMITS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_unistd.h" +#include "ace/os_include/os_stdio.h" // for FILENAME_MAX on Windows + +#if !defined (ACE_LACKS_LIMITS_H) +# include /**/ <limits.h> +#endif /* !ACE_LACKS_LIMITS_H */ + +#if !defined (ACE_LACKS_SYS_PARAM_H) +# include /**/ <sys/param.h> +#endif /* ACE_LACKS_SYS_PARAM_H */ + +// On VxWorks 5.5.1 _POSIX_TIMER_MAX is defined in time.h +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +# include /**/ <time.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if ! defined (howmany) +# define howmany(x, y) (((x)+((y)-1))/(y)) +#endif /* howmany */ + +#if !defined (NAME_MAX) +# if defined (MAXNAMLEN) +# define NAME_MAX MAXNAMLEN +# elif defined (MAXNAMELEN) +# define NAME_MAX MAXNAMELEN +# elif defined (FILENAME_MAX) +# define NAME_MAX FILENAME_MAX +# elif defined (_MAX_FNAME) +# define NAME_MAX _MAX_FNAME +# else /* _MAX_FNAME */ +# define NAME_MAX 256 +# endif /* MAXNAMLEN */ +#endif /* !NAME_MAX */ + +#if !defined (MAXNAMELEN) +# define MAXNAMELEN NAME_MAX +#endif /* MAXNAMELEN */ + +#if !defined (HOST_NAME_MAX) +# define HOST_NAME_MAX 256 +#endif /* !HOST_NAME_MAX */ + +// Note that we are using PATH_MAX instead of _POSIX_PATH_MAX, since +// _POSIX_PATH_MAX is the *minimun* maximum value for PATH_MAX and is +// defined by POSIX as 256. +#if !defined (PATH_MAX) +# if defined (_MAX_PATH) +# define PATH_MAX _MAX_PATH +# elif defined (MAX_PATH) +# define PATH_MAX MAX_PATH +# else /* !_MAX_PATH */ +# define PATH_MAX 1024 +# endif /* _MAX_PATH */ +#endif /* !PATH_MAX */ + +// Leaving this for backward compatibility, but PATH_MAX should always be +// used directly. +#if !defined (MAXPATHLEN) +# define MAXPATHLEN PATH_MAX +#endif /* !MAXPATHLEN */ + +// This is defined by XOPEN to be a minimum of 16. POSIX.1g +// also defines this value. platform-specific config.h can +// override this if need be. +#if !defined (IOV_MAX) +# define IOV_MAX 16 +#endif /* IOV_MAX */ + +#if !defined (ACE_IOV_MAX) +# define ACE_IOV_MAX IOV_MAX +#endif /* ACE_IOV_MAX */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS == 0x620) +# if defined (PIPE_BUF) && (PIPE_BUF == -1) +# undef PIPE_BUF +# endif +#endif /* ACE_VXWORKS == 0x620 */ + +#if !defined (PIPE_BUF) +# define PIPE_BUF 5120 +#endif /* PIPE_BUF */ + +#if defined (ACE_HAS_POSIX_REALTIME_SIGNALS) + // = Giving unique ACE scoped names for some important + // RTSignal-Related constants. Becuase sometimes, different + // platforms use different names for these constants. + + // Number of realtime signals provided in the system. + // _POSIX_RTSIG_MAX is the upper limit on the number of real time + // signals supported in a posix-4 compliant system. +# if defined (_POSIX_RTSIG_MAX) +# define ACE_RTSIG_MAX _POSIX_RTSIG_MAX +# else /* not _POSIX_RTSIG_MAX */ + // POSIX-4 compilant system has to provide atleast 8 RT signals. + // @@ Make sure the platform does *not* define this constant with + // some other name. If yes, use that instead of 8. +# define ACE_RTSIG_MAX 8 +# endif /* _POSIX_RTSIG_MAX */ +#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ + + // The maximum number of concurrent timers per process. +# if !defined (_POSIX_TIMER_MAX) +# define _POSIX_TIMER_MAX 44 +# endif /* _POSIX_TIMER_MAX */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_LIMITS_H */ diff --git a/ACE/ace/os_include/os_local.h b/ACE/ace/os_include/os_local.h new file mode 100644 index 00000000000..f50406a65de --- /dev/null +++ b/ACE/ace/os_include/os_local.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_local.h + * + * category macros + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_LOCAL_H +#define ACE_OS_INCLUDE_OS_LOCAL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" + +#if !defined (ACE_LACKS_LOCAL_H) +# include /**/ <local.h> +#endif /* !ACE_LACKS_LOCAL_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_LOCAL_H */ diff --git a/ACE/ace/os_include/os_math.h b/ACE/ace/os_include/os_math.h new file mode 100644 index 00000000000..9d0ccadba72 --- /dev/null +++ b/ACE/ace/os_include/os_math.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_math.h + * + * mathematical declarations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_MATH_H +#define ACE_OS_INCLUDE_OS_MATH_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// FUZZ: disable check_for_math_include + +#if !defined (ACE_LACKS_MATH_H) +# include /**/ <math.h> +#endif /* !ACE_LACKS_MATH_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_MATH_H */ diff --git a/ACE/ace/os_include/os_monetary.h b/ACE/ace/os_include/os_monetary.h new file mode 100644 index 00000000000..521347f351c --- /dev/null +++ b/ACE/ace/os_include/os_monetary.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_monetary.h + * + * monetary types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_MONETARY_H +#define ACE_OS_INCLUDE_OS_MONETARY_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_MONETARY_H) +# include /**/ <monetary.h> +#endif /* !ACE_LACKS_MONETARY_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_MONETARY_H */ diff --git a/ACE/ace/os_include/os_mqueue.h b/ACE/ace/os_include/os_mqueue.h new file mode 100644 index 00000000000..a85128d6037 --- /dev/null +++ b/ACE/ace/os_include/os_mqueue.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_mqueue.h + * + * message queues (REALTIME) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_MQUEUE_H +#define ACE_OS_INCLUDE_OS_MQUEUE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_signal.h" + +#if !defined (ACE_LACKS_MQUEUE_H) +# include /**/ <mqueue.h> +#endif /* !ACE_LACKS_MQUEUE_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_MQUEUE_H */ diff --git a/ACE/ace/os_include/os_ndbm.h b/ACE/ace/os_include/os_ndbm.h new file mode 100644 index 00000000000..4f8f66acc83 --- /dev/null +++ b/ACE/ace/os_include/os_ndbm.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ndbm.h + * + * definitions for ndbm database operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_NDBM_H +#define ACE_OS_INCLUDE_OS_NDBM_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_NDBM_H) +# include /**/ <ndbm.h> +#endif /* !ACE_LACKS_NDBM_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_NDBM_H */ diff --git a/ACE/ace/os_include/os_netdb.h b/ACE/ace/os_include/os_netdb.h new file mode 100644 index 00000000000..34e006f0f26 --- /dev/null +++ b/ACE/ace/os_include/os_netdb.h @@ -0,0 +1,80 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_netdb.h + * + * definitions for network database operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_NETDB_H +#define ACE_OS_INCLUDE_OS_NETDB_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/netinet/os_in.h" +#include "ace/os_include/os_limits.h" + +#if !defined (ACE_LACKS_NETDB_H) +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# define queue _Queue_ +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ + extern "C" { +# include /**/ <netdb.h> + } +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# undef queue +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ +#endif /* !ACE_LACKS_NETDB_H */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +# include /**/ <hostLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_STRUCT_NETDB_DATA) + typedef char ACE_HOSTENT_DATA[sizeof(struct hostent_data)]; + typedef char ACE_SERVENT_DATA[sizeof(struct servent_data)]; + typedef char ACE_PROTOENT_DATA[sizeof(struct protoent_data)]; +#else +# if !defined ACE_HOSTENT_DATA_SIZE +# define ACE_HOSTENT_DATA_SIZE (4*1024) +# endif /*ACE_HOSTENT_DATA_SIZE */ +# if !defined ACE_SERVENT_DATA_SIZE +# define ACE_SERVENT_DATA_SIZE (4*1024) +# endif /*ACE_SERVENT_DATA_SIZE */ +# if !defined ACE_PROTOENT_DATA_SIZE +# define ACE_PROTOENT_DATA_SIZE (2*1024) +# endif /*ACE_PROTOENT_DATA_SIZE */ + typedef char ACE_HOSTENT_DATA[ACE_HOSTENT_DATA_SIZE]; + typedef char ACE_SERVENT_DATA[ACE_SERVENT_DATA_SIZE]; + typedef char ACE_PROTOENT_DATA[ACE_PROTOENT_DATA_SIZE]; +#endif /* ACE_HAS_STRUCT_NETDB_DATA */ + +# if !defined(MAXHOSTNAMELEN) +# define MAXHOSTNAMELEN HOST_NAME_MAX +# endif /* MAXHOSTNAMELEN */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_NETDB_H */ diff --git a/ACE/ace/os_include/os_nl_types.h b/ACE/ace/os_include/os_nl_types.h new file mode 100644 index 00000000000..d84a8a734be --- /dev/null +++ b/ACE/ace/os_include/os_nl_types.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_nl_types.h + * + * data types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_NL_TYPES_H +#define ACE_OS_INCLUDE_OS_NL_TYPES_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_NL_TYPES_H) +# include /**/ <nl_types.h> +#endif /* !ACE_LACKS_nl_types_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_NL_TYPES_H */ diff --git a/ACE/ace/os_include/os_poll.h b/ACE/ace/os_include/os_poll.h new file mode 100644 index 00000000000..afb5bcc6993 --- /dev/null +++ b/ACE/ace/os_include/os_poll.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_poll.h + * + * definitions for the poll() function + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_POLL_H +#define ACE_OS_INCLUDE_OS_POLL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_POLL_H) +# include /**/ <poll.h> +#endif /* !ACE_LACKS_POLL_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_POLL_H */ diff --git a/ACE/ace/os_include/os_pthread.h b/ACE/ace/os_include/os_pthread.h new file mode 100644 index 00000000000..782d15b35a3 --- /dev/null +++ b/ACE/ace/os_include/os_pthread.h @@ -0,0 +1,459 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_pthread.h + * + * threads + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_PTHREAD_H +#define ACE_OS_INCLUDE_OS_PTHREAD_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_HAS_PRIOCNTL) + // Need to #include thread.h before #defining THR_BOUND, etc., + // when building without threads on SunOS 5.x. +# if defined (sun) +# include /**/ <thread.h> +# endif /* sun */ + + // Need to #include these before #defining USYNC_PROCESS on SunOS 5.x. +# include /**/ <sys/rtpriocntl.h> +# include /**/ <sys/tspriocntl.h> +#endif /* ACE_HAS_PRIOCNTL */ + +#include "ace/os_include/sys/os_types.h" + +// This needs to go here *first* to avoid problems with AIX. +# if defined (ACE_HAS_PTHREADS) +# define ACE_DONT_INCLUDE_ACE_SIGNAL_H +# include "ace/os_include/os_signal.h" +# undef ACE_DONT_INCLUDE_ACE_SIGNAL_H +# if defined (DIGITAL_UNIX) +# define pthread_self __pthread_self +extern "C" pthread_t pthread_self (void); +# endif /* DIGITAL_UNIX */ +# endif /* ACE_HAS_PTHREADS */ + + +#if !defined (ACE_LACKS_PTHREAD_H) + extern "C" { +# if defined (ACE_TANDEM_T1248_PTHREADS) +# include /**/ <spthread.h> +# else +# include /**/ <pthread.h> +# endif + } +#endif /* !ACE_LACKS_PTHREAD_H */ + +#if defined (ACE_HAS_PTHREAD_NP_H) +// FreeBSD declares _np (non-portable) pthread extensions in <pthread_np.h> +# include /**/ <pthread_np.h> +#endif + +// @todo: need to reoganize to put includes at the top and the rest of the +// code at the bottom. Also, move the classes out of this file. +#if defined (ACE_HAS_PTHREADS) +# define ACE_SCHED_OTHER SCHED_OTHER +# define ACE_SCHED_FIFO SCHED_FIFO +# define ACE_SCHED_RR SCHED_RR + +// Definitions for mapping POSIX pthreads draft 6 into 1003.1c names + +# if defined (ACE_HAS_PTHREADS_DRAFT6) +# define PTHREAD_SCOPE_PROCESS PTHREAD_SCOPE_LOCAL +# define PTHREAD_SCOPE_SYSTEM PTHREAD_SCOPE_GLOBAL +# define PTHREAD_CREATE_UNDETACHED 0 +# define PTHREAD_CREATE_DETACHED 1 +# define PTHREAD_CREATE_JOINABLE 0 +# define PTHREAD_EXPLICIT_SCHED 0 +# define PTHREAD_MIN_PRIORITY 0 +# define PTHREAD_MAX_PRIORITY 126 +# endif /* ACE_HAS_PTHREADS_DRAFT6 */ + +// Definitions for THREAD- and PROCESS-LEVEL priorities...some +// implementations define these while others don't. In order to +// further complicate matters, we don't redefine the default (*_DEF) +// values if they've already been defined, which allows individual +// programs to have their own ACE-wide "default". + +// PROCESS-level values +# if (defined (_POSIX_PRIORITY_SCHEDULING) || defined (ACE_TANDEM_T1248_PTHREADS)) \ + && !defined(_UNICOS) && !defined(UNIXWARE_7_1) +# define ACE_PROC_PRI_FIFO_MIN (sched_get_priority_min(SCHED_FIFO)) +# define ACE_PROC_PRI_RR_MIN (sched_get_priority_min(SCHED_RR)) +# if defined (HPUX) + // HP-UX's other is the SCHED_HPUX class, which uses historical + // values that have reverse semantics from POSIX (low value is + // more important priority). To use these in pthreads calls, + // the values need to be converted. The other scheduling classes + // don't need this special treatment. +# define ACE_PROC_PRI_OTHER_MIN \ + (sched_get_priority_min(SCHED_OTHER)) +# else +# define ACE_PROC_PRI_OTHER_MIN (sched_get_priority_min(SCHED_OTHER)) +# endif /* HPUX */ +# else /* UNICOS is missing a sched_get_priority_min() implementation, + SCO too */ +# define ACE_PROC_PRI_FIFO_MIN 0 +# define ACE_PROC_PRI_RR_MIN 0 +# define ACE_PROC_PRI_OTHER_MIN 0 +# endif + +# if defined (_POSIX_PRIORITY_SCHEDULING) && !defined(UNIXWARE_7_1) +# define ACE_PROC_PRI_FIFO_MAX (sched_get_priority_max(SCHED_FIFO)) +# define ACE_PROC_PRI_RR_MAX (sched_get_priority_max(SCHED_RR)) +# if defined (HPUX) +# define ACE_PROC_PRI_OTHER_MAX \ + (sched_get_priority_max(SCHED_OTHER)) +# else +# define ACE_PROC_PRI_OTHER_MAX (sched_get_priority_max(SCHED_OTHER)) +# endif /* HPUX */ +# else /* SCO missing sched_get_priority_max() implementation */ +# define ACE_PROC_PRI_FIFO_MAX 59 +# define ACE_PROC_PRI_RR_MAX 59 +# define ACE_PROC_PRI_OTHER_MAX 59 +# endif + +# if !defined(ACE_PROC_PRI_FIFO_DEF) +# define ACE_PROC_PRI_FIFO_DEF (ACE_PROC_PRI_FIFO_MIN + (ACE_PROC_PRI_FIFO_MAX - ACE_PROC_PRI_FIFO_MIN)/2) +# endif +# if !defined(ACE_PROC_PRI_RR_DEF) +# define ACE_PROC_PRI_RR_DEF (ACE_PROC_PRI_RR_MIN + (ACE_PROC_PRI_RR_MAX - ACE_PROC_PRI_RR_MIN)/2) +# endif +# if !defined(ACE_PROC_PRI_OTHER_DEF) +# define ACE_PROC_PRI_OTHER_DEF (ACE_PROC_PRI_OTHER_MIN + (ACE_PROC_PRI_OTHER_MAX - ACE_PROC_PRI_OTHER_MIN)/2) +# endif + +// THREAD-level values +# if defined(PRI_FIFO_MIN) && defined(PRI_FIFO_MAX) && defined(PRI_RR_MIN) && defined(PRI_RR_MAX) && defined(PRI_OTHER_MIN) && defined(PRI_OTHER_MAX) +# if !defined (ACE_THR_PRI_FIFO_MIN) +# define ACE_THR_PRI_FIFO_MIN (long) PRI_FIFO_MIN +# endif /* !ACE_THR_PRI_FIFO_MIN */ +# if !defined (ACE_THR_PRI_FIFO_MAX) +# define ACE_THR_PRI_FIFO_MAX (long) PRI_FIFO_MAX +# endif /* !ACE_THR_PRI_FIFO_MAX */ +# if !defined (ACE_THR_PRI_RR_MIN) +# define ACE_THR_PRI_RR_MIN (long) PRI_RR_MIN +# endif /* !ACE_THR_PRI_RR_MIN */ +# if !defined (ACE_THR_PRI_RR_MAX) +# define ACE_THR_PRI_RR_MAX (long) PRI_RR_MAX +# endif /* !ACE_THR_PRI_RR_MAX */ +# if !defined (ACE_THR_PRI_OTHER_MIN) +# define ACE_THR_PRI_OTHER_MIN (long) PRI_OTHER_MIN +# endif /* !ACE_THR_PRI_OTHER_MIN */ +# if !defined (ACE_THR_PRI_OTHER_MAX) +# define ACE_THR_PRI_OTHER_MAX (long) PRI_OTHER_MAX +# endif /* !ACE_THR_PRI_OTHER_MAX */ +# elif defined (AIX) + // AIX's priority range is 1 (low) to 127 (high). There aren't + // any preprocessor macros I can find. PRIORITY_MIN is for + // process priorities, as far as I can see, and does not apply + // to thread priority. The 1 to 127 range is from the + // pthread_attr_setschedparam man page (Steve Huston, 18-May-2001). +# if !defined (ACE_THR_PRI_FIFO_MIN) +# define ACE_THR_PRI_FIFO_MIN (long) 1 +# endif /* !ACE_THR_PRI_FIFO_MIN */ +# if !defined (ACE_THR_PRI_FIFO_MAX) +# define ACE_THR_PRI_FIFO_MAX (long) 127 +# endif /* !ACE_THR_PRI_FIFO_MAX */ +# if !defined (ACE_THR_PRI_RR_MIN) +# define ACE_THR_PRI_RR_MIN (long) 1 +# endif /* !ACE_THR_PRI_RR_MIN */ +# if !defined (ACE_THR_PRI_RR_MAX) +# define ACE_THR_PRI_RR_MAX (long) 127 +# endif /* !ACE_THR_PRI_RR_MAX */ +# if !defined (ACE_THR_PRI_OTHER_MIN) +# define ACE_THR_PRI_OTHER_MIN (long) 1 +# endif /* !ACE_THR_PRI_OTHER_MIN */ +# if !defined (ACE_THR_PRI_OTHER_MAX) +# define ACE_THR_PRI_OTHER_MAX (long) 127 +# endif /* !ACE_THR_PRI_OTHER_MAX */ +# elif defined (sun) +# if !defined (ACE_THR_PRI_FIFO_MIN) +# define ACE_THR_PRI_FIFO_MIN (long) 0 +# endif /* !ACE_THR_PRI_FIFO_MIN */ +# if !defined (ACE_THR_PRI_FIFO_MAX) +# define ACE_THR_PRI_FIFO_MAX (long) 59 +# endif /* !ACE_THR_PRI_FIFO_MAX */ +# if !defined (ACE_THR_PRI_RR_MIN) +# define ACE_THR_PRI_RR_MIN (long) 0 +# endif /* !ACE_THR_PRI_RR_MIN */ +# if !defined (ACE_THR_PRI_RR_MAX) +# define ACE_THR_PRI_RR_MAX (long) 59 +# endif /* !ACE_THR_PRI_RR_MAX */ +# if !defined (ACE_THR_PRI_OTHER_MIN) +# define ACE_THR_PRI_OTHER_MIN (long) 0 +# endif /* !ACE_THR_PRI_OTHER_MIN */ +# if !defined (ACE_THR_PRI_OTHER_MAX) +# define ACE_THR_PRI_OTHER_MAX (long) 127 +# endif /* !ACE_THR_PRI_OTHER_MAX */ +# else +# if !defined (ACE_THR_PRI_FIFO_MIN) +# define ACE_THR_PRI_FIFO_MIN (long) ACE_PROC_PRI_FIFO_MIN +# endif /* !ACE_THR_PRI_FIFO_MIN */ +# if !defined (ACE_THR_PRI_FIFO_MAX) +# define ACE_THR_PRI_FIFO_MAX (long) ACE_PROC_PRI_FIFO_MAX +# endif /* !ACE_THR_PRI_FIFO_MAX */ +# if !defined (ACE_THR_PRI_RR_MIN) +# define ACE_THR_PRI_RR_MIN (long) ACE_PROC_PRI_RR_MIN +# endif /* !ACE_THR_PRI_RR_MIN */ +# if !defined (ACE_THR_PRI_RR_MAX) +# define ACE_THR_PRI_RR_MAX (long) ACE_PROC_PRI_RR_MAX +# endif /* !ACE_THR_PRI_RR_MAX */ +# if !defined (ACE_THR_PRI_OTHER_MIN) +# define ACE_THR_PRI_OTHER_MIN (long) ACE_PROC_PRI_OTHER_MIN +# endif /* !ACE_THR_PRI_OTHER_MIN */ +# if !defined (ACE_THR_PRI_OTHER_MAX) +# define ACE_THR_PRI_OTHER_MAX (long) ACE_PROC_PRI_OTHER_MAX +# endif /* !ACE_THR_PRI_OTHER_MAX */ +# endif +# if !defined(ACE_THR_PRI_FIFO_DEF) +# define ACE_THR_PRI_FIFO_DEF ((ACE_THR_PRI_FIFO_MIN + ACE_THR_PRI_FIFO_MAX)/2) +# endif +# if !defined(ACE_THR_PRI_RR_DEF) +# define ACE_THR_PRI_RR_DEF ((ACE_THR_PRI_RR_MIN + ACE_THR_PRI_RR_MAX)/2) +# endif +# if !defined(ACE_THR_PRI_OTHER_DEF) +# define ACE_THR_PRI_OTHER_DEF ((ACE_THR_PRI_OTHER_MIN + ACE_THR_PRI_OTHER_MAX)/2) +# endif + // Typedefs to help compatibility with Windows NT and Pthreads. + typedef pthread_t ACE_hthread_t; + typedef pthread_t ACE_thread_t; + + // native TSS key type + typedef pthread_key_t ACE_OS_thread_key_t; + // TSS key type to be used by application +# if defined (ACE_HAS_TSS_EMULATION) + typedef u_int ACE_thread_key_t; +# else /* ! ACE_HAS_TSS_EMULATION */ + typedef ACE_OS_thread_key_t ACE_thread_key_t; +# endif /* ! ACE_HAS_TSS_EMULATION */ + +# if !defined (ACE_LACKS_COND_T) + typedef pthread_mutex_t ACE_mutex_t; + typedef pthread_cond_t ACE_cond_t; + typedef pthread_condattr_t ACE_condattr_t; + typedef pthread_mutexattr_t ACE_mutexattr_t; +# endif /* ! ACE_LACKS_COND_T */ + typedef pthread_mutex_t ACE_thread_mutex_t; + +# if !defined (PTHREAD_CANCEL_DISABLE) +# define PTHREAD_CANCEL_DISABLE 0 +# endif /* PTHREAD_CANCEL_DISABLE */ + +# if !defined (PTHREAD_CANCEL_ENABLE) +# define PTHREAD_CANCEL_ENABLE 0 +# endif /* PTHREAD_CANCEL_ENABLE */ + +# if !defined (PTHREAD_CANCEL_DEFERRED) +# define PTHREAD_CANCEL_DEFERRED 0 +# endif /* PTHREAD_CANCEL_DEFERRED */ + +# if !defined (PTHREAD_CANCEL_ASYNCHRONOUS) +# define PTHREAD_CANCEL_ASYNCHRONOUS 0 +# endif /* PTHREAD_CANCEL_ASYNCHRONOUS */ + +# define THR_CANCEL_DISABLE PTHREAD_CANCEL_DISABLE +# define THR_CANCEL_ENABLE PTHREAD_CANCEL_ENABLE +# define THR_CANCEL_DEFERRED PTHREAD_CANCEL_DEFERRED +# define THR_CANCEL_ASYNCHRONOUS PTHREAD_CANCEL_ASYNCHRONOUS + +# if !defined (PTHREAD_CREATE_JOINABLE) +# if defined (PTHREAD_CREATE_UNDETACHED) +# define PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED +# else +# define PTHREAD_CREATE_JOINABLE 0 +# endif /* PTHREAD_CREATE_UNDETACHED */ +# endif /* PTHREAD_CREATE_JOINABLE */ + +# if !defined (PTHREAD_CREATE_DETACHED) +# define PTHREAD_CREATE_DETACHED 1 +# endif /* PTHREAD_CREATE_DETACHED */ + +# if !defined (PTHREAD_PROCESS_PRIVATE) && !defined (ACE_HAS_PTHREAD_PROCESS_ENUM) +# if defined (PTHREAD_MUTEXTYPE_FAST) +# define PTHREAD_PROCESS_PRIVATE PTHREAD_MUTEXTYPE_FAST +# else +# define PTHREAD_PROCESS_PRIVATE 0 +# endif /* PTHREAD_MUTEXTYPE_FAST */ +# endif /* PTHREAD_PROCESS_PRIVATE */ + +# if !defined (PTHREAD_PROCESS_SHARED) && !defined (ACE_HAS_PTHREAD_PROCESS_ENUM) +# if defined (PTHREAD_MUTEXTYPE_FAST) +# define PTHREAD_PROCESS_SHARED PTHREAD_MUTEXTYPE_FAST +# else +# define PTHREAD_PROCESS_SHARED 1 +# endif /* PTHREAD_MUTEXTYPE_FAST */ +# endif /* PTHREAD_PROCESS_SHARED */ + +# if defined (ACE_HAS_PTHREADS_DRAFT4) +# if defined (PTHREAD_PROCESS_PRIVATE) +# if !defined (USYNC_THREAD) +# define USYNC_THREAD PTHREAD_PROCESS_PRIVATE +# endif /* ! USYNC_THREAD */ +# else +# if !defined (USYNC_THREAD) +# define USYNC_THREAD MUTEX_NONRECURSIVE_NP +# endif /* ! USYNC_THREAD */ +# endif /* PTHREAD_PROCESS_PRIVATE */ + +# if defined (PTHREAD_PROCESS_SHARED) +# if !defined (USYNC_PROCESS) +# define USYNC_PROCESS PTHREAD_PROCESS_SHARED +# endif /* ! USYNC_PROCESS */ +# else +# if !defined (USYNC_PROCESS) +# define USYNC_PROCESS MUTEX_NONRECURSIVE_NP +# endif /* ! USYNC_PROCESS */ +# endif /* PTHREAD_PROCESS_SHARED */ +# elif !defined (ACE_HAS_STHREADS) +# if !defined (USYNC_THREAD) +# define USYNC_THREAD PTHREAD_PROCESS_PRIVATE +# endif /* ! USYNC_THREAD */ +# if !defined (USYNC_PROCESS) +# define USYNC_PROCESS PTHREAD_PROCESS_SHARED +# endif /* ! USYNC_PROCESS */ +# endif /* ACE_HAS_PTHREADS_DRAFT4 */ + + /* MM-Graz: prevent warnings */ +# if !defined (UNIXWARE_7_1) +# undef THR_BOUND +# undef THR_NEW_LWP +# undef THR_DETACHED +# undef THR_SUSPENDED +# undef THR_DAEMON + +# define THR_BOUND 0x00000001 +# define THR_NEW_LWP 0x00000002 +# define THR_DETACHED 0x00000040 +# define THR_SUSPENDED 0x00000080 +# define THR_DAEMON 0x00000100 +# define THR_SCHED_FIFO 0x00020000 +# define THR_SCHED_RR 0x00040000 +# define THR_SCHED_DEFAULT 0x00080000 +# endif /* UNIXWARE_7_1 */ + +# define THR_JOINABLE 0x00010000 + +# if defined (ACE_HAS_IRIX62_THREADS) +# define THR_SCOPE_SYSTEM 0x00100000 +# else +# define THR_SCOPE_SYSTEM THR_BOUND +# endif /*ACE_HAS_IRIX62_THREADS*/ + +# define THR_SCOPE_PROCESS 0x00200000 +# define THR_INHERIT_SCHED 0x00400000 +# define THR_EXPLICIT_SCHED 0x00800000 +# define THR_SCHED_IO 0x01000000 + +# if !defined (ACE_HAS_STHREADS) +# if !defined (ACE_HAS_POSIX_SEM) && !defined (ACE_USES_FIFO_SEM) + +// This needs to be moved out of here. +#include "ace/ACE_export.h" +/** + * @class ACE_sema_t + * + * @brief This is used to implement semaphores for platforms that support + * POSIX pthreads, but do *not* support POSIX semaphores, i.e., + * it's a different type than the POSIX <sem_t>. + */ +class ACE_Export ACE_sema_t +{ +public: + /// Serialize access to internal state. + ACE_mutex_t lock_; + + /// Block until there are no waiters. + ACE_cond_t count_nonzero_; + + /// Count of the semaphore. + u_long count_; + + /// Number of threads that have called <ACE_OS::sema_wait>. + u_long waiters_; +}; +# endif /* !ACE_HAS_POSIX_SEM */ + +# if defined (ACE_LACKS_PTHREAD_YIELD) && defined (ACE_HAS_THR_YIELD) + // If we are on Solaris we can just reuse the existing + // implementations of these synchronization types. +# if !defined (ACE_LACKS_RWLOCK_T) +# include /**/ <synch.h> + typedef rwlock_t ACE_rwlock_t; +# endif /* !ACE_LACKS_RWLOCK_T */ +# include /**/ <thread.h> +# endif /* (ACE_LACKS_PTHREAD_YIELD) && defined (ACE_HAS_THR_YIELD) */ + +# else +# if !defined (ACE_HAS_POSIX_SEM) + typedef sema_t ACE_sema_t; +# endif /* !ACE_HAS_POSIX_SEM */ +# endif /* !ACE_HAS_STHREADS */ + +# if defined (ACE_HAS_PTHREADS_UNIX98_EXT) + typedef pthread_rwlock_t ACE_rwlock_t; +# endif /* ACE_HAS_PTHREADS_UNIX98_EXT */ + +# if defined (__GLIBC__) && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) + + // glibc 2.2.x or better has pthread_mutex_timedlock() +# ifndef ACE_HAS_MUTEX_TIMEOUTS +# define ACE_HAS_MUTEX_TIMEOUTS +# endif /* ACE_HAS_MUTEX_TIMEOUTS */ + + // Use new pthread_attr_setstack if XPG6 support is enabled. +# if defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) >= 600 +# if !defined (ACE_HAS_PTHREAD_SETSTACK) +# define ACE_HAS_PTHREAD_SETSTACK +# endif /* ACE_HAS_PTHREAD_SETSTACK */ +# endif /* (_XOPEN_SOURCE - 0) >= 600 */ + +# if !defined (_XOPEN_SOURCE) \ + || (defined (_XOPEN_SOURCE) && (_XOPEN_SOURCE - 0) < 600) + // pthread_mutex_timedlock() prototype is not visible if _XOPEN_SOURCE + // is not >= 600 (i.e. for XPG6). + extern "C" int pthread_mutex_timedlock (pthread_mutex_t *mutex, + const struct timespec * abstime); +# endif /* _XOPEN_SOURCE && _XOPEN_SOURCE < 600 */ + +# endif /* linux && ((__GLIBC__ > 2) || (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 2)) */ + +#elif defined (ACE_HAS_STHREADS) +# if !defined (ACE_THR_PRI_FIFO_MIN) +# define ACE_THR_PRI_FIFO_MIN (long) 0 +# endif /* !ACE_THR_PRI_FIFO_MIN */ +# if !defined (ACE_THR_PRI_FIFO_MAX) +# define ACE_THR_PRI_FIFO_MAX (long) 59 +# endif /* !ACE_THR_PRI_FIFO_MAX */ +# if !defined (ACE_THR_PRI_RR_MIN) +# define ACE_THR_PRI_RR_MIN (long) 0 +# endif /* !ACE_THR_PRI_RR_MIN */ +# if !defined (ACE_THR_PRI_RR_MAX) +# define ACE_THR_PRI_RR_MAX (long) 59 +# endif /* !ACE_THR_PRI_RR_MAX */ +# if !defined (ACE_THR_PRI_OTHER_MIN) +# define ACE_THR_PRI_OTHER_MIN (long) 0 +# endif /* !ACE_THR_PRI_OTHER_MIN */ +# if !defined (ACE_THR_PRI_OTHER_MAX) +# define ACE_THR_PRI_OTHER_MAX (long) 127 +# endif /* !ACE_THR_PRI_OTHER_MAX */ +#endif /* ACE_HAS_PTHREADS */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_PTHREAD_H */ diff --git a/ACE/ace/os_include/os_pwd.h b/ACE/ace/os_include/os_pwd.h new file mode 100644 index 00000000000..da08eb17ab9 --- /dev/null +++ b/ACE/ace/os_include/os_pwd.h @@ -0,0 +1,58 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_pwd.h + * + * password structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_PWD_H +#define ACE_OS_INCLUDE_OS_PWD_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_PWD_H) +# include /**/ <pwd.h> +#endif /* !ACE_LACKS_PWD_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if !defined (ACE_WIN32) +// VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined +// in pwd.h, and that redefinition is used here +# if defined (_AIX) && defined (__IBMCPP__) && (__IBMCPP__ >= 400) + extern int _posix_getpwnam_r(const char *, struct passwd *, char *, + int, struct passwd **); +# endif /* AIX and VAC++ 4 */ +#endif /* !ACE_WIN32 */ + +#if defined (DIGITAL_UNIX) + extern int _Pgetpwnam_r (const char *, struct passwd *, + char *, size_t, struct passwd **); +#endif /* DIGITAL_UNIX */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_PWD_H */ diff --git a/ACE/ace/os_include/os_regex.h b/ACE/ace/os_include/os_regex.h new file mode 100644 index 00000000000..fdc323c2a6d --- /dev/null +++ b/ACE/ace/os_include/os_regex.h @@ -0,0 +1,48 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_regex.h + * + * regular expression matching types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_REGEX_H +#define ACE_OS_INCLUDE_OS_REGEX_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_REGEX_H) +# include /**/ <regex.h> +#endif /* !ACE_LACKS_REGEX_H */ + +#if defined (ACE_HAS_REGEX) +# include /**/ <regexpr.h> +#endif /* ACE_HAS_REGEX */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_REGEX_H */ diff --git a/ACE/ace/os_include/os_sched.h b/ACE/ace/os_include/os_sched.h new file mode 100644 index 00000000000..4a536703218 --- /dev/null +++ b/ACE/ace/os_include/os_sched.h @@ -0,0 +1,52 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_sched.h + * + * execution scheduling (REALTIME) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SCHED_H +#define ACE_OS_INCLUDE_OS_SCHED_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_time.h" + +#if !defined (ACE_LACKS_SCHED_H) +# include /**/ <sched.h> +#endif /* !ACE_LACKS_SCHED_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if !defined (__cpu_set_t_defined) || !defined (ACE_HAS_CPU_SET_T) +# define ACE_CPU_SETSIZE 1024 + typedef struct + { + ACE_UINT32 bit_array_[ACE_CPU_SETSIZE / (8 * sizeof (ACE_UINT32))]; + } cpu_set_t; +#endif /* !ACE_HAS_CPU_SET_T || !__cpu_set_t_defined */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SCHED_H */ diff --git a/ACE/ace/os_include/os_search.h b/ACE/ace/os_include/os_search.h new file mode 100644 index 00000000000..c27930b5e92 --- /dev/null +++ b/ACE/ace/os_include/os_search.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_search.h + * + * search tables + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SEARCH_H +#define ACE_OS_INCLUDE_OS_SEARCH_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SEARCH_H) +# include /**/ <search.h> +#endif /* !ACE_LACKS_SEARCH_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SEARCH_H */ diff --git a/ACE/ace/os_include/os_semaphore.h b/ACE/ace/os_include/os_semaphore.h new file mode 100644 index 00000000000..a703c55d368 --- /dev/null +++ b/ACE/ace/os_include/os_semaphore.h @@ -0,0 +1,77 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_semaphore.h + * + * semaphores (REALTIME) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SEMAPHORE_H +#define ACE_OS_INCLUDE_OS_SEMAPHORE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_time.h" + +#if !defined (ACE_LACKS_SEMAPHORE_H) +# include /**/ <semaphore.h> +#endif /* !ACE_LACKS_SEMAPHORE_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_POSIX_SEM) +# if !defined (SEM_FAILED) && !defined (ACE_LACKS_NAMED_POSIX_SEM) +# define SEM_FAILED ((sem_t *) -1) +# endif /* !SEM_FAILED */ + + typedef struct + { + /// Pointer to semaphore handle. This is allocated by ACE if we are + /// working with an unnamed POSIX semaphore or by the OS if we are + /// working with a named POSIX semaphore. + sem_t *sema_; + + /// Name of the semaphore (if this is non-NULL then this is a named + /// POSIX semaphore, else its an unnamed POSIX semaphore). + char *name_; + +# if defined (ACE_LACKS_NAMED_POSIX_SEM) + /// this->sema_ doesn't always get created dynamically if a platform + /// doesn't support named posix semaphores. We use this flag to + /// remember if we need to delete <sema_> or not. + int new_sema_; +# endif /* ACE_LACKS_NAMED_POSIX_SEM */ + +# if !defined (ACE_HAS_POSIX_SEM_TIMEOUT) + /// Serialize access to internal state. + ACE_mutex_t lock_; + + /// Block until there are no waiters. + ACE_cond_t count_nonzero_; +# endif /* !ACE_HAS_POSIX_SEM_TIMEOUT */ + } ACE_sema_t; +#endif /* ACE_HAS_POSIX_SEM */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SEMAPHORE_H */ diff --git a/ACE/ace/os_include/os_setjmp.h b/ACE/ace/os_include/os_setjmp.h new file mode 100644 index 00000000000..b4da93bfa0a --- /dev/null +++ b/ACE/ace/os_include/os_setjmp.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_setjmp.h + * + * stack environment declarations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SETJMP_H +#define ACE_OS_INCLUDE_OS_SETJMP_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_SETJMP_H) +# include /**/ <setjmp.h> +#endif /* !ACE_LACKS_SETJMP_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SETJMP_H */ diff --git a/ACE/ace/os_include/os_signal.h b/ACE/ace/os_include/os_signal.h new file mode 100644 index 00000000000..c85865af90e --- /dev/null +++ b/ACE/ace/os_include/os_signal.h @@ -0,0 +1,280 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_signal.h + * + * signals + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SIGNAL_H +#define ACE_OS_INCLUDE_OS_SIGNAL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SIGNAL_H) + extern "C" { +# include /**/ <signal.h> + } +#endif /* !ACE_LACKS_SIGNAL_H */ + +// This must come after signal.h is #included. +#if defined (SCO) +# define SIGIO SIGPOLL +# include /**/ <sys/regset.h> +#endif /* SCO */ + +#if defined (ACE_HAS_SIGINFO_T) +# if !defined (ACE_LACKS_SIGINFO_H) +# if defined (__QNX__) || defined (__OpenBSD__) || defined (__INTERIX) +# include /**/ <sys/siginfo.h> +# else /* __QNX__ || __OpenBSD__ */ +# include /**/ <siginfo.h> +# endif /* __QNX__ || __OpenBSD__ */ +# endif /* ACE_LACKS_SIGINFO_H */ +#endif /* ACE_HAS_SIGINFO_T */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) && !defined (__RTP__) +# include /**/ <sigLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_SIGSET) + typedef u_int sigset_t; +#endif /* ACE_LACKS_SIGSET */ + +#if defined (ACE_HAS_SIG_MACROS) +# undef sigemptyset +# undef sigfillset +# undef sigaddset +# undef sigdelset +# undef sigismember +#endif /* ACE_HAS_SIG_MACROS */ + +// This must come after signal.h is #included. It's to counteract +// the sigemptyset and sigfillset #defines, which only happen +// when __OPTIMIZE__ is #defined (really!) on Linux. +#if defined (linux) && defined (__OPTIMIZE__) +# undef sigemptyset +# undef sigfillset +#endif /* linux && __OPTIMIZE__ */ + +#if !defined (ACE_HAS_SIG_ATOMIC_T) + typedef int sig_atomic_t; +#endif /* !ACE_HAS_SIG_ATOMIC_T */ + +# if !defined (SA_SIGINFO) +# define SA_SIGINFO 0 +# endif /* SA_SIGINFO */ + +# if !defined (SA_RESTART) +# define SA_RESTART 0 +# endif /* SA_RESTART */ + +#if !defined (SIGHUP) +# define SIGHUP 0 +#endif /* SIGHUP */ + +#if !defined (SIGINT) +# define SIGINT 0 +#endif /* SIGINT */ + +#if !defined (SIGSEGV) +# define SIGSEGV 0 +#endif /* SIGSEGV */ + +#if !defined (SIGIO) +# define SIGIO 0 +#endif /* SIGSEGV */ + +#if !defined (SIGUSR1) +# define SIGUSR1 0 +#endif /* SIGUSR1 */ + +#if !defined (SIGUSR2) +# define SIGUSR2 0 +#endif /* SIGUSR2 */ + +#if !defined (SIGCHLD) +# define SIGCHLD 0 +#endif /* SIGCHLD */ + +#if !defined (SIGCLD) +# define SIGCLD SIGCHLD +#endif /* SIGCLD */ + +#if !defined (SIGQUIT) +# define SIGQUIT 0 +#endif /* SIGQUIT */ + +#if !defined (SIGPIPE) +# define SIGPIPE 0 +#endif /* SIGPIPE */ + +#if !defined (SIGALRM) +# define SIGALRM 0 +#endif /* SIGALRM */ + +#if !defined (SIG_DFL) +# define SIG_DFL ((__sighandler_t) 0) +#endif /* SIG_DFL */ + +#if !defined (SIG_IGN) +# define SIG_IGN ((__sighandler_t) 1) /* ignore signal */ +#endif /* SIG_IGN */ + +#if !defined (SIG_ERR) +# define SIG_ERR ((__sighandler_t) -1) /* error return from signal */ +#endif /* SIG_ERR */ + +// These are used by the <ACE_IPC_SAP::enable> and +// <ACE_IPC_SAP::disable> methods. They must be unique and cannot +// conflict with the value of <ACE_NONBLOCK>. We make the numbers +// negative here so they won't conflict with other values like SIGIO, +// etc. +# define ACE_SIGIO -1 +# define ACE_SIGURG -2 +# define ACE_CLOEXEC -3 + +#if defined (ACE_VXWORKS) +# define ACE_NSIG (_NSIGS + 1) +#elif defined (__Lynx__) +# define ACE_NSIG (NSIG + 1) +#elif defined (__rtems__) +# define ACE_NSIG (SIGRTMAX) +#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x600) +# define ACE_NSIG _NSIG +#else + // All other platforms set NSIG to one greater than the + // highest-numbered signal. +# define ACE_NSIG NSIG +#endif /* __Lynx__ */ + +#if defined (ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES) + // Prototypes for both signal() and struct sigaction are consistent.. + //# if defined (ACE_HAS_SIG_C_FUNC) + // extern "C" { + //# endif /* ACE_HAS_SIG_C_FUNC */ + typedef void (*ACE_SignalHandler)(int); + typedef void (*ACE_SignalHandlerV)(int); + //# if defined (ACE_HAS_SIG_C_FUNC) + // } + //# endif /* ACE_HAS_SIG_C_FUNC */ +#elif defined (ACE_HAS_LYNXOS_SIGNALS) + typedef void (*ACE_SignalHandler)(...); + typedef void (*ACE_SignalHandlerV)(...); +#elif defined (ACE_HAS_TANDEM_SIGNALS) + typedef void (*ACE_SignalHandler)(...); + typedef void (*ACE_SignalHandlerV)(...); +#elif defined (ACE_HAS_IRIX_53_SIGNALS) + typedef void (*ACE_SignalHandler)(...); + typedef void (*ACE_SignalHandlerV)(...); +#elif defined (ACE_HAS_SPARCWORKS_401_SIGNALS) + typedef void (*ACE_SignalHandler)(int, ...); + typedef void (*ACE_SignalHandlerV)(int,...); +#elif defined (ACE_HAS_SUNOS4_SIGNAL_T) + typedef void (*ACE_SignalHandler)(...); + typedef void (*ACE_SignalHandlerV)(...); +#elif defined (ACE_HAS_SVR4_SIGNAL_T) + // SVR4 Signals are inconsistent (e.g., see struct sigaction).. + typedef void (*ACE_SignalHandler)(int); +# if !defined (m88k) /* with SVR4_SIGNAL_T */ + typedef void (*ACE_SignalHandlerV)(void); +# else + typedef void (*ACE_SignalHandlerV)(int); +# endif /* m88k */ /* with SVR4_SIGNAL_T */ +#elif defined (ACE_WIN32) + typedef void (__cdecl *ACE_SignalHandler)(int); + typedef void (__cdecl *ACE_SignalHandlerV)(int); +#elif defined (ACE_HAS_UNIXWARE_SVR4_SIGNAL_T) + typedef void (*ACE_SignalHandler)(int); + typedef void (*ACE_SignalHandlerV)(...); +#elif defined (INTEGRITY) + typedef void (*ACE_SignalHandler)(); + typedef void (*ACE_SignalHandlerV)(int); +#else /* This is necessary for some older broken version of cfront */ +# if defined (SIG_PF) +# define ACE_SignalHandler SIG_PF +# else + typedef void (*ACE_SignalHandler)(int); +# endif /* SIG_PF */ + typedef void (*ACE_SignalHandlerV)(...); +#endif /* ACE_HAS_CONSISTENT_SIGNAL_PROTOTYPES */ + +#if defined (ACE_LACKS_SIGACTION) + struct sigaction + { + int sa_flags; + ACE_SignalHandlerV sa_handler; + sigset_t sa_mask; + }; +#endif /* ACE_LACKS_SIGACTION */ + +// Defining POSIX4 real-time signal range. +#if defined(ACE_HAS_POSIX_REALTIME_SIGNALS) +#define ACE_SIGRTMIN SIGRTMIN +#define ACE_SIGRTMAX SIGRTMAX + +#else /* !ACE_HAS_POSIX_REALTIME_SIGNALS */ + +#ifndef ACE_SIGRTMIN +#define ACE_SIGRTMIN 0 +#endif /* ACE_SIGRTMIN */ + +#ifndef ACE_SIGRTMAX +#define ACE_SIGRTMAX 0 +#endif /* ACE_SIGRTMAX */ + +#endif /* ACE_HAS_POSIX_REALTIME_SIGNALS */ + +#if defined (DIGITAL_UNIX) + // sigwait is yet another macro on Digital UNIX 4.0, just causing + // trouble when introducing member functions with the same name. + // Thanks to Thilo Kielmann" <kielmann@informatik.uni-siegen.de> for + // this fix. +# if defined (__DECCXX_VER) +# undef sigwait + // cxx on Digital Unix 4.0 needs this declaration. With it, + // <::_Psigwait> works with cxx -pthread. g++ does _not_ need + // it. + int _Psigwait __((const sigset_t *set, int *sig)); +# endif /* __DECCXX_VER */ +#elif !defined (ACE_HAS_SIGWAIT) +# if defined(__rtems__) + int sigwait (const sigset_t *set, int *sig); +# else + int sigwait (sigset_t *set); +# endif /* __rtems__ */ +#endif /* ! DIGITAL_UNIX && ! ACE_HAS_SIGWAIT */ + +#if !defined (ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE) + int pthread_sigmask(int, const sigset_t *, sigset_t *); +#endif /*!ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include "ace/os_include/os_ucontext.h" + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SIGNAL_H */ diff --git a/ACE/ace/os_include/os_spawn.h b/ACE/ace/os_include/os_spawn.h new file mode 100644 index 00000000000..797e48af614 --- /dev/null +++ b/ACE/ace/os_include/os_spawn.h @@ -0,0 +1,46 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_spawn.h + * + * spawn (ADVANCED REALTIME) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SPAWN_H +#define ACE_OS_INCLUDE_OS_SPAWN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_signal.h" +#include "ace/os_include/sys/os_types.h" +#include "ace/os_include/os_sched.h" + +#if !defined (ACE_LACKS_SPAWN_H) +# include /**/ <spawn.h> +#endif /* !ACE_LACKS_SPAWN_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SPAWN_H */ diff --git a/ACE/ace/os_include/os_stdarg.h b/ACE/ace/os_include/os_stdarg.h new file mode 100644 index 00000000000..313c92e4974 --- /dev/null +++ b/ACE/ace/os_include/os_stdarg.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stdarg.h + * + * handle variable argument list + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STDARG_H +#define ACE_OS_INCLUDE_OS_STDARG_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_STDARG_H) +# include /**/ <stdarg.h> +#endif /* !ACE_LACKS_STDARG_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDARG_H */ diff --git a/ACE/ace/os_include/os_stdbool.h b/ACE/ace/os_include/os_stdbool.h new file mode 100644 index 00000000000..440b0d67f29 --- /dev/null +++ b/ACE/ace/os_include/os_stdbool.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stdbool.h + * + * boolean type and values + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STDBOOL_H +#define ACE_OS_INCLUDE_OS_STDBOOL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_STDBOOL_H) +# include /**/ <stdbool.h> +#endif /* !ACE_LACKS_STDBOOL_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDBOOL_H */ diff --git a/ACE/ace/os_include/os_stddef.h b/ACE/ace/os_include/os_stddef.h new file mode 100644 index 00000000000..87bcbdd2e36 --- /dev/null +++ b/ACE/ace/os_include/os_stddef.h @@ -0,0 +1,95 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stddef.h + * + * standard type definitions + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +// From http://www.UNIX-systems.org/single_unix_specification/ + +#ifndef ACE_OS_INCLUDE_OS_STDDEF_H +#define ACE_OS_INCLUDE_OS_STDDEF_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_STDDEF_H) +# include /**/ <stddef.h> +#endif /* !ACE_LACKS_STDDEF_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// NULL pointer constant +#if defined (ACE_LACKS_NULL) +# undef NULL +# if defined(__cplusplus) +# define NULL 0 +# else +# define NULL ((void *)0) +# endif +#endif /* ACE_LACKS_NULL */ + +/* + Integer constant expression of type size_t, the value of which is the offset + in bytes to the structure member (member-designator), from the beginning of + its structure (type). +*/ +#if defined (ACE_LACKS_OFFSETOF) +# undef offsetof +# define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +#endif /* ACE_LACKS_OFFSETOF */ + +// Signed integer type of the result of subtracting two pointers. +#if defined (ACE_LACKS_PTRDIFF_T) +# if !defined (ACE_PTRDIFF_T_TYPE) +# define ACE_PTRDIFF_T_TYPE unsigned long +# endif /* !ACE_PTRDIFF_T_TYPE */ + typedef ACE_PTRDIFF_T_TYPE ptrdiff_t; +#endif /* ACE_LACKS_PTRDIFF_T */ + +/* + Integer type whose range of values can represent distinct wide-character + codes for all members of the largest character set specified among the + locales supported by the compilation environment: the null character has + the code value 0 and each member of the portable character set has a code + value equal to its value when used as the lone character in an integer + character constant. +*/ +#if defined (ACE_LACKS_WCHAR_T) +# if !defined (ACE_WCHAR_T_TYPE) +# define ACE_WCHAR_T_TYPE long; +# endif /* !ACE_WCHAR_T_TYPE */ + typedef ACE_WCHAR_T_TYPE wchar_t; +#endif /* ACE_LACKS_WCHAR_T */ + +// Unsigned integer type of the result of the sizeof operator. +#if defined (ACE_LACKS_SIZE_T) +# if !defined (ACE_SIZE_T_TYPE) +# define ACE_SIZE_T_TYPE unsigned int; +# endif /* !ACE_SIZE_T_TYPE */ + typedef ACE_SIZE_T_TYPE size_t; +#endif /* ACE_LACKS_SIZE_T */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDDEF_H */ diff --git a/ACE/ace/os_include/os_stdint.h b/ACE/ace/os_include/os_stdint.h new file mode 100644 index 00000000000..97a6d4468d3 --- /dev/null +++ b/ACE/ace/os_include/os_stdint.h @@ -0,0 +1,141 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stdint.h + * + * integer types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STDINT_H +#define ACE_OS_INCLUDE_OS_STDINT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_STDINT_H) +# include /**/ <stdint.h> +#endif /* !ACE_LACKS_STDINT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// BSD style types +#if defined (ACE_LACKS_SYS_TYPES_H) \ + || (defined (__GLIBC__) && !defined (_BSD_SOURCE)) + typedef unsigned char u_char; + typedef unsigned short u_short; + typedef unsigned int u_int; + typedef unsigned long u_long; + + typedef unsigned char uchar_t; + typedef unsigned short ushort_t; + typedef unsigned int uint_t; + typedef unsigned long ulong_t; +#endif /* ACE_LACKS_SYS_TYPES_H */ + +/* Define required types if missing */ + +#if defined (ACE_LACKS_INT8_T) +# if !defined (ACE_INT8_T_TYPE) +# define ACE_INT8_T_TYPE char +# endif /* !ACE_INT8_T_TYPE */ + typedef ACE_INT8_T_TYPE int8_t; +#endif /* ACE_LACKS_INT8_T */ + +#if defined (ACE_LACKS_UINT8_T) +# if !defined (ACE_UINT8_T_TYPE) +# define ACE_UINT8_T_TYPE unsigned char +# endif /* !ACE_UINT8_T_TYPE */ + typedef ACE_UINT8_T_TYPE int8_t; +#endif /* ACE_LACKS_UINT8_T */ + +#if defined (ACE_LACKS_INT16_T) +# if !defined (ACE_INT16_T_TYPE) +# define ACE_INT16_T_TYPE short +# endif /* !ACE_INT16_T_TYPE */ + typedef ACE_INT16_T_TYPE int16_t; +#endif /* ACE_LACKS_INT16_T */ + +#if defined (ACE_LACKS_UINT16_T) +# if !defined (ACE_UINT16_T_TYPE) +# define ACE_UINT16_T_TYPE unsigned short +# endif /* !ACE_UINT16_T_TYPE */ + typedef ACE_UINT16_T_TYPE int16_t; +#endif /* ACE_LACKS_UINT16_T */ + +#if defined (ACE_LACKS_INT32_T) +# if !defined (ACE_INT32_T_TYPE) +# define ACE_INT32_T_TYPE long +# endif /* !ACE_INT32_T_TYPE */ + typedef ACE_INT32_T_TYPE int32_t; +#endif /* ACE_LACKS_INT32_T */ + +#if defined (ACE_LACKS_UINT32_T) +# if !defined (ACE_UINT32_T_TYPE) +# define ACE_UINT32_T_TYPE unsigned long +# endif /* !ACE_UINT32_T_TYPE */ + typedef ACE_UINT32_T_TYPE int32_t; +#endif /* ACE_LACKS_UIN32_T */ + +// @todo pull in ACE class here +// 64 bit will be a problem, but stub it out for now +/* +If an implementation provides integer types with width 64 that meet +these requirements, then the following types are required: int64_t uint64_t + +In particular, this will be the case if any of the following are true: + +The implementation supports the _POSIX_V6_ILP32_OFFBIG programming +environment and the application is being built in the +_POSIX_V6_ILP32_OFFBIG programming environment (see the Shell and +Utilities volume of IEEE Std 1003.1-2001, c99, Programming Environments). + +The implementation supports the _POSIX_V6_LP64_OFF64 programming +environment and the application is being built in the +_POSIX_V6_LP64_OFF64 programming environment. + +The implementation supports the _POSIX_V6_LPBIG_OFFBIG programming +environment and the application is being built in the +_POSIX_V6_LPBIG_OFFBIG programming environment. +*/ +#if defined (ACE_LACKS_INT64_T) +# if !defined (ACE_INT64_T_TYPE) +# define ACE_INT64_T_TYPE long +# endif /* !ACE_INT64_T_TYPE */ + typedef ACE_INT64_T_TYPE int64_t; +#endif /* ACE_LACKS_INT64_T */ + +#if defined (ACE_LACKS_UINT64_T) +# if !defined (ACE_UINT64_T_TYPE) +# define ACE_UINT64_T_TYPE unsigned long +# endif /* !ACE_UINT64_T_TYPE */ + typedef ACE_UINT64_T_TYPE int64_t; +#endif /* ACE_LACKS_UIN64_T */ + +// @todo move the ACE_INT## typedefs here so that ACE_INT64 will +// always be available. + + +// @todo perhaps add macros + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDINT_H */ diff --git a/ACE/ace/os_include/os_stdio.h b/ACE/ace/os_include/os_stdio.h new file mode 100644 index 00000000000..feeb4371fec --- /dev/null +++ b/ACE/ace/os_include/os_stdio.h @@ -0,0 +1,110 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stdio.h + * + * standard buffered input/output + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STDIO_H +#define ACE_OS_INCLUDE_OS_STDIO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// NOTE: stdarg.h must be #included before stdio.h on LynxOS. +#include "ace/os_include/os_stdarg.h" +#include "ace/os_include/os_stddef.h" + +#if !defined (ACE_LACKS_STDIO_H) +# include /**/ <stdio.h> +#endif /* !ACE_LACKS_STDIO_H */ + +#if defined (ACE_VXWORKS) +// for remove(), rename() +# include /**/ <ioLib.h> +// for remCurIdGet() +# include /**/ <remLib.h> +# if defined (__RTP__) && ((ACE_VXWORKS == 0x620) || (ACE_VXWORKS == 0x630)) +# define L_cuserid _PARM_L_cuserid +# endif +#endif /* ACE_VXWORKS */ + +// Undefine "functions" that may be implemented as macros. +#ifdef fgetc +#undef fgetc +#endif +#ifdef fputc +#undef fputc +#endif + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +# if defined (INTEGRITY) +# define ACE_MAX_USERID 32 +# elif defined (ACE_WIN32) +# define ACE_MAX_USERID 32 +# else +# define ACE_MAX_USERID L_cuserid +#endif /* INTEGRITY */ + +#if defined (BUFSIZ) +# define ACE_STREAMBUF_SIZE BUFSIZ +#else +# define ACE_STREAMBUF_SIZE 1024 +#endif /* BUFSIZ */ + +#if defined (ACE_WIN32) +// The following are #defines and #includes that are specific to +// WIN32. +# if defined (ACE_HAS_WINCE) +# define ACE_STDIN _fileno (stdin) +# define ACE_STDOUT _fileno (stdout) +# define ACE_STDERR _fileno (stderr) +# else +# define ACE_STDIN GetStdHandle (STD_INPUT_HANDLE) +# define ACE_STDOUT GetStdHandle (STD_OUTPUT_HANDLE) +# define ACE_STDERR GetStdHandle (STD_ERROR_HANDLE) +# endif // ACE_HAS_WINCE +// The following are #defines and #includes that are specific to UNIX. +#else /* !ACE_WIN32 */ +# define ACE_STDIN 0 +# define ACE_STDOUT 1 +# define ACE_STDERR 2 +#endif /* ACE_WIN32 */ + +#if defined (ACE_WIN32) + typedef OVERLAPPED ACE_OVERLAPPED; +#else + struct ACE_OVERLAPPED + { + unsigned long Internal; + unsigned long InternalHigh; + unsigned long Offset; + unsigned long OffsetHigh; + ACE_HANDLE hEvent; + }; +#endif /* ACE_WIN32 */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDIO_H */ diff --git a/ACE/ace/os_include/os_stdlib.h b/ACE/ace/os_include/os_stdlib.h new file mode 100644 index 00000000000..c123bba0a9d --- /dev/null +++ b/ACE/ace/os_include/os_stdlib.h @@ -0,0 +1,78 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stdlib.h + * + * standard library definitions + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STDLIB_H +#define ACE_OS_INCLUDE_OS_STDLIB_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" +#include "ace/os_include/sys/os_wait.h" + +#if defined (ACE_HAS_ALLOCA_H) +# include /**/ <alloca.h> +#endif /* ACE_HAS_ALLOCA_H */ + +#if !defined (ACE_LACKS_STDLIB_H) +# include /**/ <stdlib.h> +#endif /* !ACE_LACKS_STDLIB_H */ + +#if defined (ACE_VXWORKS) && !defined (__RTP__) +# include /**/ <envLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_BROKEN_RANDR) + // The SunOS 5.4.X version of rand_r is inconsistent with the header + // files... + typedef u_int ACE_RANDR_TYPE; + int rand_r (ACE_RANDR_TYPE seed); +#else + typedef u_int ACE_RANDR_TYPE; +#endif /* ACE_HAS_BROKEN_RANDR */ + +#if defined (DIGITAL_UNIX) + extern int _Prand_r (unsigned int *seedptr); +#endif /* DIGITAL_UNIX */ + +#if defined (ACE_LACKS_PUTENV_PROTOTYPE) + int putenv (char *); +#endif /* ACE_LACKS_PUTENV_PROTOTYPE */ + +#if defined (ACE_LACKS_MKTEMP_PROTOTYPE) + char *mktemp (char *); +#endif /* ACE_LACKS_MKTEMP_PROTOTYPE */ + +#if defined (ACE_LACKS_MKSTEMP_PROTOTYPE) + int mkstemp(char *); +#endif /* ACE_LACKS_MKSTEMP_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STDLIB_H */ diff --git a/ACE/ace/os_include/os_string.h b/ACE/ace/os_include/os_string.h new file mode 100644 index 00000000000..0cd913e952e --- /dev/null +++ b/ACE/ace/os_include/os_string.h @@ -0,0 +1,72 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_string.h + * + * string operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STRING_H +#define ACE_OS_INCLUDE_OS_STRING_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" + +// Matthew Stevens 7-10-95 Fix GNU GCC 2.7 for memchr() problem. +#if defined (ACE_HAS_GNU_CSTRING_H) +// Define this file to keep /usr/include/memory.h from being included. +# include /**/ <cstring> +#else +# if !defined (ACE_LACKS_MEMORY_H) +# include /**/ <memory.h> +# endif /* !ACE_LACKS_MEMORY_H */ +# if !defined (ACE_LACKS_STRING_H) +# include /**/ <string.h> +# endif /* !ACE_LACKS_STRING_H */ +#endif /* ACE_HAS_GNU_CSTRING_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + // this looks fishy... dhinton +#if !defined (ACE_HAS_STRERROR) +# if defined (ACE_HAS_SYS_ERRLIST) + extern char *sys_errlist[]; +# define strerror(err) sys_errlist[err] +# else +# define strerror(err) "strerror is unsupported" +# endif /* ACE_HAS_SYS_ERRLIST */ +#endif /* !ACE_HAS_STRERROR */ + +#if defined (ACE_LACKS_STRTOK_R_PROTOTYPE) && !defined (_POSIX_SOURCE) + char *strtok_r (char *s, const char *delim, char **save_ptr); +#endif /* ACE_LACKS_STRTOK_R_PROTOTYPE */ + +#if defined (__BORLANDC__) && (__BORLANDC__ < 0x560) +# define _stricmp stricmp +# define _strnicmp strnicmp +#endif /* __BORLANDC__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STRING_H */ diff --git a/ACE/ace/os_include/os_strings.h b/ACE/ace/os_include/os_strings.h new file mode 100644 index 00000000000..2fdcf723bec --- /dev/null +++ b/ACE/ace/os_include/os_strings.h @@ -0,0 +1,52 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_strings.h + * + * string operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STRINGS_H +#define ACE_OS_INCLUDE_OS_STRINGS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" + +#if !defined (ACE_LACKS_STRINGS_H) +# include /**/ <strings.h> +#endif /* !ACE_LACKS_STRINGS_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_STRCASECMP_PROTOTYPE) + int strcasecmp(const char *, const char *); +#endif /* ACE_LACKS_STRCASECMP_PROTOTYPE */ + +#if defined (ACE_LACKS_STRNCASECMP_PROTOTYPE) + int strncasecmp(const char *, const char *, size_t); +#endif /* ACE_LACKS_STRNCASECMP_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STRINGS_H */ diff --git a/ACE/ace/os_include/os_stropts.h b/ACE/ace/os_include/os_stropts.h new file mode 100644 index 00000000000..c55e9125c86 --- /dev/null +++ b/ACE/ace/os_include/os_stropts.h @@ -0,0 +1,120 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stropts.h + * + * STREAMS interface (STREAMS) + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_STROPTS_H +#define ACE_OS_INCLUDE_OS_STROPTS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_unistd.h" + +#if defined (ACE_HAS_TIMOD_H) +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# define queue _Queue_ +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ +# include /**/ <sys/timod.h> +# if defined (ACE_HAS_STL_QUEUE_CONFLICT) +# undef queue +# endif /* ACE_HAS_STL_QUEUE_CONFLICT */ +#elif defined (ACE_HAS_OSF_TIMOD_H) +# include /**/ <tli/timod.h> +#endif /* ACE_HAS_TIMOD_H */ + +#if !defined (ACE_LACKS_SYS_IOCTL_H) +# include /**/ <sys/ioctl.h> +#endif /* !ACE_LACKS_IOCTL_H */ + +#if defined (ACE_HAS_SYS_FILIO_H) +# include /**/ <sys/filio.h> +#endif /* ACE_HAS_SYS_FILIO_H */ + +#if defined (ACE_HAS_SYS_SOCKIO_H) +# include /**/ <sys/sockio.h> +#endif /* ACE_HAS_SOCKIO_H */ + +// This is sorta counter intuitive, but this is how it was done in OS.h +// @todo: fix this... dhinton +#if defined (ACE_HAS_STREAMS) +# if defined (AIX) +# if !defined (_XOPEN_EXTENDED_SOURCE) +# define _XOPEN_EXTENDED_SOURCE +# endif /* !_XOPEN_EXTENDED_SOURCE */ +# endif /* AIX */ +#endif /* ACE_HAS_STREAMS */ + +#if !defined (ACE_LACKS_STROPTS_H) +# include /**/ <stropts.h> +#endif /* !ACE_LACKS_STROPTS_H */ + +// This is sorta counter intuitive, but this is how it was done in OS.h +// @todo: fix this... dhinton +#if defined (ACE_HAS_STREAMS) +# if defined (AIX) +# undef _XOPEN_EXTENDED_SOURCE +# endif /* AIX */ +#endif /* ACE_HAS_STREAMS */ + +#if defined (ACE_VXWORKS) +// for ioctl() +# include /**/ <ioLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_STRRECVFD) + struct strrecvfd {}; +#endif /* ACE_LACKS_STRRECVFD */ + +# if !defined (SIOCGIFBRDADDR) +# define SIOCGIFBRDADDR 0 +# endif /* SIOCGIFBRDADDR */ + +# if !defined (SIOCGIFADDR) +# define SIOCGIFADDR 0 +# endif /* SIOCGIFADDR */ + +# if !defined (ACE_HAS_STRBUF_T) +struct strbuf +{ + /// No. of bytes in buffer. + int maxlen; + /// No. of bytes returned. + int len; + /// Pointer to data. + void *buf; +}; +# endif /* ACE_HAS_STRBUF_T */ + +// These prototypes are chronically lacking from many versions of UNIX. +#if !defined (ACE_WIN32) && !defined (ACE_HAS_ISASTREAM_PROTOTYPE) + int isastream (int); +#endif /* !ACE_WIN32 && ACE_HAS_ISASTREAM_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_STROPTS_H */ diff --git a/ACE/ace/os_include/os_syslog.h b/ACE/ace/os_include/os_syslog.h new file mode 100644 index 00000000000..eff6a240520 --- /dev/null +++ b/ACE/ace/os_include/os_syslog.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_syslog.h + * + * definitions for system error logging + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_SYSLOG_H +#define ACE_OS_INCLUDE_OS_SYSLOG_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_SYSLOG_H) +# include /**/ <syslog.h> +#endif /* !ACE_LACKS_SYSLOG_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_SYSLOG_H */ diff --git a/ACE/ace/os_include/os_tar.h b/ACE/ace/os_include/os_tar.h new file mode 100644 index 00000000000..5a781cf200d --- /dev/null +++ b/ACE/ace/os_include/os_tar.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_tar.h + * + * extended tar definitions + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TAR_H +#define ACE_OS_INCLUDE_OS_TAR_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_TAR_H) +# include /**/ <tar.h> +#endif /* !ACE_LACKS_TAR_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TAR_H */ diff --git a/ACE/ace/os_include/os_termios.h b/ACE/ace/os_include/os_termios.h new file mode 100644 index 00000000000..30f1f9971b2 --- /dev/null +++ b/ACE/ace/os_include/os_termios.h @@ -0,0 +1,46 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_termios.h + * + * define values for termios + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TERMIOS_H +#define ACE_OS_INCLUDE_OS_TERMIOS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_TERMIOS_H) +# include /**/ <termios.h> +#endif /* !ACE_LACKS_TERMIOS_H */ + +#if defined (HPUX) +# include /**/ <sys/modem.h> +#endif /* HPUX */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TERMIOS_H */ diff --git a/ACE/ace/os_include/os_tgmath.h b/ACE/ace/os_include/os_tgmath.h new file mode 100644 index 00000000000..c4ac48a6432 --- /dev/null +++ b/ACE/ace/os_include/os_tgmath.h @@ -0,0 +1,45 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_tgmath.h + * + * type-generic macros + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TGMATH_H +#define ACE_OS_INCLUDE_OS_TGMATH_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_math.h" +#include "ace/os_include/os_complex.h" + +#if !defined (ACE_LACKS_TGMATH_H) +# include /**/ <tgmath.h> +#endif /* !ACE_LACKS_TGMATH_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TGMATH_H */ diff --git a/ACE/ace/os_include/os_time.h b/ACE/ace/os_include/os_time.h new file mode 100644 index 00000000000..6f19ad1282b --- /dev/null +++ b/ACE/ace/os_include/os_time.h @@ -0,0 +1,123 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_time.h + * + * time types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TIME_H +#define ACE_OS_INCLUDE_OS_TIME_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// @todo should we include anything from signal.h? +#include "ace/os_include/sys/os_types.h" + +// To get the proper select() signature, this is required for HP-UX, and +// maybe other platforms that offer both int and fdset forms of select(). +// For HP-UX, sys/time.h must be included before time.h, or +// _XOPEN_SOURCE_EXTENDED must be defined. It's not nice to require +// the preprocessor macro, so we force our select() preference this way. +#if !defined (ACE_LACKS_SYS_TIME_H) +# include /**/ <sys/time.h> +#endif /* !ACE_LACKS_SYS_TIME_H */ + +#if !defined (ACE_LACKS_TIME_H) +# include /**/ <time.h> +#endif /* !ACE_LACKS_TIME_H */ + +# if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ + (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) +using std::tm; +# if !defined (ACE_HAS_DINKUM_STL) +# if defined (ACE_WIN32) +using std::_timezone; +# else +using std::timezone; +# endif +# endif +using std::difftime; +# endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */ + +# if !defined (ACE_HAS_POSIX_TIME) +// Definition per POSIX. +typedef struct timespec +{ + /// Seconds + time_t tv_sec; + /// Nanoseconds + long tv_nsec; +} timespec_t; +# elif defined (ACE_HAS_BROKEN_POSIX_TIME) +# if defined (ACE_OPENVMS) +# include /**/ <timers.h> +# else +// OSF/1 defines struct timespec in <sys/timers.h> - Tom Marrs +# include /**/ <sys/timers.h> +# endif +# endif /* !ACE_HAS_POSIX_TIME */ + +# if defined(ACE_LACKS_TIMESPEC_T) +typedef struct timespec timespec_t; +# endif /* ACE_LACKS_TIMESPEC_T */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_BROKEN_CTIME) +# undef ctime +#endif /* ACE_HAS_BROKEN_CTIME */ + +// There are a lot of threads-related macro definitions in the config files. +// They came in at different times and from different places and platform +// requirements as threads evolved. They are probably not all needed - some +// overlap or are otherwise confused. This is an attempt to start +// straightening them out. +#if defined (ACE_HAS_PTHREADS_STD) /* POSIX.1c threads (pthreads) */ + // ... and 2-parameter asctime_r and ctime_r +# if !defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R) && \ + !defined (ACE_HAS_STHREADS) && !defined (ACE_VXWORKS) +# define ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R +# endif +#endif /* ACE_HAS_PTHREADS_STD */ + +#if defined (ACE_LACKS_STRPTIME_PROTOTYPE) && !defined (_XOPEN_SOURCE) + extern char *strptime (const char *s, const char *fmt, struct tm *tp); +#endif /* ACE_LACKS_STRPTIME_PROTOTYPE */ + +#if defined (ACE_LACKS_CONST_TIMESPEC_PTR) +typedef struct timespec * ACE_TIMESPEC_PTR; +#else +typedef const struct timespec * ACE_TIMESPEC_PTR; +#endif /* ACE_LACKS_CONST_TIMESPEC_PTR */ + +#if defined (DIGITAL_UNIX) + extern char *_Pctime_r (const time_t *, char *); + extern struct tm *_Plocaltime_r (const time_t *, struct tm *); + extern struct tm *_Pgmtime_r (const time_t *, struct tm *); + extern char *_Pasctime_r (const struct tm *, char *); +#endif /* DIGITAL_UNIX */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TIME_H */ diff --git a/ACE/ace/os_include/os_trace.h b/ACE/ace/os_include/os_trace.h new file mode 100644 index 00000000000..cb4aa549fcf --- /dev/null +++ b/ACE/ace/os_include/os_trace.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_trace.h + * + * tracing + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_TRACE_H +#define ACE_OS_INCLUDE_OS_TRACE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_TRACE_H) +# include /**/ <trace.h> +#endif /* !ACE_LACKS_TRACE_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_TRACE_H */ diff --git a/ACE/ace/os_include/os_ucontext.h b/ACE/ace/os_include/os_ucontext.h new file mode 100644 index 00000000000..dd4b5001ba9 --- /dev/null +++ b/ACE/ace/os_include/os_ucontext.h @@ -0,0 +1,48 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ucontext.h + * + * user context + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_UCONTEXT_H +#define ACE_OS_INCLUDE_OS_UCONTEXT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_signal.h" + +#if !defined (ACE_LACKS_UCONTEXT_H) +# include /**/ <ucontext.h> +#endif /* !ACE_LACKS_ucontext_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +# if !defined (ACE_HAS_UCONTEXT_T) +typedef int ucontext_t; +# endif /* ACE_HAS_UCONTEXT_T */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_UCONTEXT_H */ diff --git a/ACE/ace/os_include/os_ulimit.h b/ACE/ace/os_include/os_ulimit.h new file mode 100644 index 00000000000..011dd32bc9c --- /dev/null +++ b/ACE/ace/os_include/os_ulimit.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ulimit.h + * + * ulimit commands + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_ULIMIT_H +#define ACE_OS_INCLUDE_OS_ULIMIT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_ULIMIT_H) +# include /**/ <ulimit.h> +#endif /* !ACE_LACKS_ULIMIT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_ULIMIT_H */ diff --git a/ACE/ace/os_include/os_unistd.h b/ACE/ace/os_include/os_unistd.h new file mode 100644 index 00000000000..687557bfe26 --- /dev/null +++ b/ACE/ace/os_include/os_unistd.h @@ -0,0 +1,167 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_unistd.h + * + * standard symbolic constants and types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_UNISTD_H +#define ACE_OS_INCLUDE_OS_UNISTD_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" +#include "ace/os_include/os_inttypes.h" + +#if defined (__BORLANDC__) +# include "ace/os_include/os_fcntl.h" +#endif /* __BORLANDC */ + +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +# include /**/ <process.h> +# include /**/ <io.h> +#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ + +#if defined (ACE_HAS_SYSINFO) +# include /**/ <sys/systeminfo.h> +#endif /* ACE_HAS_SYS_INFO */ + +#if !defined (ACE_LACKS_UNISTD_H) +# include /**/ <unistd.h> +#endif /* !ACE_LACKS_UNISTD_H */ + +#if defined (ACE_VXWORKS) +# if !defined (__RTP__) + // for unlink(), close(), read(), write(), lseek(), chdir(), getcwd(), + // getwd(), and isatty() + # include /**/ <ioLib.h> +# endif +// for gethostname() +# include /**/ <hostLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if (!defined (_BSD_SOURCE) && \ + !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED)) \ + || (defined (_XOPEN_SOURCE) && defined (__GNUC__)) + +# if defined (ACE_LACKS_SETREUID_PROTOTYPE) + extern int setreuid (uid_t ruid, uid_t euid); +# endif /* ACE_LACKS_SETREUID_PROTOTYPE */ + +# if defined (ACE_LACKS_SETREGID_PROTOTYPE) + extern int setregid (gid_t rgid, gid_t egid); +# endif /* ACE_LACKS_SETREGID_PROTOTYPE */ +#endif /* !_BSD_SOURCE && !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED + || _XOPEN_SOURCE && __GNUC__ */ + + // for use by access() +# if !defined (R_OK) +# define R_OK 04 /* Test for Read permission. */ +# endif /* R_OK */ + +# if !defined (W_OK) +# define W_OK 02 /* Test for Write permission. */ +# endif /* W_OK */ + +# if !defined (X_OK) +# define X_OK 01 /* Test for eXecute permission. */ +# endif /* X_OK */ + +# if !defined (F_OK) +# define F_OK 0 /* Test for existence of File. */ +# endif /* F_OK */ + +#if defined (ACE_LACKS_UALARM_PROTOTYPE) + u_int ualarm (u_int usecs, u_int interval); +#endif /* ACE_LACKS_UALARM_PROTOTYPE */ + +#if defined (ACE_LACKS_PREAD_PROTOTYPE) && (_XOPEN_SOURCE - 0) < 500 + // _XOPEN_SOURCE == 500 Single Unix conformance + // It seems that _XOPEN_SOURCE == 500 means that the prototypes are + // already defined in the system headers. + ssize_t pread (int fd, + void *buf, + size_t nbytes, + off_t offset); + + ssize_t pwrite (int fd, + const void *buf, + size_t n, + off_t offset); +#endif /* ACE_LACKS_PREAD_PROTOTYPE && (_XOPEN_SOURCE - 0) < 500 */ + +#if defined (ACE_LACKS_GETPGID_PROTOTYPE) && \ + !defined (_XOPEN_SOURCE) && !defined (_XOPEN_SOURCE_EXTENDED) + pid_t getpgid (pid_t pid); +#endif /* ACE_LACKS_GETPGID_PROTOTYPE && + !_XOPEN_SOURCE && !_XOPEN_SOURCE_EXTENDED */ + +#if !defined (_LARGEFILE64_SOURCE) +# if defined (ACE_LACKS_LSEEK64_PROTOTYPE) && \ + defined (ACE_LACKS_LLSEEK_PROTOTYPE) +# error Define either ACE_LACKS_LSEEK64_PROTOTYPE or ACE_LACKS_LLSEEK_PROTOTYPE, not both! +# elif defined (ACE_LACKS_LSEEK64_PROTOTYPE) + ACE_LOFF_T lseek64 (int fd, ACE_LOFF_T offset, int whence); +# elif defined (ACE_LACKS_LLSEEK_PROTOTYPE) + ACE_LOFF_T llseek (int fd, ACE_LOFF_T offset, int whence); +# endif +#endif /* _LARGEFILE64_SOURCE */ + +#if defined (__BORLANDC__) +# if (__BORLANDC__ <= 0x540) +# define _getcwd getcwd +# define _chdir chdir +# undef _access +# define _access access +# endif +# define _isatty isatty +#endif /* __BORLANDC__ */ + +# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) + + ssize_t read_timedwait (ACE_HANDLE handle, + char *buf, + size_t n, + struct timespec *timeout); + + ssize_t write_timedwait (ACE_HANDLE handle, + const void *buf, + size_t n, + struct timespec *timeout); + +# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ + +#if defined (ACE_LACKS_SWAB_PROTOTYPE) + void swab(const void *, void *, ssize_t); +#endif /* ACE_LACKS_SWAB_PROTOTYPE */ + +#if defined (ACE_LACKS_GETOPT_PROTOTYPE) + int getopt(int, char * const [], const char *); +#endif /* ACE_LACKS_GETOPT_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_UNISTD_H */ diff --git a/ACE/ace/os_include/os_utime.h b/ACE/ace/os_include/os_utime.h new file mode 100644 index 00000000000..20e48b4ae0c --- /dev/null +++ b/ACE/ace/os_include/os_utime.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_utime.h + * + * access and modification times structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_UTIME_H +#define ACE_OS_INCLUDE_OS_UTIME_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_UTIME_H) +# include /**/ <utime.h> +#endif /* !ACE_LACKS_UTIME_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_UTIME_H */ diff --git a/ACE/ace/os_include/os_utmpx.h b/ACE/ace/os_include/os_utmpx.h new file mode 100644 index 00000000000..88845f1e418 --- /dev/null +++ b/ACE/ace/os_include/os_utmpx.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_utmpx.h + * + * user accounting database definitions + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_UTMPX_H +#define ACE_OS_INCLUDE_OS_UTMPX_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_time.h" + +#if !defined (ACE_LACKS_UTMPX_H) +# include /**/ <utmpx.h> +#endif /* !ACE_LACKS_UTMPX_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_UTMPX_H */ diff --git a/ACE/ace/os_include/os_wchar.h b/ACE/ace/os_include/os_wchar.h new file mode 100644 index 00000000000..2ef9cc90ef9 --- /dev/null +++ b/ACE/ace/os_include/os_wchar.h @@ -0,0 +1,49 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_wchar.h + * + * wide-character handling + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_WCHAR_H +#define ACE_OS_INCLUDE_OS_WCHAR_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// ctype.h, string.h, stdarg.h, stdio.h, stdlib.h, time.h +#include "ace/os_include/os_stdio.h" +#include "ace/os_include/os_stdlib.h" +#include "ace/os_include/os_time.h" +#include "ace/os_include/os_string.h" +#include "ace/os_include/os_ctype.h" + +#if !defined (ACE_LACKS_WCHAR_H) +# include /**/ <wchar.h> +#endif /* !ACE_LACKS_WCHAR_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_WCHAR_H */ diff --git a/ACE/ace/os_include/os_wctype.h b/ACE/ace/os_include/os_wctype.h new file mode 100644 index 00000000000..8abb0f0df61 --- /dev/null +++ b/ACE/ace/os_include/os_wctype.h @@ -0,0 +1,45 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_wctype.h + * + * wide-character classification and mapping utilities + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_WCTYPE_H +#define ACE_OS_INCLUDE_OS_WCTYPE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +// ctype.h, string.h, stdarg.h, stdio.h, stdlib.h, time.h +#include "ace/os_include/os_wchar.h" + +#if !defined (ACE_LACKS_WCTYPE_H) +# include /**/ <wctype.h> +#endif /* !ACE_LACKS_WCTYPE_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_WCTYPE_H */ diff --git a/ACE/ace/os_include/os_wordexp.h b/ACE/ace/os_include/os_wordexp.h new file mode 100644 index 00000000000..2ff6eec0052 --- /dev/null +++ b/ACE/ace/os_include/os_wordexp.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_wordexp.h + * + * word-expansion types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_OS_WORDEXP_H +#define ACE_OS_INCLUDE_OS_WORDEXP_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" // size_t + +#if !defined (ACE_LACKS_WORDEXP_H) +# include /**/ <wordexp.h> +#endif /* !ACE_LACKS_WORDEXP_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_OS_WORDEXP_H */ diff --git a/ACE/ace/os_include/sys/os_ipc.h b/ACE/ace/os_include/sys/os_ipc.h new file mode 100644 index 00000000000..454c9e5b045 --- /dev/null +++ b/ACE/ace/os_include/sys/os_ipc.h @@ -0,0 +1,74 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_ipc.h + * + * XSI interprocess communication access structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_IPC_H +#define ACE_OS_INCLUDE_SYS_OS_IPC_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_IPC_H) +# include /**/ <sys/ipc.h> +#endif /* !ACE_LACKS_SYS_IPC_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_WIN32) +# define ACE_INVALID_SEM_KEY 0 +#else /* !ACE_WIN32 */ +# define ACE_INVALID_SEM_KEY -1 +#endif /* ACE_WIN32 */ + +#if !defined (IPC_PRIVATE) +# define IPC_PRIVATE ACE_INVALID_SEM_KEY +#endif /* IPC_PRIVATE */ + +#if !defined (IPC_STAT) +# define IPC_STAT 0 +#endif /* IPC_STAT */ + +#if !defined (IPC_CREAT) +# define IPC_CREAT 0 +#endif /* IPC_CREAT */ + +#if !defined (IPC_NOWAIT) +# define IPC_NOWAIT 0 +#endif /* IPC_NOWAIT */ + +#if !defined (IPC_RMID) +# define IPC_RMID 0 +#endif /* IPC_RMID */ + +#if !defined (IPC_EXCL) +# define IPC_EXCL 0 +#endif /* IPC_EXCL */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_IPC_H */ diff --git a/ACE/ace/os_include/sys/os_loadavg.h b/ACE/ace/os_include/sys/os_loadavg.h new file mode 100644 index 00000000000..da569084f3b --- /dev/null +++ b/ACE/ace/os_include/sys/os_loadavg.h @@ -0,0 +1,41 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_loadavg.h + * + * loadavg functions + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_LOADAVG_H +#define ACE_OS_INCLUDE_SYS_OS_LOADAVG_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_HAS_SYS_LOADAVG_H) +# include /**/ <sys/loadavg.h> +#endif /* ACE_HAS_SYS_LOADAVG_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_LOADAVG_H */ diff --git a/ACE/ace/os_include/sys/os_mman.h b/ACE/ace/os_include/sys/os_mman.h new file mode 100644 index 00000000000..74fef32f869 --- /dev/null +++ b/ACE/ace/os_include/sys/os_mman.h @@ -0,0 +1,122 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_mman.h + * + * memory management declarations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_MMAN_H +#define ACE_OS_INCLUDE_SYS_OS_MMAN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if defined (ACE_LACKS_MMAP) +# define ACE_LACKS_SYS_MMAN_H +#endif /* ACE_LACKS_MMAP */ + +#if !defined (ACE_LACKS_SYS_MMAN_H) + // Fixes a problem with HP/UX. +# if defined (ACE_HAS_BROKEN_MMAP_H) + extern "C" { +# endif /* ACE_HAS_BROKEN_MMAP_H */ +# include /**/ <sys/mman.h> +# if defined (ACE_HAS_BROKEN_MMAP_H) + } +# endif /* ACE_HAS_BROKEN_MMAP_H */ +#endif /* ACE_LACKS_SYS_MMAN_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_SYS_MMAN_H) && !defined (ACE_WIN32) +# define PROT_READ 0 +# define PROT_WRITE 0 +# define PROT_EXEC 0 +# define PROT_NONE 0 +# define PROT_RDWR 0 +# define MAP_PRIVATE 0 +# define MAP_SHARED 0 +# define MAP_FIXED 0 +#elif defined (ACE_WIN32) + // These two may be used for internal flags soon: +# define MAP_PRIVATE 1 +# define MAP_SHARED 2 +# define MAP_FIXED 4 + // MMAP flags +# define PROT_READ PAGE_READONLY +# define PROT_WRITE PAGE_READWRITE +# define PROT_RDWR PAGE_READWRITE +/* If we can find suitable use for these flags, here they are: +PAGE_WRITECOPY +PAGE_EXECUTE +PAGE_EXECUTE_READ +PAGE_EXECUTE_READWRITE +PAGE_EXECUTE_WRITECOPY +PAGE_GUARD +PAGE_NOACCESS +PAGE_NOCACHE */ +#endif /* !ACE_LACKS_SYS_MMAN_H && !ACE_WIN32*/ + +# if !defined (ACE_MAP_PRIVATE) +# define ACE_MAP_PRIVATE MAP_PRIVATE +# endif /* ! ACE_MAP_PRIVATE */ + +# if !defined (ACE_MAP_SHARED) +# define ACE_MAP_SHARED MAP_SHARED +# endif /* ! ACE_MAP_SHARED */ + +# if !defined (ACE_MAP_FIXED) +# define ACE_MAP_FIXED MAP_FIXED +# endif /* ! ACE_MAP_FIXED */ + +# if !defined (MAP_FAILED) || defined (ACE_HAS_BROKEN_MAP_FAILED) +# undef MAP_FAILED +# define MAP_FAILED ((void *) -1) +# elif defined (ACE_HAS_LONG_MAP_FAILED) +# undef MAP_FAILED +# define MAP_FAILED ((void *) -1L) +# endif /* !MAP_FAILED || ACE_HAS_BROKEN_MAP_FAILED */ + +#if !defined (PROT_RDWR) +# define PROT_RDWR (PROT_READ|PROT_WRITE) +#endif /* PROT_RDWR */ + +# if defined (ACE_WIN32) + // Needed to map calls to NT transparently. +# define MS_ASYNC 0 +# define MS_INVALIDATE 0 +# endif /* ACE_WIN32 */ + +# if !defined (MS_SYNC) +# define MS_SYNC 0x0 +# endif /* !MS_SYNC */ + +#if !defined (ACE_LACKS_MADVISE) && defined (ACE_LACKS_MADVISE_PROTOTYPE) + extern "C" int madvise(caddr_t, size_t, int); +#endif /* !ACE_LACKS_MADVISE && ACE_LACKS_MADVISE_PROTOTYPE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_MMAN_H */ diff --git a/ACE/ace/os_include/sys/os_msg.h b/ACE/ace/os_include/sys/os_msg.h new file mode 100644 index 00000000000..e6b2c6c1c63 --- /dev/null +++ b/ACE/ace/os_include/sys/os_msg.h @@ -0,0 +1,62 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_msg.h + * + * XSI message queue structures + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_MSG_H +#define ACE_OS_INCLUDE_SYS_OS_MSG_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_ipc.h" + +#if !defined (ACE_LACKS_SYS_MSG_H) +// OSF1 has problems with sys/msg.h and C++... +# if defined (ACE_HAS_BROKEN_MSG_H) +# define _KERNEL +# endif /* ACE_HAS_BROKEN_MSG_H */ +# include /**/ <sys/msg.h> +# if defined (ACE_HAS_BROKEN_MSG_H) +# undef _KERNEL +# endif /* ACE_HAS_BROKEN_MSG_H */ +#endif /* !ACE_LACKS_SYS_MSG_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + // Declare opaque type. Needed for ACE_OS wrappers on systems + // without SysV IPC. + struct msqid_ds; + +#if defined (ACE_LACKS_SYSV_MSQ_PROTOS) + int msgget (key_t, int); + int msgrcv (int, void *, size_t, long, int); + int msgsnd (int, const void *, size_t, int); + int msgctl (int, int, struct msqid_ds *); +#endif /* ACE_LACKS_SYSV_MSQ_PROTOS */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_MSG_H */ diff --git a/ACE/ace/os_include/sys/os_pstat.h b/ACE/ace/os_include/sys/os_pstat.h new file mode 100644 index 00000000000..c6872fe53de --- /dev/null +++ b/ACE/ace/os_include/sys/os_pstat.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_pstat.h + * + * pstat functions + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_PSTAT_H +#define ACE_OS_INCLUDE_SYS_OS_PSTAT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-all.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if defined (ACE_HAS_SYS_PSTAT_H) +# include /**/ <sys/param.h> +# include /**/ <sys/pstat.h> +#endif /* ACE_HAS_SYS_PSTAT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_PSTAT_H */ diff --git a/ACE/ace/os_include/sys/os_resource.h b/ACE/ace/os_include/sys/os_resource.h new file mode 100644 index 00000000000..cd28e932fa1 --- /dev/null +++ b/ACE/ace/os_include/sys/os_resource.h @@ -0,0 +1,108 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_resource.h + * + * definitions for XSI resource operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_RESOURCE_H +#define ACE_OS_INCLUDE_SYS_OS_RESOURCE_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_time.h" +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_RESOURCE_H) +# include /**/ <sys/resource.h> +#endif /* !ACE_LACKS_SYS_RESOURCE_H */ + +#if defined (ACE_HAS_SYSINFO) +# include /**/ <sys/systeminfo.h> +#endif /* ACE_HAS_SYS_INFO */ + +#if defined (ACE_HAS_SYS_SYSCALL_H) +# include /**/ <sys/syscall.h> +#endif /* ACE_HAS_SYS_SYSCALL_H */ + +// prusage_t is defined in <sys/procfs.h> +#if defined (ACE_HAS_PROC_FS) +# include /**/ <sys/procfs.h> +#endif /* ACE_HAS_PROC_FS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// There must be a better way to do this... +#if !defined (RLIMIT_NOFILE) +# if defined (linux) || defined (AIX) || defined (SCO) +# if defined (RLIMIT_OFILE) +# define RLIMIT_NOFILE RLIMIT_OFILE +# else +# define RLIMIT_NOFILE 200 +# endif /* RLIMIT_OFILE */ +# endif /* defined (linux) || defined (AIX) || defined (SCO) */ +#endif /* RLIMIT_NOFILE */ + +#if defined (ACE_WIN32) +# define RUSAGE_SELF 1 + /// Fake the UNIX rusage structure. Perhaps we can add more to this + /// later on? + struct rusage + { + FILETIME ru_utime; + FILETIME ru_stime; + }; +#else /* !ACE_WIN32 */ +# if defined (m88k) +# define RUSAGE_SELF 1 +# endif /* m88k */ +#endif /* ACE_WIN32 */ + +#if defined (ACE_LACKS_RLIMIT_PROTOTYPE) + int getrlimit (int resource, struct rlimit *rlp); + int setrlimit (int resource, const struct rlimit *rlp); +#endif /* ACE_LACKS_RLIMIT_PROTOTYPE */ + +#if defined (ACE_HAS_PRUSAGE_T) + typedef prusage_t ACE_Rusage; +#elif defined (ACE_HAS_GETRUSAGE) + typedef rusage ACE_Rusage; +#else + typedef int ACE_Rusage; +#endif /* ACE_HAS_PRUSAGE_T */ + +#if !defined (ACE_WIN32) +// These prototypes are chronically lacking from many versions of UNIX. +# if !defined (ACE_HAS_GETRUSAGE_PROTOTYPE) + int getrusage (int who, struct rusage *rusage); +# endif /* ! ACE_HAS_GETRUSAGE_PROTOTYPE */ + +# if defined (ACE_LACKS_SYSCALL) + int syscall (int, ACE_HANDLE, struct rusage *); +# endif /* ACE_LACKS_SYSCALL */ +#endif /* !ACE_WIN32 */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_RESOURCE_H */ diff --git a/ACE/ace/os_include/sys/os_select.h b/ACE/ace/os_include/sys/os_select.h new file mode 100644 index 00000000000..e330e625a07 --- /dev/null +++ b/ACE/ace/os_include/sys/os_select.h @@ -0,0 +1,70 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_select.h + * + * select types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_SELECT_H +#define ACE_OS_INCLUDE_SYS_OS_SELECT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_time.h" +#include "ace/os_include/os_signal.h" +#include "ace/os_include/os_unistd.h" + +#if !defined (ACE_LACKS_SYS_SELECT_H) +# include /**/ <sys/select.h> +#endif /* !ACE_LACKS_SYS_SELECT_H */ + +#if defined (ACE_VXWORKS) && defined (ACE_LACKS_SYS_SELECT_H) +# include /**/ <selectLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_WIN32) + // This will help until we figure out everything: +# define NFDBITS 32 /* only used in unused functions... */ +#elif defined (__QNX__) +# if !defined (NFDBITS) +# define NFDBITS (sizeof(fd_mask) * NBBY) /* bits per mask */ +# endif /* ! NFDBITS */ +#endif /* ACE_WIN32 */ + +#if defined (ACE_SELECT_USES_INT) + typedef int ACE_FD_SET_TYPE; +#else + typedef fd_set ACE_FD_SET_TYPE; +#endif /* ACE_SELECT_USES_INT */ + +#if defined (__rtems__) + int select (int n, fd_set *readfds, fd_set *writefds, + fd_set *exceptfds, const struct timeval *timeout); +#endif /* __rtems__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_SELECT_H */ diff --git a/ACE/ace/os_include/sys/os_sem.h b/ACE/ace/os_include/sys/os_sem.h new file mode 100644 index 00000000000..93f669d2913 --- /dev/null +++ b/ACE/ace/os_include/sys/os_sem.h @@ -0,0 +1,90 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_sem.h + * + * XSI semaphore facility + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_SEM_H +#define ACE_OS_INCLUDE_SYS_OS_SEM_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_ipc.h" + +#if !defined (ACE_LACKS_SYS_SEM_H) +# include /**/ <sys/sem.h> +#endif /* !ACE_LACKS_SYS_SEM_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +# if !defined (GETVAL) +# define GETVAL 0 +# endif /* GETVAL */ + +# if !defined (SETVAL) +# define SETVAL 0 +# endif /* SETVAL */ + +# if !defined (GETALL) +# define GETALL 0 +# endif /* GETALL */ + +# if !defined (SETALL) +# define SETALL 0 +# endif /* SETALL */ + +# if !defined (SEM_UNDO) +# define SEM_UNDO 0 +# endif /* SEM_UNDO */ + +#if defined (ACE_LACKS_SEMBUF_T) + struct sembuf + { + /// semaphore # + unsigned short sem_num; + + /// semaphore operation + short sem_op; + + /// operation flags + short sem_flg; + }; +#endif /* ACE_LACKS_SEMBUF_T */ + +#if !defined (ACE_HAS_SEMUN) || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) + union semun + { + /// value for SETVAL + int val; + /// buffer for IPC_STAT & IPC_SET + struct semid_ds *buf; + /// array for GETALL & SETALL + u_short *array; + }; +#endif /* !ACE_HAS_SEMUN || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_SEM_H */ diff --git a/ACE/ace/os_include/sys/os_shm.h b/ACE/ace/os_include/sys/os_shm.h new file mode 100644 index 00000000000..af005e8dbb2 --- /dev/null +++ b/ACE/ace/os_include/sys/os_shm.h @@ -0,0 +1,48 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_shm.h + * + * XSI shared memory facility + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_SHM_H +#define ACE_OS_INCLUDE_SYS_OS_SHM_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_ipc.h" + +#if !defined (ACE_LACKS_SYS_SHM_H) +# include /**/ <sys/shm.h> +#endif /* !ACE_LACKS_SYS_SHM_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + // Declare opaque type. Needed for ACE_OS wrappers on systems + // without SysV IPC. + struct shmid_ds; + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_SHM_H */ diff --git a/ACE/ace/os_include/sys/os_socket.h b/ACE/ace/os_include/sys/os_socket.h new file mode 100644 index 00000000000..9fc554df4cd --- /dev/null +++ b/ACE/ace/os_include/sys/os_socket.h @@ -0,0 +1,213 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_socket.h + * + * main sockets header + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_SOCKET_H +#define ACE_OS_INCLUDE_SYS_OS_SOCKET_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_uio.h" + +#if !defined (ACE_LACKS_SYS_SOCKET_H) +# if defined (ACE_HAS_AIX_BROKEN_SOCKET_HEADER) +# undef __cplusplus +# endif /* ACE_HAS_AIX_BROKEN_SOCKET_HEADER */ +# include /**/ <sys/socket.h> +# if defined (ACE_HAS_AIX_BROKEN_SOCKET_HEADER) +# define __cplusplus +# endif /* ACE_HAS_AIX_BROKEN_SOCKET_HEADER */ +#endif /* !ACE_LACKS_SYS_SOCKET_H */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS < 0x620) +# include /**/ <sockLib.h> +#endif /* ACE_VXWORKS */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if !defined (ACE_HAS_MSG) && !defined (SCO) + struct msghdr {}; +#endif /* ACE_HAS_MSG */ + +#if defined (ACE_HAS_MSG) && defined (ACE_LACKS_MSG_ACCRIGHTS) +# if !defined (msg_accrights) +# undef msg_control +# define msg_accrights msg_control +# endif /* ! msg_accrights */ + +# if !defined (msg_accrightslen) +# undef msg_controllen +# define msg_accrightslen msg_controllen +# endif /* ! msg_accrightslen */ +#endif /* ACE_HAS_MSG && ACE_LACKS_MSG_ACCRIGHTS */ + +#if defined (ACE_WIN32) + struct msghdr + { + /// Optional address + sockaddr * msg_name; + + /// Size of address + int msg_namelen; + + /// Scatter/gather array + iovec *msg_iov; + + /// # elements in msg_iov + int msg_iovlen; + + /// Access rights sent/received + caddr_t msg_accrights; + + int msg_accrightslen; + }; +#endif /* ACE_WIN32 */ + +#if defined (ACE_HAS_4_4BSD_SENDMSG_RECVMSG) + // Control message size to pass a file descriptor. +# define ACE_BSD_CONTROL_MSG_LEN sizeof (struct cmsghdr) + sizeof (ACE_HANDLE) +# if defined (ACE_LACKS_CMSG_DATA_MACRO) +# if defined (ACE_LACKS_CMSG_DATA_MEMBER) +# define CMSG_DATA(cmsg) ((unsigned char *) ((struct cmsghdr *) (cmsg) + 1)) +# else +# define CMSG_DATA(cmsg) ((cmsg)->cmsg_data) +# endif /* ACE_LACKS_CMSG_DATA_MEMBER */ +# endif /* ACE_LACKS_CMSG_DATA_MACRO */ +#endif /* ACE_HAS_4_4BSD_SENDMSG_RECVMSG */ + +// Increase the range of "address families". Please note that this +// must appear _after_ the include of sys/socket.h, for the AF_FILE +// definition on Linux/glibc2. +#if !defined (AF_ANY) +# define AF_ANY (-1) +#endif /* AF_ANY */ + +#define AF_SPIPE (AF_MAX + 1) +#if !defined (AF_FILE) +# define AF_FILE (AF_MAX + 2) +#endif /* ! AF_FILE */ +#define AF_DEV (AF_MAX + 3) +#define AF_UPIPE (AF_SPIPE) + +#if defined (ACE_HAS_IPV6) +# if defined (ACE_USES_IPV4_IPV6_MIGRATION) +# define ACE_ADDRESS_FAMILY_INET AF_UNSPEC +# define ACE_PROTOCOL_FAMILY_INET PF_UNSPEC +# else +# define ACE_ADDRESS_FAMILY_INET AF_INET6 +# define ACE_PROTOCOL_FAMILY_INET PF_INET6 +# endif /* ACE_USES_IPV4_IPV6_MIGRATION */ +#else /* !ACE_HAS_IPV6 */ +# define ACE_ADDRESS_FAMILY_INET AF_INET +# define ACE_PROTOCOL_FAMILY_INET PF_INET +#endif /* ACE_HAS_IPV6 */ + +#if defined (ACE_HAS_SOCKLEN_T) +# if defined (__hpux) + /* + ** HP-UX supplies the socklen_t type unless some feature set less than + ** _XOPEN_SOURCE_EXTENDED is specifically requested. However, it only + ** actually uses the socklen_t type in supplied socket functions if + ** _XOPEN_SOURCE_EXTENDED is specifically requested. So, for example, + ** the compile options ACE usually uses (includes -mt) cause _HPUX_SOURCE + ** to be set, which sets _INCLUDE_XOPEN_SOURCE_EXTENDED (causing socklen_t + ** to be defined) but _not_ _XOPEN_SOURCE_EXTENDED (causing socket functions + ** to use int, not socklen_t). React to this situation here... + */ +# if defined (_XOPEN_SOURCE_EXTENDED) +typedef socklen_t ACE_SOCKET_LEN; +# else +typedef int ACE_SOCKET_LEN; +# endif /* _XOPEN_SOURCE_EXTENDED */ +# else +typedef socklen_t ACE_SOCKET_LEN; +# endif /* __hpux */ +#elif defined (ACE_HAS_SIZET_SOCKET_LEN) +typedef size_t ACE_SOCKET_LEN; +#else +typedef int ACE_SOCKET_LEN; +#endif /* ACE_HAS_SIZET_SOCKET_LEN */ + +#if defined (ACE_HAS_NETLINK) +# include /**/ <asm/types.h> +# include /**/ <linux/netlink.h> +# define ACE_PROTOCOL_FAMILY_NETLINK AF_NETLINK +#endif + +#if defined (ACE_HAS_LKSCTP) +extern "C" +{ +#include /**/ <netinet/in.h> +#include /**/ <netinet/sctp.h> +} +#endif /* ACE_HAS_LKSCTP */ + +# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) + + ssize_t recv_timedwait (ACE_HANDLE handle, + char *buf, + int len, + int flags, + struct timespec *timeout); + + ssize_t recvmsg_timedwait (ACE_HANDLE handle, + struct msghdr *msg, + int flags, + struct timespec *timeout); + + ssize_t recvfrom_timedwait (ACE_HANDLE handle, + char *buf, + int len, + int flags, + struct sockaddr *addr, + int *addrlen, + struct timespec *timeout); + + ssize_t send_timedwait (ACE_HANDLE handle, + const char *buf, + int len, + int flags, + struct timespec *timeout); + + ssize_t sendmsg_timedwait (ACE_HANDLE handle, + const struct msghdr *msg, + int flags, + struct timespec *timeout); + + ssize_t sendto_timedwait (ACE_HANDLE handle, + const char *buf, + int len, + int flags, + const struct sockaddr *addr, + int addrlen, + struct timespec *timeout); + +# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_SOCKET_H */ diff --git a/ACE/ace/os_include/sys/os_stat.h b/ACE/ace/os_include/sys/os_stat.h new file mode 100644 index 00000000000..0c4a703f5f2 --- /dev/null +++ b/ACE/ace/os_include/sys/os_stat.h @@ -0,0 +1,127 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_stat.h + * + * data returned by the stat() function + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_STAT_H +#define ACE_OS_INCLUDE_SYS_OS_STAT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) +# include /**/ <direct.h> +#endif /* ACE_WIN32 && !ACE_HAS_WINCE */ + +#if !defined (ACE_LACKS_SYS_STAT_H) +# include /**/ <sys/stat.h> +#endif /* !ACE_LACKS_SYS_STAT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_MODE_MASKS) +// MODE MASKS + +// the following macros are for POSIX conformance. + +# if !defined (ACE_HAS_USER_MODE_MASKS) +# define S_IRWXU 00700 /* read, write, execute: owner. */ +# define S_IRUSR 00400 /* read permission: owner. */ +# define S_IWUSR 00200 /* write permission: owner. */ +# define S_IXUSR 00100 /* execute permission: owner. */ +# endif /* ACE_HAS_USER_MODE_MASKS */ +# define S_IRWXG 00070 /* read, write, execute: group. */ +# define S_IRGRP 00040 /* read permission: group. */ +# define S_IWGRP 00020 /* write permission: group. */ +# define S_IXGRP 00010 /* execute permission: group. */ +# define S_IRWXO 00007 /* read, write, execute: other. */ +# define S_IROTH 00004 /* read permission: other. */ +# define S_IWOTH 00002 /* write permission: other. */ +# define S_IXOTH 00001 /* execute permission: other. */ + +// WinCE's S_IFLNK is defined with the other bits, below. +#if !defined (S_IFLNK) && !defined (ACE_HAS_WINCE) +#define S_IFLNK 0200000 +#endif /* S_IFLNK && !ACE_HAS_WINCE */ + +#endif /* ACE_LACKS_MODE_MASKS */ + +// Some systems (VxWorks) don't define S_ISLNK +#if !defined (S_ISLNK) +# if defined (S_IFLNK) +# define S_ISLNK(mode) (((mode)&S_IFLNK) == S_IFLNK) +# else +# define S_ISLNK(mode) 0 +# endif /* S_IFLNK */ +#endif /* S_ISLNK */ + +#if defined (ACE_HAS_WINCE) +# include "ace/Time_Value.h" + +// Translate the WinCE bits into names expected by our callers. +// The dwFileAttributes parameter doesn't have protection info, so +// S_IFMT is the whole thing. Since there are no symbolic links, S_IFLNK is 0. +# define S_IFMT 0xFFFF +# define S_IFDIR FILE_ATTRIBUTE_DIRECTORY +# define S_IFREG FILE_ATTRIBUTE_NORMAL +# define S_IFLNK 0 + + struct stat + { + /// always 0 on Windows platforms + dev_t st_dev; + + /// always 0 on Windows platforms + dev_t st_rdev; + + /// file attribute + unsigned short st_mode; + + /// number of hard links + short st_nlink; + + /// time of last access + ACE_Time_Value st_atime; + + /// time of last data modification + ACE_Time_Value st_mtime; + + /// time of creation + ACE_Time_Value st_ctime; + + /// file size, in bytes + off_t st_size; + + // Following members do not have direct conversion in Window platforms. + //u_long st_blksize; // optimal blocksize for I/O + //u_long st_flags; // user defined flags for file + }; +#endif /* ACE_HAS_WINCE */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_STAT_H */ diff --git a/ACE/ace/os_include/sys/os_statvfs.h b/ACE/ace/os_include/sys/os_statvfs.h new file mode 100644 index 00000000000..546c20b10f2 --- /dev/null +++ b/ACE/ace/os_include/sys/os_statvfs.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_statvfs.h + * + * VFS File System information structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_STATVFS_H +#define ACE_OS_INCLUDE_SYS_OS_STATVFS_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_STATVFS_H) +# include /**/ <sys/statvfs.h> +#endif /* !ACE_LACKS_SYS_STATVFS_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_STATVFS_H */ diff --git a/ACE/ace/os_include/sys/os_sysctl.h b/ACE/ace/os_include/sys/os_sysctl.h new file mode 100644 index 00000000000..680c2562cbf --- /dev/null +++ b/ACE/ace/os_include/sys/os_sysctl.h @@ -0,0 +1,41 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_sysctl.h + * + * declarations for sysctl + * + * $Id$ + * + * @author Johnny Willemsen <jwillemsen@remedy.nl> + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_SYSCTL_H +#define ACE_OS_INCLUDE_SYS_OS_SYSCTL_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_SYS_SYSCTL_H) +# include /**/ <sys/sysctl.h> +#endif /* !ACE_LACKS_SYS_SYSCTL_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_SYSCTL_H */ diff --git a/ACE/ace/os_include/sys/os_time.h b/ACE/ace/os_include/sys/os_time.h new file mode 100644 index 00000000000..7f65f5cb568 --- /dev/null +++ b/ACE/ace/os_include/sys/os_time.h @@ -0,0 +1,60 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_time.h + * + * time types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_TIME_H +#define ACE_OS_INCLUDE_SYS_OS_TIME_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_TIME_H) +# include /**/ <sys/time.h> +#endif /* !ACE_LACKS_SYS_TIME_H */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS == 0x620) +# include /**/ <time.h> // VxWorks 6.2 defined timeval in time.h +#endif + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_HAS_SVR4_GETTIMEOFDAY) +# if !defined (m88k) && !defined (SCO) + int gettimeofday (struct timeval *tp, void * = 0); +# else + int gettimeofday (struct timeval *tp); +# endif /* !m88k && !SCO */ +#elif defined (ACE_HAS_OSF1_GETTIMEOFDAY) + int gettimeofday (struct timeval *tp, struct timezone * = 0); +#elif defined (ACE_HAS_VOIDPTR_GETTIMEOFDAY) +# define ACE_HAS_SVR4_GETTIMEOFDAY +#endif /* ACE_HAS_SVR4_GETTIMEOFDAY */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_TIME_H */ diff --git a/ACE/ace/os_include/sys/os_timeb.h b/ACE/ace/os_include/sys/os_timeb.h new file mode 100644 index 00000000000..2495097d344 --- /dev/null +++ b/ACE/ace/os_include/sys/os_timeb.h @@ -0,0 +1,49 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_timeb.h + * + * additional definitions for date and time + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_TIMEB_H +#define ACE_OS_INCLUDE_SYS_OS_TIMEB_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_TIMEB_H) +# include /**/ <sys/timeb.h> +#endif /* !ACE_LACKS_SYS_TIMEB_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (__BORLANDC__) && (__BORLANDC__ <= 0x560) +# define _ftime ftime +# define _timeb timeb +#endif /* __BORLANDC__ */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_TIMEB_H */ diff --git a/ACE/ace/os_include/sys/os_times.h b/ACE/ace/os_include/sys/os_times.h new file mode 100644 index 00000000000..c63b9e0098c --- /dev/null +++ b/ACE/ace/os_include/sys/os_times.h @@ -0,0 +1,44 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_times.h + * + * file access and modification times structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_TIMES_H +#define ACE_OS_INCLUDE_SYS_OS_TIMES_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" + +#if !defined (ACE_LACKS_SYS_TIMES_H) +# include /**/ <sys/times.h> +#endif /* !ACE_LACKS_SYS_TIMES_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_TIMES_H */ diff --git a/ACE/ace/os_include/sys/os_types.h b/ACE/ace/os_include/sys/os_types.h new file mode 100644 index 00000000000..30672051185 --- /dev/null +++ b/ACE/ace/os_include/sys/os_types.h @@ -0,0 +1,151 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_types.h + * + * data types + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_TYPES_H +#define ACE_OS_INCLUDE_SYS_OS_TYPES_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_stddef.h" + +#if !defined (ACE_LACKS_SYS_TYPES_H) +# include /**/ <sys/types.h> +#endif /* !ACE_LACKS_SYS_TYPES_H */ + +#if defined (ACE_HAS_WINCE) +# include /**/ <types.h> +#endif /* ACE_HAS_WINCE */ + +# if defined (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB) && \ + (ACE_USES_STD_NAMESPACE_FOR_STDC_LIB != 0) +using std::time_t; +# endif /* ACE_USES_STD_NAMESPACE_FOR_STDC_LIB */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +typedef double ACE_timer_t; + +// todo: don't forget to clean this up! ;-) +#if !defined (ACE_HAS_CLOCK_GETTIME) && !(defined (_CLOCKID_T_) || defined (_CLOCKID_T)) + typedef int clockid_t; +# if !defined (CLOCK_REALTIME) +# define CLOCK_REALTIME 0 +# endif /* CLOCK_REALTIME */ +#endif /* ! ACE_HAS_CLOCK_GETTIME && ! _CLOCKID_T_ */ + +#if defined (ACE_HAS_WINCE) + +// CE's add-on for c-style fstat/stat functionalities. This struct is +// by no mean complete compared to what you usually find in UNIX +// platforms. Only members that have direct conversion using Win32's +// BY_HANDLE_FILE_INFORMATION are defined so that users can discover +// non-supported members at compile time. Time values are of type +// ACE_Time_Value for easy comparison. + +// Since CE does not have _stat by default as NT/2000 does, the 'stat' +// struct defined here will be used. Also note that CE file system +// struct is only for the CE 3.0 or later. +// Refer to the WCHAR.H from Visual C++ and WIBASE.H from eVC 3.0. + + typedef unsigned int dev_t; +#endif /* ACE_HAS_WINCE */ + +#if defined (ACE_SIZEOF_LONG) && ACE_SIZEOF_LONG == 8 + typedef off_t ACE_LOFF_T; +#elif defined (__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__APPLE__) || \ + (defined (ACE_OPENVMS) && defined (_LARGEFILE)) + typedef off_t ACE_LOFF_T; +#elif defined (__sgi) || defined (AIX) || defined (HPUX) || defined (__QNX__) + typedef off64_t ACE_LOFF_T; +#elif defined (__sun) + typedef offset_t ACE_LOFF_T; +#elif defined (WIN32) + typedef __int64 ACE_LOFF_T; +#elif (defined (ACE_VXWORKS) && (ACE_VXWORKS == 0x630 || ACE_VXWORKS == 0x620 || ACE_VXWORKS == 0x551)) || \ + defined (ACE_LYNXOS_MAJOR) || \ + (defined (ACE_OPENVMS) && !defined (_LARGEFILE)) + typedef long long ACE_LOFF_T; +#else + typedef loff_t ACE_LOFF_T; +#endif + +#if defined (ACE_WIN32) +# if !defined (__BORLANDC__) + typedef DWORD nlink_t; +# if !defined(__MINGW32__) + typedef u_short mode_t; +# endif /* !__MINGW32__ */ + typedef long uid_t; + typedef long gid_t; +# endif /* __BORLANDC__ */ + typedef char *caddr_t; +#endif /* ACE_WIN32 */ + +#if defined (ACE_LACKS_KEY_T) +# if defined (ACE_WIN32) + // Win32 doesn't use numeric values to name its semaphores, it uses + // strings! + typedef char *key_t; +# else + typedef int key_t; +# endif /* ACE_WIN32 */ +#endif /* ACE_LACKS_KEY_T */ + +#if !defined (ACE_HAS_SSIZE_T) +# if defined (ACE_WIN64) + typedef SSIZE_T ssize_t; +# else + typedef int ssize_t; +# endif /* ACE_WIN64 */ +#endif /* ACE_HAS_SSIZE_T */ + +#if defined (ACE_WIN32) + typedef DWORD ACE_exitcode; +#else + typedef int ACE_exitcode; +#endif /* ACE_WIN32 */ + +#if defined (ACE_LACKS_SUSECONDS_T) + typedef long suseconds_t; +#endif + +#if defined (ACE_LACKS_USECONDS_T) + typedef unsigned long useconds_t; +#endif + +#if defined (ACE_WIN32) && !defined(__MINGW32__) + typedef long pid_t; +#endif /* ACE_WIN32 */ + +# if !defined (ACE_INVALID_PID) +# define ACE_INVALID_PID ((pid_t) -1) +# endif /* ACE_INVALID_PID */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_TYPES_H */ diff --git a/ACE/ace/os_include/sys/os_uio.h b/ACE/ace/os_include/sys/os_uio.h new file mode 100644 index 00000000000..1a7fd505c39 --- /dev/null +++ b/ACE/ace/os_include/sys/os_uio.h @@ -0,0 +1,85 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_uio.h + * + * definitions for vector I/O operations + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_UIO_H +#define ACE_OS_INCLUDE_SYS_OS_UIO_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_types.h" +#include "ace/os_include/os_limits.h" + +#if !defined (ACE_LACKS_SYS_UIO_H) +# include /**/ <sys/uio.h> +#endif /* !ACE_LACKS_SYS_UIO_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +// todo: make this a regular ACE_LACKS macro test... +#if defined(__rtems__) + struct iovec { + /// Base address. + char *iov_base; + /// Length. + size_t iov_len; + }; +#elif defined (ACE_WIN32) + /// The ordering of the fields in this struct is important. It has to + /// match those in WSABUF. + struct iovec + { + /// byte count to read/write + u_long iov_len; + /// data to be read/written + char *iov_base; + + // WSABUF is a Winsock2-only type. +# if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) + operator WSABUF &(void) { return *((WSABUF *) this); } +# endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */ + }; +#endif /* __rtems__ */ + + +# if defined (ACE_LACKS_TIMEDWAIT_PROTOTYPES) + + ssize_t readv_timedwait (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + struct timespec* timeout); + + ssize_t writev_timedwait (ACE_HANDLE handle, + const iovec *iov, + int iovcnt, + struct timespec *timeout); + +# endif /* ACE_LACKS_TIMEDWAIT_PROTOTYPES */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_UIO_H */ diff --git a/ACE/ace/os_include/sys/os_un.h b/ACE/ace/os_include/sys/os_un.h new file mode 100644 index 00000000000..a9bf2457dc1 --- /dev/null +++ b/ACE/ace/os_include/sys/os_un.h @@ -0,0 +1,52 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_un.h + * + * definitions for UNIX domain sockets + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_UN_H +#define ACE_OS_INCLUDE_SYS_OS_UN_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/sys/os_socket.h" + +#if !defined (ACE_LACKS_SYS_UN_H) +# include /**/ <sys/un.h> +#endif /* !ACE_LACKS_SYS_UN_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x600) +struct sockaddr_un { + short sun_family; // AF_UNIX. + char sun_path[108]; // path name. +}; +#endif /* ACE_VXWORKS */ + + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_UN_H */ diff --git a/ACE/ace/os_include/sys/os_utsname.h b/ACE/ace/os_include/sys/os_utsname.h new file mode 100644 index 00000000000..d707cbecc7d --- /dev/null +++ b/ACE/ace/os_include/sys/os_utsname.h @@ -0,0 +1,42 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_utsname.h + * + * system name structure + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_UTSNAME_H +#define ACE_OS_INCLUDE_SYS_OS_UTSNAME_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#if !defined (ACE_LACKS_SYS_UTSNAME_H) +# include /**/ <sys/utsname.h> +#endif /* !ACE_LACKS_SYS_UTSNAME_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_UTSNAME_H */ diff --git a/ACE/ace/os_include/sys/os_wait.h b/ACE/ace/os_include/sys/os_wait.h new file mode 100644 index 00000000000..eb9f7e1d2de --- /dev/null +++ b/ACE/ace/os_include/sys/os_wait.h @@ -0,0 +1,97 @@ +// -*- C++ -*- + +//============================================================================= +/** + * @file os_wait.h + * + * declarations for waiting + * + * $Id$ + * + * @author Don Hinton <dhinton@dresystems.com> + * @author This code was originally in various places including ace/OS.h. + */ +//============================================================================= + +#ifndef ACE_OS_INCLUDE_SYS_OS_WAIT_H +#define ACE_OS_INCLUDE_SYS_OS_WAIT_H + +#include /**/ "ace/pre.h" + +#include "ace/config-lite.h" + +#if !defined (ACE_LACKS_PRAGMA_ONCE) +# pragma once +#endif /* ACE_LACKS_PRAGMA_ONCE */ + +#include "ace/os_include/os_signal.h" +#include "ace/os_include/sys/os_resource.h" + +#if !defined (ACE_LACKS_SYS_WAIT_H) +# include /**/ <sys/wait.h> +#endif /* !ACE_LACKS_SYS_WAIT_H */ + +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + + // Wrapping around wait status <wstat> macros for platforms that + // lack them. + +# if !defined (WCOREDUMP) +# define WCOREDUMP(stat) 0 +# endif /* WCOREDUMP */ + +# if !defined (WNOHANG) +# define WNOHANG 0100 +# endif /* !WNOHANG */ + + // If the value of WIFEXITED(stat) is non-zero, this macro evaluates + // to the exit code that the child process exit(3C), or the value + // that the child process returned from main. Peaceful exit code is + // 0. +# if !defined (WEXITSTATUS) +# define WEXITSTATUS(stat) stat +# endif /* WEXITSTATUS */ + +# if !defined (WIFCONTINUED) +# define WIFCONTINUED(stat) 0 +# endif /* WIFCONTINUED */ + + // Evaluates to a non-zero value if status was returned for a child + // process that terminated normally. 0 means status wasn't + // returned. +# if !defined (WIFEXITED) +# define WIFEXITED(stat) 1 +# endif /* WIFEXITED */ + + // Evaluates to a non-zero value if status was returned for a child + // process that terminated due to the receipt of a signal. 0 means + // status wasnt returned. +# if !defined (WIFSIGNALED) +# define WIFSIGNALED(stat) 0 +# endif /* WIFSIGNALED */ + +# if !defined (WIFSTOPPED) +# define WIFSTOPPED(stat) 0 +# endif /* WIFSTOPPED */ + +# if !defined (WSTOPSIG) +# define WSTOPSIG(stat) 0 +# endif /* WSTOPSIG */ + + // If the value of WIFSIGNALED(stat) is non-zero, this macro + // evaluates to the number of the signal that caused the + // termination of the child process. +# if !defined (WTERMSIG) +# define WTERMSIG(stat) 0 +# endif /* WTERMSIG */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + +#include /**/ "ace/post.h" +#endif /* ACE_OS_INCLUDE_SYS_OS_WAIT_H */ |