Classes | |
struct | macaddr_node_t |
class | ace_flock_t |
OS file locking structure. More... | |
Functions from <cctype> | |
Included are the functions defined in <cctype> and their <cwctype> equivalents.
Since they are often implemented as macros, we don't use the same name here. Instead, we change by prepending "ace_". | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isalnum (ACE_TCHAR c) |
Returns true if the character is an alphanumeric character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isalpha (ACE_TCHAR c) |
Returns true if the character is an alphabetic character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_iscntrl (ACE_TCHAR c) |
Returns true if the character is a control character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isdigit (ACE_TCHAR c) |
Returns true if the character is a decimal-digit character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isgraph (ACE_TCHAR c) |
Returns true if the character is a printable character other than a space. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_islower (ACE_TCHAR c) |
Returns true if the character is a lowercase character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isprint (ACE_TCHAR c) |
Returns true if the character is a printable character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_ispunct (ACE_TCHAR c) |
Returns true if the character is a punctuation character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isspace (ACE_TCHAR c) |
Returns true if the character is a space character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isupper (ACE_TCHAR c) |
Returns true if the character is an uppercase character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_isxdigit (ACE_TCHAR c) |
Returns true if the character is a hexadecimal-digit character. | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_tolower (int c) |
Converts a character to lower case (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | ace_toupper (int c) |
Converts a character to upper case (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | dlclose (ACE_SHLIB_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR * | dlerror (void) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_SHLIB_HANDLE | dlopen (const ACE_TCHAR *filename, int mode=ACE_DEFAULT_SHLIB_MODE) |
ACE_NAMESPACE_INLINE_FUNCTION void * | dlsym (ACE_SHLIB_HANDLE handle, const ACE_TCHAR *symbol) |
ACE_NAMESPACE_INLINE_FUNCTION void | endpwent (void) |
ACE_NAMESPACE_INLINE_FUNCTION struct passwd * | getpwent (void) |
ACE_NAMESPACE_INLINE_FUNCTION struct passwd * | getpwnam (const char *user) |
ACE_NAMESPACE_INLINE_FUNCTION struct passwd * | getpwnam_r (const char *name, struct passwd *pwent, char *buffer, int buflen) |
ACE_NAMESPACE_INLINE_FUNCTION void | setpwent (void) |
ACE_NAMESPACE_INLINE_FUNCTION char * | compile (const char *instring, char *expbuf, char *endbuf) |
ACE_NAMESPACE_INLINE_FUNCTION int | step (const char *str, char *expbuf) |
ACE_NAMESPACE_INLINE_FUNCTION int | kill (pid_t pid, int signum) |
ACE_NAMESPACE_INLINE_FUNCTION int | pthread_sigmask (int how, const sigset_t *nsp, sigset_t *osp) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigaction (int signum, const ACE_SIGACTION *nsa, ACE_SIGACTION *osa) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigaddset (sigset_t *s, int signum) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigdelset (sigset_t *s, int signum) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigemptyset (sigset_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigfillset (sigset_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigismember (sigset_t *s, int signum) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_SignalHandler | signal (int signum, ACE_SignalHandler) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigprocmask (int how, const sigset_t *nsp, sigset_t *osp) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigsuspend (const sigset_t *set) |
ACE_NAMESPACE_INLINE_FUNCTION char * | cuserid (char *user, size_t maxlen=ACE_MAX_USERID) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_init (ace_flock_t *lock, int flags=0, const ACE_TCHAR *name=0, mode_t perms=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_destroy (ace_flock_t *lock, int unlink_file=1) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_rdlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_tryrdlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_trywrlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_unlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | flock_wrlock (ace_flock_t *lock, short whence=0, ACE_OFF_T start=0, ACE_OFF_T len=0) |
Non-standard functions | |
These functions aren't in the standard. | |
void * | calloc (size_t elements, size_t sizeof_elements) |
void | exit (int status) |
void | free (void *ptr) |
ACE_TCHAR * | getenvstrings (void) |
ACE_TCHAR * | strenvdup (const ACE_TCHAR *str) |
char * | itoa_emulation (int value, char *string, int radix) |
Emulated itoa - Converts an integer to a string. | |
void * | malloc (size_t nbytes) |
void * | realloc (void *ptr, size_t nbytes) |
const char * | getprogname_emulation () |
void | setprogname_emulation (const char *progname) |
ACE_NAMESPACE_INLINE_FUNCTION void | _exit (int status=0) |
ACE_NAMESPACE_INLINE_FUNCTION void | abort (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | atexit (ACE_EXIT_HOOK func) |
ACE_NAMESPACE_INLINE_FUNCTION int | atoi (const char *s) |
ACE_NAMESPACE_INLINE_FUNCTION void * | atop (const char *s) |
ACE_NAMESPACE_INLINE_FUNCTION void * | bsearch (const void *key, const void *base, size_t nel, size_t size, ACE_COMPARE_FUNC) |
ACE_NAMESPACE_INLINE_FUNCTION char * | getenv (const char *symbol) |
ACE_NAMESPACE_INLINE_FUNCTION char * | itoa (int value, char *string, int radix) |
Converts an integer to a string. | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | mkstemp (char *s) |
ACE_NAMESPACE_INLINE_FUNCTION char * | mktemp (char *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | putenv (const char *string) |
ACE_NAMESPACE_INLINE_FUNCTION void | qsort (void *base, size_t nel, size_t width, ACE_COMPARE_FUNC) |
ACE_NAMESPACE_INLINE_FUNCTION int | rand (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | rand_r (ACE_RANDR_TYPE &seed) |
ACE_NAMESPACE_INLINE_FUNCTION char * | realpath (const char *file_name, char *resolved_name) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_EXIT_HOOK | set_exit_hook (ACE_EXIT_HOOK hook) |
For use by ACE_Object_Manager only, to register its exit hook.. | |
ACE_NAMESPACE_INLINE_FUNCTION void | srand (u_int seed) |
ACE_NAMESPACE_INLINE_FUNCTION double | strtod (const char *s, char **endptr) |
Converts a string to a double value (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION long | strtol (const char *s, char **ptr, int base) |
Converts a string to a long value (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION unsigned long | strtoul (const char *s, char **ptr, int base) |
Converts a string to an unsigned long value (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | system (const ACE_TCHAR *s) |
ACE_NAMESPACE_INLINE_FUNCTION const char * | getprogname () |
ACE_NAMESPACE_INLINE_FUNCTION void | setprogname (const char *name) |
ACE_Export ACE_EXIT_HOOK | exit_hook_ = 0 |
Function that is called by <ACE_OS::exit>, if non-null. | |
Functions from <cstring> | |
Included are the functions defined in <cstring> and their <cwchar> equivalents.
| |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL char * | strecpy (char *s, const char *t) |
char * | strerror (int errnum) |
const char * | strnchr (const char *s, int c, size_t len) |
const ACE_WCHAR_T * | strnchr (const ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len) |
const char * | strnstr (const char *s1, const char *s2, size_t len2) |
const ACE_WCHAR_T * | strnstr (const ACE_WCHAR_T *s1, const ACE_WCHAR_T *s2, size_t len2) |
char * | strsncpy (char *dst, const char *src, size_t maxlen) |
This is a "safe" c string copy function (char version). | |
ACE_WCHAR_T * | strsncpy (ACE_WCHAR_T *dst, const ACE_WCHAR_T *src, size_t maxlen) |
This is a "safe" c string copy function (wchar_t version). | |
ACE_NAMESPACE_INLINE_FUNCTION const void * | memchr (const void *s, int c, size_t len) |
Finds characters in a buffer (const void version). | |
ACE_NAMESPACE_INLINE_FUNCTION void * | memchr (void *s, int c, size_t len) |
Finds characters in a buffer (void version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | memcmp (const void *t, const void *s, size_t len) |
Compares two buffers. | |
ACE_NAMESPACE_INLINE_FUNCTION void * | memcpy (void *t, const void *s, size_t len) |
Copies one buffer to another. | |
ACE_NAMESPACE_INLINE_FUNCTION void * | memmove (void *t, const void *s, size_t len) |
Moves one buffer to another. | |
ACE_NAMESPACE_INLINE_FUNCTION void * | memset (void *s, int c, size_t len) |
Fills a buffer with a character value. | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strcat (char *s, const char *t) |
Appends a string to another string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION const char * | strchr (const char *s, int c) |
ACE_NAMESPACE_INLINE_FUNCTION char * | strchr (char *s, int c) |
Finds the first occurance of a character in a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strcmp (const char *s, const char *t) |
Compares two strings (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strcmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t) |
Compares two strings (wchar_t version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strcpy (char *s, const char *t) |
Copies a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strcspn (const char *s, const char *reject) |
ACE_NAMESPACE_INLINE_FUNCTION char * | strdup (const char *s) |
Returns a malloced duplicated string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strlen (const char *s) |
Finds the length of a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strlen (const ACE_WCHAR_T *s) |
Finds the length of a string (ACE_WCHAR_T version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strncat (char *s, const char *t, size_t len) |
Appends part of a string to another string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T * | strncat (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Appends part of a string to another string (wchar_t version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strnchr (char *s, int c, size_t len) |
Finds the first occurance of a character in an array (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T * | strnchr (ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len) |
Finds the first occurance of a character in an array (ACE_WCHAR_T version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strncmp (const char *s, const char *t, size_t len) |
Compares two arrays (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strncmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Compares two arrays (wchar_t version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strncpy (char *s, const char *t, size_t len) |
Copies an array (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T * | strncpy (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Copies an array (ACE_WCHAR_T version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strnlen (const char *s, size_t maxlen) |
Finds the length of a limited-length string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strnlen (const ACE_WCHAR_T *s, size_t maxlen) |
Finds the length of a limited-length string (ACE_WCHAR_T version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strnstr (char *s, const char *t, size_t len) |
Finds the first occurance of a substring in an array (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T * | strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Finds the first occurance of a substring in an array (wchar_t version). | |
ACE_NAMESPACE_INLINE_FUNCTION const char * | strpbrk (const char *s1, const char *s2) |
Searches for characters in a string (const char version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strpbrk (char *s1, const char *s2) |
Searches for characters in a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION const char * | strrchr (const char *s, int c) |
ACE_NAMESPACE_INLINE_FUNCTION char * | strrchr (char *s, int c) |
Finds the last occurance of a character in a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strspn (const char *s1, const char *s2) |
ACE_NAMESPACE_INLINE_FUNCTION const char * | strstr (const char *s, const char *t) |
ACE_NAMESPACE_INLINE_FUNCTION char * | strstr (char *s, const char *t) |
Finds the first occurance of a substring in a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strtok (char *s, const char *tokens) |
Finds the next token in a string (char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | madvise (caddr_t addr, size_t len, int map_advice) |
ACE_NAMESPACE_INLINE_FUNCTION void * | mmap (void *addr, size_t len, int prot, int flags, ACE_HANDLE handle, ACE_OFF_T off=0, ACE_HANDLE *file_mapping=0, LPSECURITY_ATTRIBUTES sa=0, const ACE_TCHAR *file_mapping_name=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | mprotect (void *addr, size_t len, int prot) |
ACE_NAMESPACE_INLINE_FUNCTION int | msync (void *addr, size_t len, int sync) |
ACE_NAMESPACE_INLINE_FUNCTION int | munmap (void *addr, size_t len) |
ACE_NAMESPACE_INLINE_FUNCTION int | msgctl (int msqid, int cmd, struct msqid_ds *) |
ACE_NAMESPACE_INLINE_FUNCTION int | msgget (key_t key, int msgflg) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | msgrcv (int int_id, void *buf, size_t len, long type, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | msgsnd (int int_id, const void *buf, size_t len, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION void * | shmat (int int_id, const void *shmaddr, int shmflg) |
ACE_NAMESPACE_INLINE_FUNCTION int | shmctl (int int_id, int cmd, struct shmid_ds *buf) |
ACE_NAMESPACE_INLINE_FUNCTION int | shmdt (const void *shmaddr) |
ACE_NAMESPACE_INLINE_FUNCTION int | shmget (key_t key, size_t size, int flags) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_HANDLE | accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen, const ACE_Accept_QoS_Params &qos_params) |
int | connect (ACE_HANDLE handle, const sockaddr *addr, int addrlen, const ACE_QoS_Params &qos_params) |
ACE_HANDLE | join_leaf (ACE_HANDLE socket, const sockaddr *name, int namelen, const ACE_QoS_Params &qos_params) |
Joins a leaf node into a QoS-enabled multi-point session. | |
int | socket_init (int version_high, int version_low) |
int | socket_fini (void) |
Finalize WinSock after last use (e.g., when a DLL is unloaded). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | bind (ACE_HANDLE s, struct sockaddr *name, int namelen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | closesocket (ACE_HANDLE s) |
Takes care of windows specific requirement to call closesocket. | |
ACE_NAMESPACE_INLINE_FUNCTION int | connect (ACE_HANDLE handle, struct sockaddr *addr, int addrlen) |
BSD-style <connect> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | enum_protocols (int *protocols, ACE_Protocol_Info *protocol_buffer, u_long *buffer_length) |
ACE_NAMESPACE_INLINE_FUNCTION int | getpeername (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | getsockname (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | getsockopt (ACE_HANDLE handle, int level, int optname, char *optval, int *optlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | listen (ACE_HANDLE handle, int backlog) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | recv (ACE_HANDLE handle, char *buf, size_t len, int flags=0) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | recvfrom (ACE_HANDLE handle, char *buf, size_t len, int flags, struct sockaddr *addr, int *addrlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | recvfrom (ACE_HANDLE handle, iovec *buffers, int buffer_count, size_t &number_of_bytes_recvd, int &flags, struct sockaddr *addr, int *addrlen, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | recvmsg (ACE_HANDLE handle, struct msghdr *msg, int flags) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | recvv (ACE_HANDLE handle, iovec *iov, int iovlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | send (ACE_HANDLE handle, const char *buf, size_t len, int flags=0) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | sendmsg (ACE_HANDLE handle, const struct msghdr *msg, int flags) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | sendto (ACE_HANDLE handle, const char *buf, size_t len, int flags, const struct sockaddr *addr, int addrlen) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | sendto (ACE_HANDLE handle, const iovec *buffers, int buffer_count, size_t &number_of_bytes_sent, int flags, const struct sockaddr *addr, int addrlen, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | sendv (ACE_HANDLE handle, const iovec *iov, int iovcnt) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION int | setsockopt (ACE_HANDLE handle, int level, int optname, const char *optval, int optlen) |
Manipulate the options associated with a socket. | |
ACE_NAMESPACE_INLINE_FUNCTION int | shutdown (ACE_HANDLE handle, int how) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | socket (int protocol_family, int type, int proto) |
Create a BSD-style socket (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | socket (int protocol_family, int type, int proto, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | socketpair (int domain, int type, int protocol, ACE_HANDLE sv[2]) |
BSD-style <accept> (no QoS). | |
ACE_NAMESPACE_INLINE_FUNCTION ACE_OFF_T | filesize (ACE_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_OFF_T | filesize (const ACE_TCHAR *handle) |
int | cond_init (ACE_cond_t *cv, short type, const char *name, void *arg) |
int | event_destroy (ACE_event_t *event) |
int | event_init (ACE_event_t *event, int manual_reset, int initial_state, int type, const char *name, void *arg, LPSECURITY_ATTRIBUTES sa) |
int | event_pulse (ACE_event_t *event) |
int | event_reset (ACE_event_t *event) |
int | event_signal (ACE_event_t *event) |
int | event_timedwait (ACE_event_t *event, ACE_Time_Value *timeout, int use_absolute_time) |
int | event_wait (ACE_event_t *event) |
ACE_NAMESPACE_INLINE_FUNCTION int | condattr_init (ACE_condattr_t &attributes, int type=ACE_DEFAULT_SYNCH_TYPE) |
ACE_NAMESPACE_INLINE_FUNCTION int | condattr_destroy (ACE_condattr_t &attributes) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_broadcast (ACE_cond_t *cv) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_destroy (ACE_cond_t *cv) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_init (ACE_cond_t *cv, ACE_condattr_t &attributes, const char *name=0, void *arg=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_signal (ACE_cond_t *cv) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_timedwait (ACE_cond_t *cv, ACE_mutex_t *m, ACE_Time_Value *) |
ACE_NAMESPACE_INLINE_FUNCTION int | cond_wait (ACE_cond_t *cv, ACE_mutex_t *m) |
int | mutex_init (ACE_mutex_t *m, int lock_scope, const char *name, ACE_mutexattr_t *attributes, LPSECURITY_ATTRIBUTES sa, int lock_type) |
int | mutex_destroy (ACE_mutex_t *m) |
int | mutex_lock (ACE_mutex_t *m) |
int | mutex_lock (ACE_mutex_t *m, int &abandoned) |
int | mutex_lock (ACE_mutex_t *m, const ACE_Time_Value &timeout) |
int | mutex_trylock (ACE_mutex_t *m) |
int | mutex_trylock (ACE_mutex_t *m, int &abandoned) |
int | mutex_unlock (ACE_mutex_t *m) |
void | mutex_lock_cleanup (void *mutex) |
Handle asynchronous thread cancellation cleanup. | |
ACE_NAMESPACE_INLINE_FUNCTION int | mutex_lock (ACE_mutex_t *m, const ACE_Time_Value *timeout) |
int | rwlock_init (ACE_rwlock_t *rw, int type, const ACE_TCHAR *name, void *arg) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_rdlock (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_tryrdlock (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_trywrlock (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_trywrlock_upgrade (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_unlock (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rw_wrlock (ACE_rwlock_t *rw) |
ACE_NAMESPACE_INLINE_FUNCTION int | rwlock_destroy (ACE_rwlock_t *rw) |
int | sched_params (const ACE_Sched_Params &sched_params, ACE_id_t id) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, ACE_recursive_mutex_state &state) |
ACE_NAMESPACE_INLINE_FUNCTION void | recursive_mutex_cond_relock (ACE_recursive_thread_mutex_t *m, ACE_recursive_mutex_state &state) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_destroy (ACE_recursive_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_init (ACE_recursive_thread_mutex_t *m, const ACE_TCHAR *name=0, ACE_mutexattr_t *arg=0, LPSECURITY_ATTRIBUTES sa=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m, const ACE_Time_Value &timeout) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m, const ACE_Time_Value *timeout) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_trylock (ACE_recursive_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | recursive_mutex_unlock (ACE_recursive_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_destroy (ACE_sema_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_init (ACE_sema_t *s, u_int count, int type=ACE_DEFAULT_SYNCH_TYPE, const char *name=0, void *arg=0, int max=0x7fffffff, LPSECURITY_ATTRIBUTES sa=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_post (ACE_sema_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_post (ACE_sema_t *s, u_int release_count) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_trywait (ACE_sema_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_wait (ACE_sema_t *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) |
ACE_NAMESPACE_INLINE_FUNCTION int | sema_wait (ACE_sema_t *s, ACE_Time_Value *tv) |
ACE_NAMESPACE_INLINE_FUNCTION int | semctl (int int_id, int semnum, int cmd, semun) |
ACE_NAMESPACE_INLINE_FUNCTION int | semget (key_t key, int nsems, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | semop (int int_id, struct sembuf *sops, size_t nsops) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_destroy (ACE_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_init (ACE_thread_mutex_t *m, int lock_type=0, const char *name=0, ACE_mutexattr_t *arg=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_lock (ACE_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_lock (ACE_thread_mutex_t *m, const ACE_Time_Value &timeout) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_lock (ACE_thread_mutex_t *m, const ACE_Time_Value *timeout) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_trylock (ACE_thread_mutex_t *m) |
ACE_NAMESPACE_INLINE_FUNCTION int | thread_mutex_unlock (ACE_thread_mutex_t *m) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL struct tm * | localtime_r (const time_t *t, struct tm *res) |
time_t | mktime (struct tm *t) |
ACE_NAMESPACE_INLINE_FUNCTION char * | asctime (const struct tm *tm) |
ACE_NAMESPACE_INLINE_FUNCTION char * | asctime_r (const struct tm *tm, char *buf, int buflen) |
ACE_NAMESPACE_INLINE_FUNCTION int | clock_gettime (clockid_t, struct timespec *) |
ACE_NAMESPACE_INLINE_FUNCTION int | clock_settime (clockid_t, const struct timespec *) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR * | ctime (const time_t *t) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR * | ctime_r (const time_t *clock, ACE_TCHAR *buf, int buflen) |
ACE_NAMESPACE_INLINE_FUNCTION double | difftime (time_t t1, time_t t0) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_hrtime_t | gethrtime (const ACE_HRTimer_Op=ACE_HRTIMER_GETTIME) |
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | gmtime (const time_t *clock) |
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | gmtime_r (const time_t *clock, struct tm *res) |
ACE_NAMESPACE_INLINE_FUNCTION struct tm * | localtime (const time_t *clock) |
ACE_NAMESPACE_INLINE_FUNCTION int | nanosleep (const struct timespec *requested, struct timespec *remaining=0) |
ACE_NAMESPACE_INLINE_FUNCTION size_t | strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr) |
ACE_NAMESPACE_INLINE_FUNCTION char * | strptime (const char *buf, const char *format, struct tm *tm) |
ACE_NAMESPACE_INLINE_FUNCTION time_t | time (time_t *tloc=0) |
ACE_NAMESPACE_INLINE_FUNCTION long | timezone (void) |
ACE_NAMESPACE_INLINE_FUNCTION void | tzset (void) |
pid_t | fork (const ACE_TCHAR *program_name) |
pid_t | fork_exec (ACE_TCHAR *argv[]) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | fork (void) |
ACE_Export ACE_thread_t | NULL_thread |
ACE_Export ACE_hthread_t | NULL_hthread |
ACE_Export ACE_thread_key_t | NULL_key |
Typedefs | |
typedef ACE_WCHAR_T | WChar |
Enumerations | |
enum | ACE_HRTimer_Op { ACE_HRTIMER_START = 0x0, ACE_HRTIMER_INCR = 0x1, ACE_HRTIMER_STOP = 0x2, ACE_HRTIMER_GETTIME = 0xFFFF } |
Functions | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | inet_aton (const char *host_name, struct in_addr *addr) |
ACE_NAMESPACE_INLINE_FUNCTION unsigned long | inet_addr (const char *name) |
ACE_NAMESPACE_INLINE_FUNCTION char * | inet_ntoa (const struct in_addr addr) |
ACE_NAMESPACE_INLINE_FUNCTION const char * | inet_ntop (int family, const void *addrptr, char *strptr, size_t len) |
ACE_NAMESPACE_INLINE_FUNCTION int | inet_pton (int family, const char *strptr, void *addrptr) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE unsigned long | inet_addr (const char *name) |
ACE_INLINE char * | inet_ntoa (const struct in_addr addr) |
ACE_INLINE const char * | inet_ntop (int family, const void *addrptr, char *strptr, size_t len) |
ACE_INLINE int | inet_pton (int family, const char *strptr, void *addrptr) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | ace_isalnum (ACE_TCHAR c) |
Returns true if the character is an alphanumeric character. | |
ACE_INLINE int | ace_isalpha (ACE_TCHAR c) |
Returns true if the character is an alphabetic character. | |
ACE_INLINE int | ace_iscntrl (ACE_TCHAR c) |
Returns true if the character is a control character. | |
ACE_INLINE int | ace_isdigit (ACE_TCHAR c) |
Returns true if the character is a decimal-digit character. | |
ACE_INLINE int | ace_isgraph (ACE_TCHAR c) |
Returns true if the character is a printable character other than a space. | |
ACE_INLINE int | ace_islower (ACE_TCHAR c) |
Returns true if the character is a lowercase character. | |
ACE_INLINE int | ace_isprint (ACE_TCHAR c) |
Returns true if the character is a printable character. | |
ACE_INLINE int | ace_ispunct (ACE_TCHAR c) |
Returns true if the character is a punctuation character. | |
ACE_INLINE int | ace_isspace (ACE_TCHAR c) |
Returns true if the character is a space character. | |
ACE_INLINE int | ace_isupper (ACE_TCHAR c) |
Returns true if the character is an uppercase character. | |
ACE_INLINE int | ace_isxdigit (ACE_TCHAR c) |
Returns true if the character is a hexadecimal-digit character. | |
ACE_INLINE int | ace_tolower (int c) |
Converts a character to lower case (char version). | |
ACE_INLINE int | ace_toupper (int c) |
Converts a character to upper case (char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | scandir_emulation (const ACE_TCHAR *dirname, ACE_DIRENT **namelist[], ACE_SCANDIR_SELECTOR selector, ACE_SCANDIR_COMPARATOR comparator) |
ACE_NAMESPACE_INLINE_FUNCTION void | closedir (ACE_DIR *) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_DIR * | opendir (const ACE_TCHAR *filename) |
ACE_NAMESPACE_INLINE_FUNCTION struct ACE_DIRENT * | readdir (ACE_DIR *) |
ACE_NAMESPACE_INLINE_FUNCTION int | readdir_r (ACE_DIR *dirp, struct ACE_DIRENT *entry, struct ACE_DIRENT **result) |
ACE_NAMESPACE_INLINE_FUNCTION void | rewinddir (ACE_DIR *) |
ACE_NAMESPACE_INLINE_FUNCTION int | scandir (const ACE_TCHAR *dirname, struct ACE_DIRENT **namelist[], ACE_SCANDIR_SELECTOR selector, ACE_SCANDIR_COMPARATOR comparator) |
ACE_NAMESPACE_INLINE_FUNCTION int | alphasort (const void *, const void *) |
ACE_NAMESPACE_INLINE_FUNCTION void | seekdir (ACE_DIR *, long loc) |
ACE_NAMESPACE_INLINE_FUNCTION long | telldir (ACE_DIR *) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | dlclose (ACE_SHLIB_HANDLE handle) |
ACE_INLINE ACE_TCHAR * | dlerror (void) |
ACE_INLINE ACE_SHLIB_HANDLE | dlopen (const ACE_TCHAR *fname, int mode) |
ACE_INLINE void * | dlsym (ACE_SHLIB_HANDLE handle, const ACE_TCHAR *sname) |
ACE_NAMESPACE_INLINE_FUNCTION int | last_error (void) |
ACE_NAMESPACE_INLINE_FUNCTION void | last_error (int error) |
ACE_NAMESPACE_INLINE_FUNCTION int | set_errno_to_last_error (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | set_errno_to_wsa_last_error (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | last_error (void) |
ACE_INLINE void | last_error (int error) |
ACE_INLINE int | set_errno_to_last_error (void) |
ACE_INLINE int | set_errno_to_wsa_last_error (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_HANDLE | open (const char *filename, int mode, mode_t perms, LPSECURITY_ATTRIBUTES sa) |
ACE_NAMESPACE_INLINE_FUNCTION int | fcntl (ACE_HANDLE handle, int cmd, long arg=0) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | fcntl (ACE_HANDLE handle, int cmd, long arg) |
ACE_NAMESPACE_INLINE_FUNCTION double | floor (double x) |
This method computes the largest integral value not greater than x. | |
ACE_NAMESPACE_INLINE_FUNCTION double | ceil (double x) |
This method computes the smallest integral value not less than x. | |
ACE_NAMESPACE_INLINE_FUNCTION double | log2 (double x) |
This method computes the base-2 logarithm of x. | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_END_VERSIONED_NAMESPACE_DECL ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | getmacaddress (struct macaddr_node_t *node) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | gethostbyaddr (const char *addr, int length, int type) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | gethostbyaddr_r (const char *addr, int length, int type, struct hostent *result, ACE_HOSTENT_DATA buffer, int *h_errnop) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | gethostbyname (const char *name) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | gethostbyname_r (const char *name, struct hostent *result, ACE_HOSTENT_DATA buffer, int *h_errnop) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | getipnodebyaddr (const void *src, size_t len, int family) |
ACE_NAMESPACE_INLINE_FUNCTION struct hostent * | getipnodebyname (const char *name, int family, int flags=0) |
ACE_NAMESPACE_INLINE_FUNCTION struct protoent * | getprotobyname (const char *name) |
ACE_NAMESPACE_INLINE_FUNCTION struct protoent * | getprotobyname_r (const char *name, struct protoent *result, ACE_PROTOENT_DATA buffer) |
ACE_NAMESPACE_INLINE_FUNCTION struct protoent * | getprotobynumber (int proto) |
ACE_NAMESPACE_INLINE_FUNCTION struct protoent * | getprotobynumber_r (int proto, struct protoent *result, ACE_PROTOENT_DATA buffer) |
ACE_NAMESPACE_INLINE_FUNCTION struct servent * | getservbyname (const char *svc, const char *proto) |
ACE_NAMESPACE_INLINE_FUNCTION struct servent * | getservbyname_r (const char *svc, const char *proto, struct servent *result, ACE_SERVENT_DATA buf) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE struct hostent * | gethostbyaddr (const char *addr, int length, int type) |
ACE_INLINE struct hostent * | gethostbyaddr_r (const char *addr, int length, int type, struct hostent *result, ACE_HOSTENT_DATA buffer, int *h_errnop) |
ACE_INLINE struct hostent * | gethostbyname (const char *name) |
ACE_INLINE struct hostent * | gethostbyname_r (const char *name, struct hostent *result, ACE_HOSTENT_DATA buffer, int *h_errnop) |
ACE_INLINE struct hostent * | getipnodebyaddr (const void *src, size_t len, int family) |
ACE_INLINE struct hostent * | getipnodebyname (const char *name, int family, int flags) |
ACE_INLINE struct protoent * | getprotobyname (const char *name) |
ACE_INLINE struct protoent * | getprotobyname_r (const char *name, struct protoent *result, ACE_PROTOENT_DATA buffer) |
ACE_INLINE struct protoent * | getprotobynumber (int proto) |
ACE_INLINE struct protoent * | getprotobynumber_r (int proto, struct protoent *result, ACE_PROTOENT_DATA buffer) |
ACE_INLINE struct servent * | getservbyname (const char *svc, const char *proto) |
ACE_INLINE struct servent * | getservbyname_r (const char *svc, const char *proto, struct servent *result, ACE_SERVENT_DATA buf) |
ACE_NAMESPACE_INLINE_FUNCTION int | poll (struct pollfd *pollfds, unsigned long len, const ACE_Time_Value *tv=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | poll (struct pollfd *pollfds, unsigned long len, const ACE_Time_Value &tv) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | poll (struct pollfd *pollfds, unsigned long len, const ACE_Time_Value *timeout) |
ACE_INLINE int | poll (struct pollfd *pollfds, unsigned long len, const ACE_Time_Value &timeout) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void | endpwent (void) |
ACE_INLINE struct passwd * | getpwent (void) |
ACE_INLINE struct passwd * | getpwnam (const char *name) |
ACE_INLINE struct passwd * | getpwnam_r (const char *name, struct passwd *pwent, char *buffer, int buflen) |
ACE_INLINE void | setpwent (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE char * | compile (const char *instring, char *expbuf, char *endbuf) |
ACE_INLINE int | step (const char *str, char *expbuf) |
int | fprintf (FILE *fp, const char *format,...) |
int | asprintf (char **bufp, const char *format,...) |
int | printf (const char *format,...) |
int | snprintf (char *buf, size_t maxlen, const char *format,...) |
int | sprintf (char *buf, const char *format,...) |
int | vasprintf_emulation (char **bufp, const char *format, va_list argptr) |
ACE_NAMESPACE_INLINE_FUNCTION void | clearerr (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | fclose (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION FILE * | fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) |
ACE_NAMESPACE_INLINE_FUNCTION int | fflush (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | fgetc (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | getc (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | fgetpos (FILE *fp, fpos_t *pos) |
ACE_NAMESPACE_INLINE_FUNCTION char * | fgets (char *buf, int size, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION FILE * | fopen (const char *filename, const ACE_TCHAR *mode) |
ACE_NAMESPACE_INLINE_FUNCTION int | ungetc (int c, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | fputc (int c, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | putc (int c, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION int | fputs (const char *s, FILE *stream) |
ACE_NAMESPACE_INLINE_FUNCTION size_t | fread (void *ptr, size_t size, size_t nelems, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION FILE * | freopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode, FILE *stream) |
ACE_NAMESPACE_INLINE_FUNCTION int | fseek (FILE *fp, long offset, int ptrname) |
ACE_NAMESPACE_INLINE_FUNCTION int | fsetpos (FILE *fp, fpos_t *pos) |
ACE_NAMESPACE_INLINE_FUNCTION long | ftell (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION size_t | fwrite (const void *ptr, size_t size, size_t nitems, FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION void | perror (const char *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | puts (const char *s) |
ACE_NAMESPACE_INLINE_FUNCTION int | rename (const char *old_name, const char *new_name, int flags=-1) |
ACE_NAMESPACE_INLINE_FUNCTION void | rewind (FILE *fp) |
ACE_NAMESPACE_INLINE_FUNCTION char * | tempnam (const char *dir=0, const char *pfx=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | vasprintf (char **bufp, const char *format, va_list argptr) |
ACE_NAMESPACE_INLINE_FUNCTION int | vprintf (const char *format, va_list argptr) |
ACE_NAMESPACE_INLINE_FUNCTION int | vfprintf (FILE *fp, const char *format, va_list argptr) |
ACE_NAMESPACE_INLINE_FUNCTION int | vsprintf (char *buffer, const char *format, va_list argptr) |
ACE_NAMESPACE_INLINE_FUNCTION int | vsnprintf (char *buffer, size_t maxlen, const char *format, va_list argptr) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | flock_init (ACE_OS::ace_flock_t *lock, int flags, const ACE_TCHAR *name, mode_t perms) |
ACE_INLINE int | flock_unlock (ACE_OS::ace_flock_t *lock, short whence, ACE_OFF_T start, ACE_OFF_T len) |
ACE_INLINE int | flock_destroy (ACE_OS::ace_flock_t *lock, int unlink_file) |
ACE_INLINE int | flock_rdlock (ACE_OS::ace_flock_t *lock, short whence, ACE_OFF_T start, ACE_OFF_T len) |
ACE_INLINE int | flock_tryrdlock (ACE_OS::ace_flock_t *lock, short whence, ACE_OFF_T start, ACE_OFF_T len) |
ACE_INLINE int | flock_trywrlock (ACE_OS::ace_flock_t *lock, short whence, ACE_OFF_T start, ACE_OFF_T len) |
ACE_INLINE int | flock_wrlock (ACE_OS::ace_flock_t *lock, short whence, ACE_OFF_T start, ACE_OFF_T len) |
ACE_INLINE void | clearerr (FILE *fp) |
ACE_INLINE char * | cuserid (char *user, size_t maxlen) |
ACE_INLINE int | fclose (FILE *fp) |
ACE_INLINE FILE * | fdopen (ACE_HANDLE handle, const ACE_TCHAR *mode) |
ACE_INLINE int | fflush (FILE *fp) |
ACE_INLINE int | fgetc (FILE *fp) |
ACE_INLINE int | getc (FILE *fp) |
ACE_INLINE int | fgetpos (FILE *fp, fpos_t *pos) |
ACE_INLINE char * | fgets (char *buf, int size, FILE *fp) |
ACE_INLINE FILE * | fopen (const char *filename, const ACE_TCHAR *mode) |
ACE_INLINE int | ungetc (int c, FILE *fp) |
ACE_INLINE int | fputc (int c, FILE *fp) |
ACE_INLINE int | putc (int c, FILE *fp) |
ACE_INLINE int | fputs (const char *s, FILE *stream) |
ACE_INLINE size_t | fread (void *ptr, size_t size, size_t nelems, FILE *fp) |
ACE_INLINE FILE * | freopen (const ACE_TCHAR *filename, const ACE_TCHAR *mode, FILE *stream) |
ACE_INLINE int | fseek (FILE *fp, long offset, int whence) |
ACE_INLINE int | fsetpos (FILE *fp, fpos_t *pos) |
ACE_INLINE long | ftell (FILE *fp) |
ACE_INLINE size_t | fwrite (const void *ptr, size_t size, size_t nitems, FILE *fp) |
ACE_INLINE void | perror (const char *s) |
ACE_INLINE int | puts (const char *s) |
ACE_INLINE int | rename (const char *old_name, const char *new_name, int flags) |
ACE_INLINE void | rewind (FILE *fp) |
ACE_INLINE char * | tempnam (const char *dir, const char *pfx) |
ACE_INLINE int | vasprintf (char **bufp, const char *format, va_list argptr) |
ACE_INLINE int | vprintf (const char *format, va_list argptr) |
ACE_INLINE int | vfprintf (FILE *fp, const char *format, va_list argptr) |
ACE_INLINE int | vsprintf (char *buffer, const char *format, va_list argptr) |
ACE_INLINE int | vsnprintf (char *buffer, size_t maxlen, const char *format, va_list ap) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void | _exit (int status) |
ACE_INLINE void | abort (void) |
ACE_INLINE int | atexit (ACE_EXIT_HOOK func) |
ACE_INLINE int | atoi (const char *s) |
ACE_INLINE void * | atop (const char *s) |
ACE_INLINE void * | bsearch (const void *key, const void *base, size_t nel, size_t size, ACE_COMPARE_FUNC compar) |
ACE_INLINE char * | getenv (const char *symbol) |
ACE_INLINE char * | itoa (int value, char *string, int radix) |
Converts an integer to a string. | |
ACE_INLINE ACE_HANDLE | mkstemp (char *s) |
ACE_INLINE char * | mktemp (char *s) |
ACE_INLINE int | putenv (const char *string) |
ACE_INLINE void | qsort (void *base, size_t nel, size_t width, ACE_COMPARE_FUNC compar) |
ACE_INLINE int | rand (void) |
ACE_INLINE int | rand_r (ACE_RANDR_TYPE &seed) |
ACE_INLINE char * | realpath (const char *file_name, char *resolved_name) |
ACE_INLINE ACE_EXIT_HOOK | set_exit_hook (ACE_EXIT_HOOK exit_hook) |
For use by ACE_Object_Manager only, to register its exit hook.. | |
ACE_INLINE void | srand (u_int seed) |
ACE_INLINE double | strtod (const char *s, char **endptr) |
Converts a string to a double value (char version). | |
ACE_INLINE long | strtol (const char *s, char **ptr, int base) |
Converts a string to a long value (char version). | |
ACE_INLINE unsigned long | strtoul (const char *s, char **ptr, int base) |
Converts a string to an unsigned long value (char version). | |
ACE_INLINE int | system (const ACE_TCHAR *s) |
ACE_INLINE const char * | getprogname () |
ACE_INLINE void | setprogname (const char *name) |
char * | strtok_r_emulation (char *s, const char *tokens, char **lasts) |
Emulated strtok_r. | |
ACE_NAMESPACE_INLINE_FUNCTION char * | strtok_r (char *s, const char *tokens, char **lasts) |
Finds the next token in a string (safe char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const void * | memchr (const void *s, int c, size_t len) |
Finds characters in a buffer (const void version). | |
ACE_INLINE void * | memchr (void *s, int c, size_t len) |
Finds characters in a buffer (void version). | |
ACE_INLINE int | memcmp (const void *t, const void *s, size_t len) |
Compares two buffers. | |
ACE_INLINE void * | memcpy (void *t, const void *s, size_t len) |
Copies one buffer to another. | |
ACE_INLINE void * | memmove (void *t, const void *s, size_t len) |
Moves one buffer to another. | |
ACE_INLINE void * | memset (void *s, int c, size_t len) |
Fills a buffer with a character value. | |
ACE_INLINE char * | strcat (char *s, const char *t) |
Appends a string to another string (char version). | |
ACE_INLINE const char * | strchr (const char *s, int c) |
ACE_INLINE char * | strchr (char *s, int c) |
Finds the first occurance of a character in a string (char version). | |
ACE_INLINE int | strcmp (const char *s, const char *t) |
Compares two strings (char version). | |
ACE_INLINE int | strcmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t) |
Compares two strings (wchar_t version). | |
ACE_INLINE char * | strcpy (char *s, const char *t) |
Copies a string (char version). | |
ACE_INLINE size_t | strcspn (const char *s, const char *reject) |
ACE_INLINE char * | strdup (const char *s) |
Returns a malloced duplicated string (char version). | |
ACE_INLINE size_t | strlen (const char *s) |
Finds the length of a string (char version). | |
ACE_INLINE size_t | strlen (const ACE_WCHAR_T *s) |
Finds the length of a string (ACE_WCHAR_T version). | |
ACE_INLINE char * | strncat (char *s, const char *t, size_t len) |
Appends part of a string to another string (char version). | |
ACE_INLINE ACE_WCHAR_T * | strncat (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Appends part of a string to another string (wchar_t version). | |
ACE_INLINE char * | strnchr (char *s, int c, size_t len) |
Finds the first occurance of a character in an array (char version). | |
ACE_INLINE ACE_WCHAR_T * | strnchr (ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len) |
Finds the first occurance of a character in an array (ACE_WCHAR_T version). | |
ACE_INLINE int | strncmp (const char *s, const char *t, size_t len) |
Compares two arrays (char version). | |
ACE_INLINE int | strncmp (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Compares two arrays (wchar_t version). | |
ACE_INLINE char * | strncpy (char *s, const char *t, size_t len) |
Copies an array (char version). | |
ACE_INLINE ACE_WCHAR_T * | strncpy (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Copies an array (ACE_WCHAR_T version). | |
ACE_INLINE size_t | strnlen (const char *s, size_t maxlen) |
Finds the length of a limited-length string (char version). | |
ACE_INLINE size_t | strnlen (const ACE_WCHAR_T *s, size_t maxlen) |
Finds the length of a limited-length string (ACE_WCHAR_T version). | |
ACE_INLINE char * | strnstr (char *s, const char *t, size_t len) |
Finds the first occurance of a substring in an array (char version). | |
ACE_INLINE ACE_WCHAR_T * | strnstr (ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len) |
Finds the first occurance of a substring in an array (wchar_t version). | |
ACE_INLINE const char * | strpbrk (const char *s1, const char *s2) |
Searches for characters in a string (const char version). | |
ACE_INLINE char * | strpbrk (char *s1, const char *s2) |
Searches for characters in a string (char version). | |
ACE_INLINE const char * | strrchr (const char *s, int c) |
ACE_INLINE char * | strrchr (char *s, int c) |
Finds the last occurance of a character in a string (char version). | |
ACE_INLINE size_t | strspn (const char *s, const char *t) |
ACE_INLINE const char * | strstr (const char *s, const char *t) |
ACE_INLINE char * | strstr (char *s, const char *t) |
Finds the first occurance of a substring in a string (char version). | |
ACE_INLINE char * | strtok (char *s, const char *tokens) |
Finds the next token in a string (char version). | |
ACE_INLINE char * | strtok_r (char *s, const char *tokens, char **lasts) |
Finds the next token in a string (safe char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strcasecmp (const char *s, const char *t) |
Compares two strings (case insensitive const char version). | |
ACE_NAMESPACE_INLINE_FUNCTION int | strncasecmp (const char *s, const char *t, size_t len) |
Compares two arrays (case insensitive const char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | strcasecmp (const char *s, const char *t) |
Compares two strings (case insensitive const char version). | |
ACE_INLINE int | strncasecmp (const char *s, const char *t, size_t len) |
Compares two arrays (case insensitive const char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | ioctl (ACE_HANDLE socket, unsigned long io_control_code, void *in_buffer_p, unsigned long in_buffer, void *out_buffer_p, unsigned long out_buffer, unsigned long *bytes_returned, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
QoS-enabled <ioctl>. | |
int | ioctl (ACE_HANDLE socket, unsigned long io_control_code, ACE_QoS &ace_qos, unsigned long *bytes_returned, void *buffer_p, unsigned long buffer, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
ACE_NAMESPACE_INLINE_FUNCTION int | getmsg (ACE_HANDLE handle, struct strbuf *ctl, struct strbuf *data, int *flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | getpmsg (ACE_HANDLE handle, struct strbuf *ctl, struct strbuf *data, int *band, int *flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | fattach (int handle, const char *path) |
ACE_NAMESPACE_INLINE_FUNCTION int | fdetach (const char *file) |
ACE_NAMESPACE_INLINE_FUNCTION int | ioctl (ACE_HANDLE handle, ACE_IOCTL_TYPE_ARG2 cmd, void *=0) |
UNIX-style <ioctl>. | |
ACE_NAMESPACE_INLINE_FUNCTION int | isastream (ACE_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION int | putmsg (ACE_HANDLE handle, const struct strbuf *ctl, const struct strbuf *data, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | putpmsg (ACE_HANDLE handle, const struct strbuf *ctl, const struct strbuf *data, int band, int flags) |
ACE_INLINE int | getmsg (ACE_HANDLE handle, struct strbuf *ctl, struct strbuf *data, int *flags) |
ACE_INLINE int | getpmsg (ACE_HANDLE handle, struct strbuf *ctl, struct strbuf *data, int *band, int *flags) |
ACE_INLINE int | fattach (int handle, const char *path) |
ACE_INLINE int | fdetach (const char *file) |
ACE_INLINE int | ioctl (ACE_HANDLE handle, ACE_IOCTL_TYPE_ARG2 cmd, void *val) |
UNIX-style <ioctl>. | |
ACE_INLINE int | isastream (ACE_HANDLE handle) |
ACE_INLINE int | putmsg (ACE_HANDLE handle, const struct strbuf *ctl, const struct strbuf *data, int flags) |
ACE_INLINE int | putpmsg (ACE_HANDLE handle, const struct strbuf *ctl, const struct strbuf *data, int band, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | shm_open (const ACE_TCHAR *filename, int mode, mode_t perms=0, LPSECURITY_ATTRIBUTES sa=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | shm_unlink (const ACE_TCHAR *path) |
ACE_INLINE int | madvise (caddr_t addr, size_t len, int map_advice) |
ACE_INLINE void * | mmap (void *addr, size_t len, int prot, int flags, ACE_HANDLE file_handle, ACE_OFF_T off, ACE_HANDLE *file_mapping, LPSECURITY_ATTRIBUTES sa, const ACE_TCHAR *file_mapping_name) |
ACE_INLINE int | mprotect (void *addr, size_t len, int prot) |
ACE_INLINE int | msync (void *addr, size_t len, int sync) |
ACE_INLINE int | munmap (void *addr, size_t len) |
ACE_INLINE ACE_HANDLE | shm_open (const ACE_TCHAR *filename, int mode, mode_t perms, LPSECURITY_ATTRIBUTES sa) |
ACE_INLINE int | shm_unlink (const ACE_TCHAR *path) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | msgctl (int msqid, int cmd, struct msqid_ds *val) |
ACE_INLINE int | msgget (key_t key, int msgflg) |
ACE_INLINE ssize_t | msgrcv (int int_id, void *buf, size_t len, long type, int flags) |
ACE_INLINE int | msgsnd (int int_id, const void *buf, size_t len, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | getrlimit (int resource, struct rlimit *rl) |
ACE_NAMESPACE_INLINE_FUNCTION int | getrusage (int who, struct rusage *rusage) |
ACE_NAMESPACE_INLINE_FUNCTION int | setrlimit (int resource, const struct rlimit *rl) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | getrlimit (int resource, struct rlimit *rl) |
ACE_INLINE int | getrusage (int who, struct rusage *ru) |
ACE_INLINE int | setrlimit (int resource, const struct rlimit *rl) |
ACE_NAMESPACE_INLINE_FUNCTION int | select (int width, fd_set *rfds, fd_set *wfds=0, fd_set *efds=0, const ACE_Time_Value *tv=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | select (int width, fd_set *rfds, fd_set *wfds, fd_set *efds, const ACE_Time_Value &tv) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | select (int width, fd_set *rfds, fd_set *wfds, fd_set *efds, const ACE_Time_Value *timeout) |
ACE_INLINE int | select (int width, fd_set *rfds, fd_set *wfds, fd_set *efds, const ACE_Time_Value &timeout) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ssize_t | sendfile_emulation (ACE_HANDLE out_fd, ACE_HANDLE in_fd, off_t *offset, size_t count) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | sendfile (ACE_HANDLE out_fd, ACE_HANDLE in_fd, off_t *offset, size_t count) |
Finds the length of a string (char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ssize_t | sendfile (ACE_HANDLE out_fd, ACE_HANDLE in_fd, off_t *offset, size_t count) |
Finds the length of a string (char version). | |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void * | shmat (int int_id, const void *shmaddr, int shmflg) |
ACE_INLINE int | shmctl (int int_id, int cmd, struct shmid_ds *buf) |
ACE_INLINE int | shmdt (const void *shmaddr) |
ACE_INLINE int | shmget (key_t key, size_t size, int flags) |
ACE_INLINE ACE_HANDLE | accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
BSD-style <accept> (no QoS). | |
ACE_INLINE int | bind (ACE_HANDLE handle, struct sockaddr *addr, int addrlen) |
ACE_INLINE int | closesocket (ACE_HANDLE handle) |
Takes care of windows specific requirement to call closesocket. | |
ACE_INLINE int | connect (ACE_HANDLE handle, struct sockaddr *addr, int addrlen) |
BSD-style <connect> (no QoS). | |
ACE_INLINE int | enum_protocols (int *protocols, ACE_Protocol_Info *protocol_buffer, u_long *buffer_length) |
ACE_INLINE int | getpeername (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
ACE_INLINE int | getsockname (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen) |
ACE_INLINE int | getsockopt (ACE_HANDLE handle, int level, int optname, char *optval, int *optlen) |
ACE_INLINE int | listen (ACE_HANDLE handle, int backlog) |
ACE_INLINE ssize_t | recv (ACE_HANDLE handle, char *buf, size_t len, int flags) |
ACE_INLINE ssize_t | recvfrom (ACE_HANDLE handle, char *buf, size_t len, int flags, struct sockaddr *addr, int *addrlen) |
ACE_INLINE ssize_t | recvfrom (ACE_HANDLE handle, iovec *buffers, int buffer_count, size_t &number_of_bytes_recvd, int &flags, struct sockaddr *addr, int *addrlen, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
ACE_INLINE ssize_t | recvmsg (ACE_HANDLE handle, struct msghdr *msg, int flags) |
ACE_INLINE ssize_t | recvv (ACE_HANDLE handle, iovec *buffers, int n) |
ACE_INLINE ssize_t | send (ACE_HANDLE handle, const char *buf, size_t len, int flags) |
ACE_INLINE ssize_t | sendmsg (ACE_HANDLE handle, const struct msghdr *msg, int flags) |
ACE_INLINE ssize_t | sendto (ACE_HANDLE handle, const char *buf, size_t len, int flags, const struct sockaddr *addr, int addrlen) |
ACE_INLINE ssize_t | sendto (ACE_HANDLE handle, const iovec *buffers, int buffer_count, size_t &number_of_bytes_sent, int flags, const struct sockaddr *addr, int addrlen, ACE_OVERLAPPED *overlapped, ACE_OVERLAPPED_COMPLETION_FUNC func) |
ACE_INLINE ssize_t | sendv (ACE_HANDLE handle, const iovec *buffers, int n) |
ACE_INLINE int | setsockopt (ACE_HANDLE handle, int level, int optname, const char *optval, int optlen) |
Manipulate the options associated with a socket. | |
ACE_INLINE int | shutdown (ACE_HANDLE handle, int how) |
ACE_INLINE ACE_HANDLE | socket (int domain, int type, int proto) |
Create a BSD-style socket (no QoS). | |
ACE_INLINE ACE_HANDLE | socket (int domain, int type, int proto, ACE_Protocol_Info *protocolinfo, ACE_SOCK_GROUP g, u_long flags) |
ACE_INLINE int | socketpair (int domain, int type, int protocol, ACE_HANDLE sv[2]) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | creat (const ACE_TCHAR *filename, mode_t mode) |
ACE_NAMESPACE_INLINE_FUNCTION int | fstat (ACE_HANDLE, ACE_stat *) |
ACE_NAMESPACE_INLINE_FUNCTION int | lstat (const char *, ACE_stat *) |
ACE_NAMESPACE_INLINE_FUNCTION int | mkdir (const char *path, mode_t mode=ACE_DEFAULT_DIR_PERMS) |
ACE_NAMESPACE_INLINE_FUNCTION int | mkfifo (const ACE_TCHAR *file, mode_t mode=ACE_DEFAULT_FILE_PERMS) |
ACE_NAMESPACE_INLINE_FUNCTION int | stat (const char *file, ACE_stat *) |
ACE_NAMESPACE_INLINE_FUNCTION mode_t | umask (mode_t cmask) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_Time_Value | gettimeofday (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ACE_Time_Value | gettimeofday (void) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | readv (ACE_HANDLE handle, const iovec *iov, int iovlen) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | writev (ACE_HANDLE handle, const iovec *iov, int iovcnt) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ssize_t | readv (ACE_HANDLE handle, const iovec *iov, int iovlen) |
ACE_INLINE ssize_t | writev (ACE_HANDLE handle, const iovec *iov, int iovcnt) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | uname (ACE_utsname *name) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | wait (int *=0) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | wait (pid_t pid, ACE_exitcode *status, int wait_options=0, ACE_HANDLE handle=0) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | waitpid (pid_t pid, ACE_exitcode *status=0, int wait_options=0, ACE_HANDLE handle=0) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE pid_t | wait (int *status) |
ACE_INLINE pid_t | waitpid (pid_t pid, ACE_exitcode *status, int wait_options, ACE_HANDLE handle) |
ACE_INLINE pid_t | wait (pid_t pid, ACE_exitcode *status, int wait_options, ACE_HANDLE handle) |
void | cleanup_tss (const u_int main_thread) |
int | lwp_getparams (ACE_Sched_Params &sched_params) |
int | lwp_setparams (const ACE_Sched_Params &sched_params) |
int | scheduling_class (const char *class_name, ACE_id_t &) |
Find the schedling class ID that corresponds to the class name. | |
int | set_scheduling_params (const ACE_Sched_Params &, ACE_id_t id=ACE_SELF) |
Friendly interface to <priocntl>(2). | |
int | thr_create (ACE_THR_FUNC func, void *args, long flags, ACE_thread_t *thr_id, ACE_hthread_t *thr_handle, long priority, void *stack, size_t stacksize, ACE_Base_Thread_Adapter *thread_adapter, const char **thr_name) |
void | thr_exit (ACE_THR_FUNC_RETURN status) |
int | thr_key_detach (ACE_thread_key_t key, void *) |
int | thr_get_affinity (ACE_hthread_t thr_id, size_t cpu_set_size, cpu_set_t *cpu_mask) |
int | thr_set_affinity (ACE_hthread_t thr_id, size_t cpu_set_size, const cpu_set_t *cpu_mask) |
int | thr_key_used (ACE_thread_key_t key) |
int | thr_keycreate (ACE_thread_key_t *key, ACE_THR_DEST dest, void *) |
int | thr_keyfree (ACE_thread_key_t key) |
int | thr_setprio (const ACE_Sched_Priority prio) |
int | thr_setspecific (ACE_thread_key_t key, void *data) |
void | unique_name (const void *object, char *name, size_t length) |
ACE_NAMESPACE_INLINE_FUNCTION long | priority_control (ACE_idtype_t, ACE_id_t, int, void *) |
Low-level interface to <priocntl>(2). | |
ACE_NAMESPACE_INLINE_FUNCTION int | sigtimedwait (const sigset_t *set, siginfo_t *info, const ACE_Time_Value *timeout) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigwait (sigset_t *set, int *sig=0) |
ACE_NAMESPACE_INLINE_FUNCTION int | sigwaitinfo (const sigset_t *set, siginfo_t *info) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_cancel (ACE_thread_t t_id) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_cmp (ACE_hthread_t t1, ACE_hthread_t t2) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_continue (ACE_hthread_t target_thread) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_equal (ACE_thread_t t1, ACE_thread_t t2) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_getconcurrency (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_getprio (ACE_hthread_t id, int &priority) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_getprio (ACE_hthread_t id, int &priority, int &policy) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_getspecific (ACE_thread_key_t key, void **data) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_join (ACE_hthread_t waiter_id, ACE_THR_FUNC_RETURN *status) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_join (ACE_thread_t waiter_id, ACE_thread_t *thr_id, ACE_THR_FUNC_RETURN *status) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_kill (ACE_thread_t thr_id, int signum) |
ACE_NAMESPACE_INLINE_FUNCTION size_t | thr_min_stack (void) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_thread_t | thr_self (void) |
ACE_NAMESPACE_INLINE_FUNCTION void | thr_self (ACE_hthread_t &) |
ACE_NAMESPACE_INLINE_FUNCTION const char * | thr_name (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_setcancelstate (int new_state, int *old_state) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_setcanceltype (int new_type, int *old_type) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_setconcurrency (int hint) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_setprio (ACE_hthread_t ht_id, int priority, int policy=-1) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_sigsetmask (int how, const sigset_t *nsm, sigset_t *osm) |
ACE_NAMESPACE_INLINE_FUNCTION int | thr_suspend (ACE_hthread_t target_thread) |
ACE_NAMESPACE_INLINE_FUNCTION void | thr_testcancel (void) |
ACE_NAMESPACE_INLINE_FUNCTION void | thr_yield (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | thr_equal (ACE_thread_t t1, ACE_thread_t t2) |
ACE_INLINE int | condattr_destroy (ACE_condattr_t &attributes) |
ACE_INLINE int | condattr_init (ACE_condattr_t &attributes, int type) |
ACE_INLINE int | cond_broadcast (ACE_cond_t *cv) |
ACE_INLINE int | cond_destroy (ACE_cond_t *cv) |
ACE_INLINE int | cond_init (ACE_cond_t *cv, ACE_condattr_t &attributes, const char *name, void *arg) |
ACE_INLINE int | cond_signal (ACE_cond_t *cv) |
ACE_INLINE int | cond_wait (ACE_cond_t *cv, ACE_mutex_t *external_mutex) |
ACE_INLINE int | cond_timedwait (ACE_cond_t *cv, ACE_mutex_t *external_mutex, ACE_Time_Value *timeout) |
ACE_INLINE int | mutex_lock (ACE_mutex_t *m, const ACE_Time_Value *timeout) |
ACE_INLINE long | priority_control (ACE_idtype_t idtype, ACE_id_t identifier, int cmd, void *arg) |
Low-level interface to <priocntl>(2). | |
ACE_INLINE int | recursive_mutex_cond_unlock (ACE_recursive_thread_mutex_t *m, ACE_recursive_mutex_state &state) |
ACE_INLINE void | recursive_mutex_cond_relock (ACE_recursive_thread_mutex_t *m, ACE_recursive_mutex_state &state) |
ACE_INLINE int | recursive_mutex_destroy (ACE_recursive_thread_mutex_t *m) |
ACE_INLINE int | recursive_mutex_init (ACE_recursive_thread_mutex_t *m, const ACE_TCHAR *name, ACE_mutexattr_t *arg, LPSECURITY_ATTRIBUTES sa) |
ACE_INLINE int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m) |
ACE_INLINE int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m, const ACE_Time_Value &timeout) |
ACE_INLINE int | recursive_mutex_lock (ACE_recursive_thread_mutex_t *m, const ACE_Time_Value *timeout) |
ACE_INLINE int | recursive_mutex_trylock (ACE_recursive_thread_mutex_t *m) |
ACE_INLINE int | recursive_mutex_unlock (ACE_recursive_thread_mutex_t *m) |
ACE_INLINE int | rw_rdlock (ACE_rwlock_t *rw) |
ACE_INLINE int | rw_tryrdlock (ACE_rwlock_t *rw) |
ACE_INLINE int | rw_trywrlock (ACE_rwlock_t *rw) |
ACE_INLINE int | rw_trywrlock_upgrade (ACE_rwlock_t *rw) |
ACE_INLINE int | rw_unlock (ACE_rwlock_t *rw) |
ACE_INLINE int | rw_wrlock (ACE_rwlock_t *rw) |
ACE_INLINE int | rwlock_destroy (ACE_rwlock_t *rw) |
ACE_INLINE int | sema_destroy (ACE_sema_t *s) |
ACE_INLINE int | sema_init (ACE_sema_t *s, u_int count, int type, const char *name, void *arg, int max, LPSECURITY_ATTRIBUTES sa) |
ACE_INLINE int | sema_post (ACE_sema_t *s) |
ACE_INLINE int | sema_post (ACE_sema_t *s, u_int release_count) |
ACE_INLINE int | sema_trywait (ACE_sema_t *s) |
ACE_INLINE int | sema_wait (ACE_sema_t *s) |
ACE_INLINE int | sema_wait (ACE_sema_t *s, ACE_Time_Value &tv) |
ACE_INLINE int | sema_wait (ACE_sema_t *s, ACE_Time_Value *tv) |
ACE_INLINE int | semctl (int int_id, int semnum, int cmd, semun value) |
ACE_INLINE int | semget (key_t key, int nsems, int flags) |
ACE_INLINE int | semop (int int_id, struct sembuf *sops, size_t nsops) |
ACE_INLINE int | sigtimedwait (const sigset_t *sset, siginfo_t *info, const ACE_Time_Value *timeout) |
ACE_INLINE int | sigwait (sigset_t *sset, int *sig) |
ACE_INLINE int | sigwaitinfo (const sigset_t *sset, siginfo_t *info) |
ACE_INLINE int | thr_cancel (ACE_thread_t thr_id) |
ACE_INLINE int | thr_cmp (ACE_hthread_t t1, ACE_hthread_t t2) |
ACE_INLINE int | thr_continue (ACE_hthread_t target_thread) |
ACE_INLINE int | thr_getconcurrency (void) |
ACE_INLINE int | thr_getprio (ACE_hthread_t ht_id, int &priority, int &policy) |
ACE_INLINE int | thr_getprio (ACE_hthread_t ht_id, int &priority) |
ACE_INLINE int | thr_getspecific (ACE_thread_key_t key, void **data) |
ACE_INLINE int | thr_join (ACE_hthread_t thr_handle, ACE_THR_FUNC_RETURN *status) |
ACE_INLINE int | thr_join (ACE_thread_t waiter_id, ACE_thread_t *thr_id, ACE_THR_FUNC_RETURN *status) |
ACE_INLINE int | thr_kill (ACE_thread_t thr_id, int signum) |
ACE_INLINE size_t | thr_min_stack (void) |
ACE_INLINE ACE_thread_t | thr_self (void) |
ACE_INLINE const char * | thr_name (void) |
ACE_INLINE void | thr_self (ACE_hthread_t &self) |
ACE_INLINE int | thr_setcancelstate (int new_state, int *old_state) |
ACE_INLINE int | thr_setcanceltype (int new_type, int *old_type) |
ACE_INLINE int | thr_setconcurrency (int hint) |
ACE_INLINE int | thr_setprio (ACE_hthread_t ht_id, int priority, int policy) |
ACE_INLINE int | thr_sigsetmask (int how, const sigset_t *nsm, sigset_t *osm) |
ACE_INLINE int | thr_suspend (ACE_hthread_t target_thread) |
ACE_INLINE void | thr_testcancel (void) |
ACE_INLINE void | thr_yield (void) |
ACE_INLINE int | thread_mutex_destroy (ACE_thread_mutex_t *m) |
ACE_INLINE int | thread_mutex_init (ACE_thread_mutex_t *m, int lock_type, const char *name, ACE_mutexattr_t *arg) |
ACE_INLINE int | thread_mutex_lock (ACE_thread_mutex_t *m) |
ACE_INLINE int | thread_mutex_lock (ACE_thread_mutex_t *m, const ACE_Time_Value &timeout) |
ACE_INLINE int | thread_mutex_lock (ACE_thread_mutex_t *m, const ACE_Time_Value *timeout) |
ACE_INLINE int | thread_mutex_trylock (ACE_thread_mutex_t *m) |
ACE_INLINE int | thread_mutex_unlock (ACE_thread_mutex_t *m) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE char * | asctime (const struct tm *t) |
ACE_INLINE char * | asctime_r (const struct tm *t, char *buf, int buflen) |
ACE_INLINE int | clock_gettime (clockid_t clockid, struct timespec *ts) |
ACE_INLINE int | clock_settime (clockid_t clockid, const struct timespec *ts) |
ACE_INLINE ACE_TCHAR * | ctime (const time_t *t) |
ACE_INLINE ACE_TCHAR * | ctime_r (const time_t *t, ACE_TCHAR *buf, int buflen) |
ACE_INLINE double | difftime (time_t t1, time_t t0) |
ACE_INLINE ACE_hrtime_t | gethrtime (const ACE_HRTimer_Op op) |
ACE_INLINE struct tm * | gmtime (const time_t *t) |
ACE_INLINE struct tm * | gmtime_r (const time_t *t, struct tm *res) |
ACE_INLINE struct tm * | localtime (const time_t *t) |
ACE_INLINE int | nanosleep (const struct timespec *requested, struct timespec *remaining) |
ACE_INLINE size_t | strftime (char *s, size_t maxsize, const char *format, const struct tm *timeptr) |
ACE_INLINE char * | strptime (const char *buf, const char *format, struct tm *tm) |
ACE_INLINE time_t | time (time_t *tloc) |
ACE_INLINE long | timezone (void) |
ACE_INLINE void | tzset (void) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | argv_to_string (ACE_TCHAR **argv, ACE_TCHAR *&buf, bool substitute_env_args, bool quote_args) |
int | argv_to_string (int argc, ACE_TCHAR **argv, ACE_TCHAR *&buf, bool substitute_env_args, bool quote_args) |
int | execl (const char *, const char *,...) |
int | execle (const char *, const char *,...) |
int | execlp (const char *, const char *,...) |
long | num_processors (void) |
Get the number of CPUs configured in the machine. | |
long | num_processors_online (void) |
Get the number of CPUs currently online. | |
ssize_t | read_n (ACE_HANDLE handle, void *buf, size_t len, size_t *bt) |
ssize_t | pread (ACE_HANDLE handle, void *buf, size_t nbytes, ACE_OFF_T offset) |
ssize_t | pwrite (ACE_HANDLE handle, const void *buf, size_t nbytes, ACE_OFF_T offset) |
int | string_to_argv (ACE_TCHAR *buf, int &argc, ACE_TCHAR **&argv, bool substitute_env_args) |
ssize_t | write_n (ACE_HANDLE handle, const void *buf, size_t len, size_t *bt) |
ACE_NAMESPACE_INLINE_FUNCTION int | access (const char *path, int amode) |
ACE_NAMESPACE_INLINE_FUNCTION unsigned int | alarm (u_int secs) |
ACE_NAMESPACE_INLINE_FUNCTION long | allocation_granularity (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | chdir (const char *path) |
ACE_NAMESPACE_INLINE_FUNCTION int | rmdir (const char *path) |
ACE_NAMESPACE_INLINE_FUNCTION int | close (ACE_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | dup (ACE_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION int | dup2 (ACE_HANDLE oldfd, ACE_HANDLE newfd) |
ACE_NAMESPACE_INLINE_FUNCTION int | execv (const char *path, char *const argv[]) |
ACE_NAMESPACE_INLINE_FUNCTION int | execve (const char *path, char *const argv[], char *const envp[]) |
ACE_NAMESPACE_INLINE_FUNCTION int | execvp (const char *file, char *const argv[]) |
ACE_NAMESPACE_INLINE_FUNCTION int | fsync (ACE_HANDLE handle) |
ACE_NAMESPACE_INLINE_FUNCTION int | ftruncate (ACE_HANDLE handle, ACE_OFF_T offset) |
ACE_NAMESPACE_INLINE_FUNCTION char * | getcwd (char *, size_t) |
ACE_NAMESPACE_INLINE_FUNCTION gid_t | getgid (void) |
ACE_NAMESPACE_INLINE_FUNCTION gid_t | getegid (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | getopt (int argc, char *const *argv, const char *optstring) |
ACE_NAMESPACE_INLINE_FUNCTION long | getpagesize (void) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | getpgid (pid_t pid) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | getpid (void) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | getppid (void) |
ACE_NAMESPACE_INLINE_FUNCTION uid_t | getuid (void) |
ACE_NAMESPACE_INLINE_FUNCTION uid_t | geteuid (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | hostname (char *name, size_t maxnamelen) |
ACE_NAMESPACE_INLINE_FUNCTION int | isatty (int handle) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_OFF_T | lseek (ACE_HANDLE handle, ACE_OFF_T offset, int whence) |
ACE_NAMESPACE_INLINE_FUNCTION int | pipe (ACE_HANDLE handles[]) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | read (ACE_HANDLE handle, void *buf, size_t len) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | read (ACE_HANDLE handle, void *buf, size_t len, ACE_OVERLAPPED *) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | readlink (const char *path, char *buf, size_t bufsiz) |
ACE_NAMESPACE_INLINE_FUNCTION void * | sbrk (intptr_t brk) |
ACE_NAMESPACE_INLINE_FUNCTION int | setgid (gid_t) |
ACE_NAMESPACE_INLINE_FUNCTION int | setegid (gid_t) |
ACE_NAMESPACE_INLINE_FUNCTION int | setpgid (pid_t pid, pid_t pgid) |
ACE_NAMESPACE_INLINE_FUNCTION int | setregid (gid_t rgid, gid_t egid) |
ACE_NAMESPACE_INLINE_FUNCTION int | setreuid (uid_t ruid, uid_t euid) |
ACE_NAMESPACE_INLINE_FUNCTION pid_t | setsid (void) |
ACE_NAMESPACE_INLINE_FUNCTION int | setuid (uid_t) |
ACE_NAMESPACE_INLINE_FUNCTION int | seteuid (uid_t) |
ACE_NAMESPACE_INLINE_FUNCTION int | sleep (u_int seconds) |
ACE_NAMESPACE_INLINE_FUNCTION int | sleep (const ACE_Time_Value &tv) |
ACE_NAMESPACE_INLINE_FUNCTION void | swab (const void *src, void *dest, ssize_t n) |
ACE_NAMESPACE_INLINE_FUNCTION long | sysconf (int) |
ACE_NAMESPACE_INLINE_FUNCTION long | sysinfo (int cmd, char *buf, long count) |
ACE_NAMESPACE_INLINE_FUNCTION int | truncate (const ACE_TCHAR *filename, ACE_OFF_T length) |
ACE_NAMESPACE_INLINE_FUNCTION useconds_t | ualarm (useconds_t usecs, useconds_t interval=0) |
ACE_NAMESPACE_INLINE_FUNCTION useconds_t | ualarm (const ACE_Time_Value &tv, const ACE_Time_Value &tv_interval=ACE_Time_Value::zero) |
ACE_NAMESPACE_INLINE_FUNCTION int | unlink (const char *path) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | write (ACE_HANDLE handle, const void *buf, size_t nbyte) |
ACE_NAMESPACE_INLINE_FUNCTION ssize_t | write (ACE_HANDLE handle, const void *buf, size_t nbyte, ACE_OVERLAPPED *) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int | access (const char *path, int amode) |
ACE_INLINE u_int | alarm (u_int secs) |
ACE_INLINE long | getpagesize (void) |
ACE_INLINE long | allocation_granularity (void) |
ACE_INLINE int | chdir (const char *path) |
ACE_INLINE int | rmdir (const char *path) |
ACE_INLINE int | close (ACE_HANDLE handle) |
ACE_INLINE ACE_HANDLE | dup (ACE_HANDLE handle) |
ACE_INLINE int | dup2 (ACE_HANDLE oldhandle, ACE_HANDLE newhandle) |
ACE_INLINE int | execv (const char *path, char *const argv[]) |
ACE_INLINE int | execve (const char *path, char *const argv[], char *const envp[]) |
ACE_INLINE int | execvp (const char *file, char *const argv[]) |
ACE_INLINE pid_t | fork (void) |
ACE_INLINE int | fsync (ACE_HANDLE handle) |
ACE_INLINE int | ftruncate (ACE_HANDLE handle, ACE_OFF_T offset) |
ACE_INLINE char * | getcwd (char *buf, size_t size) |
ACE_INLINE gid_t | getgid (void) |
ACE_INLINE gid_t | getegid (void) |
ACE_INLINE int | getopt (int argc, char *const *argv, const char *optstring) |
ACE_INLINE pid_t | getpgid (pid_t pid) |
ACE_INLINE pid_t | getpid (void) |
ACE_INLINE pid_t | getppid (void) |
ACE_INLINE uid_t | getuid (void) |
ACE_INLINE uid_t | geteuid (void) |
ACE_INLINE int | hostname (char name[], size_t maxnamelen) |
ACE_INLINE int | isatty (int handle) |
ACE_INLINE ACE_OFF_T | lseek (ACE_HANDLE handle, ACE_OFF_T offset, int whence) |
ACE_INLINE ssize_t | read (ACE_HANDLE handle, void *buf, size_t len) |
ACE_INLINE ssize_t | read (ACE_HANDLE handle, void *buf, size_t len, ACE_OVERLAPPED *overlapped) |
ACE_INLINE ssize_t | readlink (const char *path, char *buf, size_t bufsiz) |
ACE_INLINE int | pipe (ACE_HANDLE fds[]) |
ACE_INLINE void * | sbrk (intptr_t brk) |
ACE_INLINE int | setgid (gid_t gid) |
ACE_INLINE int | setegid (gid_t gid) |
ACE_INLINE int | setpgid (pid_t pid, pid_t pgid) |
ACE_INLINE int | setregid (gid_t rgid, gid_t egid) |
ACE_INLINE int | setreuid (uid_t ruid, uid_t euid) |
ACE_INLINE pid_t | setsid (void) |
ACE_INLINE int | setuid (uid_t uid) |
ACE_INLINE int | seteuid (uid_t uid) |
ACE_INLINE int | sleep (u_int seconds) |
ACE_INLINE int | sleep (const ACE_Time_Value &tv) |
ACE_INLINE void | swab (const void *src, void *dest, ssize_t length) |
ACE_INLINE long | sysconf (int name) |
ACE_INLINE long | sysinfo (int cmd, char *buf, long count) |
ACE_INLINE int | truncate (const ACE_TCHAR *filename, ACE_OFF_T offset) |
ACE_INLINE useconds_t | ualarm (useconds_t usecs, useconds_t interval) |
ACE_INLINE useconds_t | ualarm (const ACE_Time_Value &tv, const ACE_Time_Value &tv_interval) |
ACE_INLINE int | unlink (const char *path) |
ACE_INLINE ssize_t | write (ACE_HANDLE handle, const void *buf, size_t nbyte) |
ACE_INLINE ssize_t | write (ACE_HANDLE handle, const void *buf, size_t nbyte, ACE_OVERLAPPED *overlapped) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL int | wcscmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2) |
Emulated wcscmp - Compares strings. | |
size_t | wcslen_emulation (const ACE_WCHAR_T *string) |
Emulated wcslen - Returns the length of a string. | |
ACE_WCHAR_T * | wcsncat_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *source, size_t count) |
Emulated wcscat - Appends a string. | |
int | wcsncmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2, size_t len) |
Emulated wcsncmp - Compares two arrays. | |
ACE_WCHAR_T * | wcsncpy_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *source, size_t len) |
Emulated wcsncpy - Copies an array. | |
ACE_NAMESPACE_INLINE_FUNCTION u_int | wslen (const WChar *) |
ACE_NAMESPACE_INLINE_FUNCTION WChar * | wscpy (WChar *, const WChar *) |
ACE_NAMESPACE_INLINE_FUNCTION int | wscmp (const WChar *, const WChar *) |
ACE_NAMESPACE_INLINE_FUNCTION int | wsncmp (const WChar *, const WChar *, size_t len) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE u_int | wslen (const WChar *s) |
ACE_INLINE ACE_OS::WChar * | wscpy (WChar *dest, const WChar *src) |
ACE_INLINE int | wscmp (const WChar *s, const WChar *t) |
ACE_INLINE int | wsncmp (const WChar *s, const WChar *t, size_t len) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_accept (ACE_HANDLE fildes, ACE_HANDLE resfd, struct t_call *call) |
ACE_NAMESPACE_INLINE_FUNCTION char * | t_alloc (ACE_HANDLE fildes, int struct_type, int fields) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_bind (ACE_HANDLE fildes, ACE_TBIND *req, ACE_TBIND *ret) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_close (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_connect (ACE_HANDLE fildes, struct t_call *sndcall, struct t_call *rcvcall) |
ACE_NAMESPACE_INLINE_FUNCTION void | t_error (const char *errmsg) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_free (char *ptr, int struct_type) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_getinfo (ACE_HANDLE fildes, struct t_info *info) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_getname (ACE_HANDLE fildes, struct netbuf *namep, int type) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_getstate (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_listen (ACE_HANDLE fildes, struct t_call *call) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_look (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE | t_open (char *path, int oflag, struct t_info *info) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_optmgmt (ACE_HANDLE handle, ACE_TOPTMGMT *req, ACE_TOPTMGMT *ret) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_rcv (ACE_HANDLE fildes, char *buf, unsigned int nbytes, int *flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_rcvdis (ACE_HANDLE fildes, struct t_discon *discon) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_rcvrel (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_rcvudata (ACE_HANDLE fildes, struct t_unitdata *unitdata, int *flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_rcvuderr (ACE_HANDLE fildes, struct t_uderr *uderr) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_snd (ACE_HANDLE fildes, const char *buf, unsigned int nbytes, int flags) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_snddis (ACE_HANDLE fildes, struct t_call *call) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_sndrel (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_sync (ACE_HANDLE fildes) |
ACE_NAMESPACE_INLINE_FUNCTION int | t_unbind (ACE_HANDLE fildes) |
This namespace encapsulates the differences between various OS platforms. When porting ACE to a new platform, this class is the place to focus on. Once this file is ported to a new platform, pretty much everything else comes for "free." See <www.cs.wustl.edu/~schmidt/ACE_wrappers/etc/ACE-porting.html> for instructions on porting ACE. Please see the README file in this directory for complete information on the meaning of the various macros.
typedef ACE_WCHAR_T ACE_OS::WChar |
Definition at line 45 of file OS_NS_wchar.h.
Definition at line 149 of file OS_NS_time.h.
00150 { 00151 ACE_HRTIMER_START = 0x0, // Only use these if you can stand 00152 ACE_HRTIMER_INCR = 0x1, // for interrupts to be disabled during 00153 ACE_HRTIMER_STOP = 0x2, // the timed interval!!!! 00154 ACE_HRTIMER_GETTIME = 0xFFFF 00155 };
ACE_Export int ACE_OS::inet_aton | ( | const char * | host_name, | |
struct in_addr * | addr | |||
) |
Definition at line 15 of file OS_NS_arpa_inet.cpp.
References INADDR_NONE, inet_addr(), and strcmp().
Referenced by inet_pton(), and ACE_INET_Addr::set().
00016 { 00017 #if defined (ACE_LACKS_INET_ATON) 00018 # if defined (ACE_WIN32) 00019 // Windows Server 2003 changed the behavior of a zero-length input 00020 // string to inet_addr(). It used to return 0 (INADDR_ANY) but now 00021 // returns -1 (INADDR_NONE). It will return INADDR_ANY for a 1-space 00022 // string, though, as do previous versions of Windows. 00023 if (host_name == 0 || host_name[0] == '\0') 00024 host_name = " "; 00025 # endif /* ACE_WIN32 */ 00026 unsigned long ip_addr = ACE_OS::inet_addr (host_name); 00027 00028 if (ip_addr == INADDR_NONE 00029 // Broadcast addresses are weird... 00030 && ACE_OS::strcmp (host_name, "255.255.255.255") != 0) 00031 return 0; 00032 else if (addr == 0) 00033 return 0; 00034 else 00035 { 00036 addr->s_addr = ip_addr; // Network byte ordered 00037 return 1; 00038 } 00039 #elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x660) 00040 // inet_aton() returns OK (0) on success and ERROR (-1) on failure. 00041 // Must reset errno first. Refer to WindRiver SPR# 34949, SPR# 36026 00042 ::errnoSet(0); 00043 int result = ERROR; 00044 ACE_OSCALL (::inet_aton (const_cast <char*>(host_name), addr), int, ERROR, result); 00045 return (result == ERROR) ? 0 : 1; 00046 #else 00047 // inet_aton() returns 0 upon failure, not -1 since -1 is a valid 00048 // address (255.255.255.255). 00049 ACE_OSCALL_RETURN (::inet_aton (host_name, addr), int, 0); 00050 #endif /* ACE_LACKS_INET_ATON */ 00051 }
ACE_NAMESPACE_INLINE_FUNCTION unsigned long ACE_OS::inet_addr | ( | const char * | name | ) |
Definition at line 11 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and inet_addr().
Referenced by inet_addr(), and inet_aton().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::inet_addr"); 00014 #if defined (ACE_LACKS_INET_ADDR) 00015 ACE_UNUSED_ARG (name); 00016 ACE_NOTSUP_RETURN (0); 00017 #elif defined (ACE_HAS_NONCONST_GETBY) 00018 return ::inet_addr (const_cast <char*> (name)); 00019 #else 00020 return ::inet_addr (name); 00021 #endif /* ACE_HAS_NONCONST_GETBY */ 00022 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::inet_ntoa | ( | const struct in_addr | addr | ) |
Definition at line 25 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and inet_ntoa().
Referenced by ACE_INET_Addr::get_host_addr(), and inet_ntoa().
00026 { 00027 ACE_OS_TRACE ("ACE_OS::inet_ntoa"); 00028 #if defined (ACE_LACKS_INET_NTOA) 00029 ACE_UNUSED_ARG (addr); 00030 ACE_NOTSUP_RETURN (0); 00031 #else 00032 ACE_OSCALL_RETURN (::inet_ntoa (addr), 00033 char *, 00034 0); 00035 #endif 00036 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::inet_ntop | ( | int | family, | |
const void * | addrptr, | |||
char * | strptr, | |||
size_t | len | |||
) |
Definition at line 39 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, AF_INET, INET_ADDRSTRLEN, inet_ntop(), sprintf(), strcpy(), and strlen().
Referenced by ACE_INET_Addr::get_host_addr(), and inet_ntop().
00040 { 00041 ACE_OS_TRACE ("ACE_OS::inet_ntop"); 00042 00043 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00044 ACE_OSCALL_RETURN (::inet_ntop (family, addrptr, strptr, len), const char *, 0); 00045 #else 00046 const u_char *p = reinterpret_cast<const u_char *> (addrptr); 00047 00048 if (family == AF_INET) 00049 { 00050 char temp[INET_ADDRSTRLEN]; 00051 00052 // Stevens uses snprintf() in his implementation but snprintf() 00053 // doesn't appear to be very portable. For now, hope that using 00054 // sprintf() will not cause any string/memory overrun problems. 00055 ACE_OS::sprintf (temp, 00056 "%d.%d.%d.%d", 00057 p[0], p[1], p[2], p[3]); 00058 00059 if (ACE_OS::strlen (temp) >= len) 00060 { 00061 errno = ENOSPC; 00062 return 0; // Failure 00063 } 00064 00065 ACE_OS::strcpy (strptr, temp); 00066 return strptr; 00067 } 00068 00069 ACE_NOTSUP_RETURN(0); 00070 #endif /* ACE_HAS_IPV6 */ 00071 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::inet_pton | ( | int | family, | |
const char * | strptr, | |||
void * | addrptr | |||
) |
Definition at line 74 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, AF_INET, inet_aton(), inet_pton(), and memcpy().
Referenced by inet_pton().
00075 { 00076 ACE_OS_TRACE ("ACE_OS::inet_pton"); 00077 00078 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00079 ACE_OSCALL_RETURN (::inet_pton (family, strptr, addrptr), int, -1); 00080 #else 00081 if (family == AF_INET) 00082 { 00083 struct in_addr in_val; 00084 00085 if (ACE_OS::inet_aton (strptr, &in_val)) 00086 { 00087 ACE_OS::memcpy (addrptr, &in_val, sizeof (struct in_addr)); 00088 return 1; // Success 00089 } 00090 00091 return 0; // Input is not a valid presentation format 00092 } 00093 00094 ACE_NOTSUP_RETURN(-1); 00095 #endif /* ACE_HAS_IPV6 */ 00096 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE unsigned long ACE_OS::inet_addr | ( | const char * | name | ) |
Definition at line 11 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and inet_addr().
Referenced by inet_addr(), and inet_aton().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::inet_addr"); 00014 #if defined (ACE_LACKS_INET_ADDR) 00015 ACE_UNUSED_ARG (name); 00016 ACE_NOTSUP_RETURN (0); 00017 #elif defined (ACE_HAS_NONCONST_GETBY) 00018 return ::inet_addr (const_cast <char*> (name)); 00019 #else 00020 return ::inet_addr (name); 00021 #endif /* ACE_HAS_NONCONST_GETBY */ 00022 }
ACE_INLINE char* ACE_OS::inet_ntoa | ( | const struct in_addr | addr | ) |
Definition at line 25 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and inet_ntoa().
Referenced by ACE_INET_Addr::get_host_addr(), and inet_ntoa().
00026 { 00027 ACE_OS_TRACE ("ACE_OS::inet_ntoa"); 00028 #if defined (ACE_LACKS_INET_NTOA) 00029 ACE_UNUSED_ARG (addr); 00030 ACE_NOTSUP_RETURN (0); 00031 #else 00032 ACE_OSCALL_RETURN (::inet_ntoa (addr), 00033 char *, 00034 0); 00035 #endif 00036 }
ACE_INLINE const char* ACE_OS::inet_ntop | ( | int | family, | |
const void * | addrptr, | |||
char * | strptr, | |||
size_t | len | |||
) |
Definition at line 39 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, AF_INET, INET_ADDRSTRLEN, inet_ntop(), sprintf(), strcpy(), and strlen().
Referenced by ACE_INET_Addr::get_host_addr(), and inet_ntop().
00040 { 00041 ACE_OS_TRACE ("ACE_OS::inet_ntop"); 00042 00043 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00044 ACE_OSCALL_RETURN (::inet_ntop (family, addrptr, strptr, len), const char *, 0); 00045 #else 00046 const u_char *p = reinterpret_cast<const u_char *> (addrptr); 00047 00048 if (family == AF_INET) 00049 { 00050 char temp[INET_ADDRSTRLEN]; 00051 00052 // Stevens uses snprintf() in his implementation but snprintf() 00053 // doesn't appear to be very portable. For now, hope that using 00054 // sprintf() will not cause any string/memory overrun problems. 00055 ACE_OS::sprintf (temp, 00056 "%d.%d.%d.%d", 00057 p[0], p[1], p[2], p[3]); 00058 00059 if (ACE_OS::strlen (temp) >= len) 00060 { 00061 errno = ENOSPC; 00062 return 0; // Failure 00063 } 00064 00065 ACE_OS::strcpy (strptr, temp); 00066 return strptr; 00067 } 00068 00069 ACE_NOTSUP_RETURN(0); 00070 #endif /* ACE_HAS_IPV6 */ 00071 }
ACE_INLINE int ACE_OS::inet_pton | ( | int | family, | |
const char * | strptr, | |||
void * | addrptr | |||
) |
Definition at line 74 of file OS_NS_arpa_inet.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, AF_INET, inet_aton(), inet_pton(), and memcpy().
Referenced by inet_pton().
00075 { 00076 ACE_OS_TRACE ("ACE_OS::inet_pton"); 00077 00078 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00079 ACE_OSCALL_RETURN (::inet_pton (family, strptr, addrptr), int, -1); 00080 #else 00081 if (family == AF_INET) 00082 { 00083 struct in_addr in_val; 00084 00085 if (ACE_OS::inet_aton (strptr, &in_val)) 00086 { 00087 ACE_OS::memcpy (addrptr, &in_val, sizeof (struct in_addr)); 00088 return 1; // Success 00089 } 00090 00091 return 0; // Input is not a valid presentation format 00092 } 00093 00094 ACE_NOTSUP_RETURN(-1); 00095 #endif /* ACE_HAS_IPV6 */ 00096 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isalnum | ( | ACE_TCHAR | c | ) |
Returns true if the character is an alphanumeric character.
Definition at line 13 of file OS_NS_ctype.inl.
Referenced by ACE_Get_Opt::long_option().
00014 { 00015 #if defined (ACE_USES_WCHAR) 00016 # if defined (_MSC_VER) && (_MSC_VER >= 1300) 00017 // For MSVC 7.x, we need to prevent "illegal" character getting into 00018 // isalnum, otherwise, it will crash the program. 00019 return c > 0 && c < 256 && iswalnum (c); 00020 # else 00021 return iswalnum (c); 00022 # endif /* _MSC_VER && _MSC_VER >= 1300 */ 00023 #else /* ACE_USES_WCHAR */ 00024 return isalnum ((unsigned char) c); 00025 #endif /* ACE_USES_WCHAR */ 00026 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isalpha | ( | ACE_TCHAR | c | ) |
Returns true if the character is an alphabetic character.
Definition at line 29 of file OS_NS_ctype.inl.
00030 { 00031 #if defined (ACE_USES_WCHAR) 00032 return iswalpha (c); 00033 #else /* ACE_USES_WCHAR */ 00034 return isalpha ((unsigned char) c); 00035 #endif /* ACE_USES_WCHAR */ 00036 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_iscntrl | ( | ACE_TCHAR | c | ) |
Returns true if the character is a control character.
Definition at line 39 of file OS_NS_ctype.inl.
00040 { 00041 #if defined (ACE_USES_WCHAR) 00042 return iswcntrl (c); 00043 #else /* ACE_USES_WCHAR */ 00044 return iscntrl ((unsigned char) c); 00045 #endif /* ACE_USES_WCHAR */ 00046 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isdigit | ( | ACE_TCHAR | c | ) |
Returns true if the character is a decimal-digit character.
Definition at line 49 of file OS_NS_ctype.inl.
Referenced by ACE::hex2byte(), ACE_Capabilities::parse(), and ACE_Svc_Conf_Lexer::scan().
00050 { 00051 #if defined (ACE_USES_WCHAR) 00052 return iswdigit (c); 00053 #else /* ACE_USES_WCHAR */ 00054 return isdigit ((unsigned char) c); 00055 #endif /* ACE_USES_WCHAR */ 00056 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isgraph | ( | ACE_TCHAR | c | ) |
Returns true if the character is a printable character other than a space.
Definition at line 59 of file OS_NS_ctype.inl.
00060 { 00061 #if defined (ACE_USES_WCHAR) 00062 return iswgraph (c); 00063 #else /* ACE_USES_WCHAR */ 00064 return isgraph ((unsigned char) c); 00065 #endif /* ACE_USES_WCHAR */ 00066 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_islower | ( | ACE_TCHAR | c | ) |
Returns true if the character is a lowercase character.
Definition at line 69 of file OS_NS_ctype.inl.
Referenced by ACE::hex2byte().
00070 { 00071 #if defined (ACE_USES_WCHAR) 00072 return iswlower (c); 00073 #else /* ACE_USES_WCHAR */ 00074 return islower ((unsigned char) c); 00075 #endif /* ACE_USES_WCHAR */ 00076 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isprint | ( | ACE_TCHAR | c | ) |
Returns true if the character is a printable character.
Definition at line 79 of file OS_NS_ctype.inl.
Referenced by ACE::format_hexdump().
00080 { 00081 #if defined (ACE_USES_WCHAR) 00082 return iswprint (c); 00083 #else /* ACE_USES_WCHAR */ 00084 return isprint ((unsigned char) c); 00085 #endif /* ACE_USES_WCHAR */ 00086 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_ispunct | ( | ACE_TCHAR | c | ) |
Returns true if the character is a punctuation character.
Definition at line 89 of file OS_NS_ctype.inl.
00090 { 00091 #if defined (ACE_USES_WCHAR) 00092 return iswpunct (c); 00093 #else /* ACE_USES_WCHAR */ 00094 return ispunct ((unsigned char) c); 00095 #endif /* ACE_USES_WCHAR */ 00096 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isspace | ( | ACE_TCHAR | c | ) |
Returns true if the character is a space character.
Definition at line 99 of file OS_NS_ctype.inl.
Referenced by ACE_Base64::decode(), ACE_Capabilities::fillent(), is_empty(), ACE_Capabilities::is_entry(), is_line(), ACE_Base64::length(), ACE_Ini_ImpExp::squish(), and string_to_argv().
00100 { 00101 #if defined (ACE_USES_WCHAR) 00102 return iswspace (c); 00103 #else /* ACE_USES_WCHAR */ 00104 return isspace ((unsigned char) c); 00105 #endif /* ACE_USES_WCHAR */ 00106 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isupper | ( | ACE_TCHAR | c | ) |
Returns true if the character is an uppercase character.
Definition at line 109 of file OS_NS_ctype.inl.
00110 { 00111 #if defined (ACE_USES_WCHAR) 00112 return iswupper (c); 00113 #else /* ACE_USES_WCHAR */ 00114 return isupper ((unsigned char) c); 00115 #endif /* ACE_USES_WCHAR */ 00116 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_isxdigit | ( | ACE_TCHAR | c | ) |
Returns true if the character is a hexadecimal-digit character.
Definition at line 119 of file OS_NS_ctype.inl.
00120 { 00121 #if defined (ACE_USES_WCHAR) 00122 return iswxdigit (c); 00123 #else /* ACE_USES_WCHAR */ 00124 return isxdigit ((unsigned char) c); 00125 #endif /* ACE_USES_WCHAR */ 00126 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_tolower | ( | int | c | ) |
Converts a character to lower case (char version).
Definition at line 129 of file OS_NS_ctype.inl.
Referenced by equal_char(), and ACE_Svc_Conf_Lexer::scan().
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ace_toupper | ( | int | c | ) |
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::ace_isalnum | ( | ACE_TCHAR | c | ) |
Returns true if the character is an alphanumeric character.
Definition at line 13 of file OS_NS_ctype.inl.
Referenced by ACE_Get_Opt::long_option().
00014 { 00015 #if defined (ACE_USES_WCHAR) 00016 # if defined (_MSC_VER) && (_MSC_VER >= 1300) 00017 // For MSVC 7.x, we need to prevent "illegal" character getting into 00018 // isalnum, otherwise, it will crash the program. 00019 return c > 0 && c < 256 && iswalnum (c); 00020 # else 00021 return iswalnum (c); 00022 # endif /* _MSC_VER && _MSC_VER >= 1300 */ 00023 #else /* ACE_USES_WCHAR */ 00024 return isalnum ((unsigned char) c); 00025 #endif /* ACE_USES_WCHAR */ 00026 }
ACE_INLINE int ACE_OS::ace_isalpha | ( | ACE_TCHAR | c | ) |
Returns true if the character is an alphabetic character.
Definition at line 29 of file OS_NS_ctype.inl.
00030 { 00031 #if defined (ACE_USES_WCHAR) 00032 return iswalpha (c); 00033 #else /* ACE_USES_WCHAR */ 00034 return isalpha ((unsigned char) c); 00035 #endif /* ACE_USES_WCHAR */ 00036 }
ACE_INLINE int ACE_OS::ace_iscntrl | ( | ACE_TCHAR | c | ) |
Returns true if the character is a control character.
Definition at line 39 of file OS_NS_ctype.inl.
00040 { 00041 #if defined (ACE_USES_WCHAR) 00042 return iswcntrl (c); 00043 #else /* ACE_USES_WCHAR */ 00044 return iscntrl ((unsigned char) c); 00045 #endif /* ACE_USES_WCHAR */ 00046 }
ACE_INLINE int ACE_OS::ace_isdigit | ( | ACE_TCHAR | c | ) |
Returns true if the character is a decimal-digit character.
Definition at line 49 of file OS_NS_ctype.inl.
Referenced by ACE::hex2byte(), ACE_Capabilities::parse(), and ACE_Svc_Conf_Lexer::scan().
00050 { 00051 #if defined (ACE_USES_WCHAR) 00052 return iswdigit (c); 00053 #else /* ACE_USES_WCHAR */ 00054 return isdigit ((unsigned char) c); 00055 #endif /* ACE_USES_WCHAR */ 00056 }
ACE_INLINE int ACE_OS::ace_isgraph | ( | ACE_TCHAR | c | ) |
Returns true if the character is a printable character other than a space.
Definition at line 59 of file OS_NS_ctype.inl.
00060 { 00061 #if defined (ACE_USES_WCHAR) 00062 return iswgraph (c); 00063 #else /* ACE_USES_WCHAR */ 00064 return isgraph ((unsigned char) c); 00065 #endif /* ACE_USES_WCHAR */ 00066 }
ACE_INLINE int ACE_OS::ace_islower | ( | ACE_TCHAR | c | ) |
Returns true if the character is a lowercase character.
Definition at line 69 of file OS_NS_ctype.inl.
Referenced by ACE::hex2byte().
00070 { 00071 #if defined (ACE_USES_WCHAR) 00072 return iswlower (c); 00073 #else /* ACE_USES_WCHAR */ 00074 return islower ((unsigned char) c); 00075 #endif /* ACE_USES_WCHAR */ 00076 }
ACE_INLINE int ACE_OS::ace_isprint | ( | ACE_TCHAR | c | ) |
Returns true if the character is a printable character.
Definition at line 79 of file OS_NS_ctype.inl.
Referenced by ACE::format_hexdump().
00080 { 00081 #if defined (ACE_USES_WCHAR) 00082 return iswprint (c); 00083 #else /* ACE_USES_WCHAR */ 00084 return isprint ((unsigned char) c); 00085 #endif /* ACE_USES_WCHAR */ 00086 }
ACE_INLINE int ACE_OS::ace_ispunct | ( | ACE_TCHAR | c | ) |
Returns true if the character is a punctuation character.
Definition at line 89 of file OS_NS_ctype.inl.
00090 { 00091 #if defined (ACE_USES_WCHAR) 00092 return iswpunct (c); 00093 #else /* ACE_USES_WCHAR */ 00094 return ispunct ((unsigned char) c); 00095 #endif /* ACE_USES_WCHAR */ 00096 }
ACE_INLINE int ACE_OS::ace_isspace | ( | ACE_TCHAR | c | ) |
Returns true if the character is a space character.
Definition at line 99 of file OS_NS_ctype.inl.
Referenced by ACE_Base64::decode(), ACE_Capabilities::fillent(), is_empty(), ACE_Capabilities::is_entry(), is_line(), ACE_Base64::length(), ACE_Ini_ImpExp::squish(), and string_to_argv().
00100 { 00101 #if defined (ACE_USES_WCHAR) 00102 return iswspace (c); 00103 #else /* ACE_USES_WCHAR */ 00104 return isspace ((unsigned char) c); 00105 #endif /* ACE_USES_WCHAR */ 00106 }
ACE_INLINE int ACE_OS::ace_isupper | ( | ACE_TCHAR | c | ) |
Returns true if the character is an uppercase character.
Definition at line 109 of file OS_NS_ctype.inl.
00110 { 00111 #if defined (ACE_USES_WCHAR) 00112 return iswupper (c); 00113 #else /* ACE_USES_WCHAR */ 00114 return isupper ((unsigned char) c); 00115 #endif /* ACE_USES_WCHAR */ 00116 }
ACE_INLINE int ACE_OS::ace_isxdigit | ( | ACE_TCHAR | c | ) |
Returns true if the character is a hexadecimal-digit character.
Definition at line 119 of file OS_NS_ctype.inl.
00120 { 00121 #if defined (ACE_USES_WCHAR) 00122 return iswxdigit (c); 00123 #else /* ACE_USES_WCHAR */ 00124 return isxdigit ((unsigned char) c); 00125 #endif /* ACE_USES_WCHAR */ 00126 }
ACE_INLINE int ACE_OS::ace_tolower | ( | int | c | ) |
Converts a character to lower case (char version).
Definition at line 129 of file OS_NS_ctype.inl.
Referenced by equal_char(), and ACE_Svc_Conf_Lexer::scan().
ACE_INLINE int ACE_OS::ace_toupper | ( | int | c | ) |
ACE_Export int ACE_OS::scandir_emulation | ( | const ACE_TCHAR * | dirname, | |
ACE_DIRENT ** | namelist[], | |||
ACE_SCANDIR_SELECTOR | selector, | |||
ACE_SCANDIR_COMPARATOR | comparator | |||
) |
Definition at line 162 of file OS_NS_dirent.cpp.
References closedir(), free(), malloc(), memcpy(), opendir(), qsort(), readdir(), realloc(), strcpy(), and strlen().
Referenced by scandir().
00166 { 00167 ACE_DIR *dirp = ACE_OS::opendir (dirname); 00168 00169 if (dirp == 0) 00170 return -1; 00171 // A sanity check here. "namelist" had better not be zero. 00172 else if (namelist == 0) 00173 return -1; 00174 00175 ACE_DIRENT **vector = 0; 00176 ACE_DIRENT *dp = 0; 00177 int arena_size = 0; 00178 00179 int nfiles = 0; 00180 int fail = 0; 00181 00182 // @@ This code shoulduse readdir_r() rather than readdir(). 00183 for (dp = ACE_OS::readdir (dirp); 00184 dp != 0; 00185 dp = ACE_OS::readdir (dirp)) 00186 { 00187 if (selector && (*selector)(dp) == 0) 00188 continue; 00189 00190 // If we get here, we have a dirent that the user likes. 00191 if (nfiles == arena_size) 00192 { 00193 ACE_DIRENT **newv = 0; 00194 if (arena_size == 0) 00195 arena_size = 10; 00196 else 00197 arena_size *= 2; 00198 00199 newv = (ACE_DIRENT **) ACE_OS::realloc (vector, 00200 arena_size * sizeof (ACE_DIRENT *)); 00201 if (newv == 0) 00202 { 00203 fail = 1; 00204 break; 00205 } 00206 vector = newv; 00207 } 00208 00209 #if defined (ACE_LACKS_STRUCT_DIR) 00210 ACE_DIRENT *newdp = (ACE_DIRENT *) ACE_OS::malloc (sizeof (ACE_DIRENT)); 00211 #else 00212 size_t dsize = 00213 sizeof (ACE_DIRENT) + 00214 ((ACE_OS::strlen (dp->d_name) + 1) * sizeof (ACE_TCHAR)); 00215 ACE_DIRENT *newdp = (ACE_DIRENT *) ACE_OS::malloc (dsize); 00216 #endif /* ACE_LACKS_STRUCT_DIR */ 00217 00218 if (newdp == 0) 00219 { 00220 fail = 1; 00221 break; 00222 } 00223 00224 #if defined (ACE_LACKS_STRUCT_DIR) 00225 newdp->d_name = (ACE_TCHAR*) ACE_OS::malloc ( 00226 (ACE_OS::strlen (dp->d_name) + 1) * sizeof (ACE_TCHAR)); 00227 00228 if (newdp->d_name == 0) 00229 { 00230 fail = 1; 00231 ACE_OS::free (newdp); 00232 break; 00233 } 00234 00235 // Don't use memcpy here since d_name is now a pointer 00236 newdp->d_ino = dp->d_ino; 00237 newdp->d_off = dp->d_off; 00238 newdp->d_reclen = dp->d_reclen; 00239 ACE_OS::strcpy (newdp->d_name, dp->d_name); 00240 vector[nfiles++] = newdp; 00241 #else 00242 vector[nfiles++] = (ACE_DIRENT *) ACE_OS::memcpy (newdp, dp, dsize); 00243 #endif /* ACE_LACKS_STRUCT_DIR */ 00244 } 00245 00246 if (fail) 00247 { 00248 ACE_OS::closedir (dirp); 00249 while (vector && nfiles-- > 0) 00250 { 00251 #if defined (ACE_LACKS_STRUCT_DIR) 00252 ACE_OS::free (vector[nfiles]->d_name); 00253 #endif /* ACE_LACKS_STRUCT_DIR */ 00254 ACE_OS::free (vector[nfiles]); 00255 } 00256 ACE_OS::free (vector); 00257 return -1; 00258 } 00259 00260 ACE_OS::closedir (dirp); 00261 00262 *namelist = vector; 00263 00264 if (comparator) 00265 ACE_OS::qsort (*namelist, 00266 nfiles, 00267 sizeof (ACE_DIRENT *), 00268 (ACE_COMPARE_FUNC) comparator); 00269 00270 return nfiles; 00271 }
ACE_INLINE void ACE_OS::closedir | ( | ACE_DIR * | ) |
Definition at line 17 of file OS_NS_dirent.inl.
Referenced by ACE_Dirent::close(), ACE_Dirent::open(), scandir_emulation(), and ACE_Dirent::~ACE_Dirent().
00018 { 00019 #if defined (ACE_HAS_DIRENT) 00020 # if defined (ACE_WIN32) && defined (ACE_LACKS_CLOSEDIR) 00021 ACE_OS::closedir_emulation (d); 00022 delete [] d->directory_name_; 00023 delete d; 00024 # elif defined (ACE_HAS_WCLOSEDIR) && defined (ACE_USES_WCHAR) 00025 ::wclosedir (d); 00026 # else /* ACE_WIN32 && ACE_LACKS_CLOSEDIR */ 00027 ::closedir (d); 00028 # endif /* ACE_WIN32 && ACE_LACKS_CLOSEDIR */ 00029 00030 #else /* ACE_HAS_DIRENT */ 00031 ACE_UNUSED_ARG (d); 00032 #endif /* ACE_HAS_DIRENT */ 00033 }
Definition at line 36 of file OS_NS_dirent.inl.
References ACE_NOTSUP_RETURN, and ACE_TEXT_ALWAYS_CHAR.
Referenced by ACE_Dirent::open(), and scandir_emulation().
00037 { 00038 #if defined (ACE_HAS_DIRENT) 00039 # if defined (ACE_WIN32) && defined (ACE_LACKS_OPENDIR) 00040 return ::ACE_OS::opendir_emulation (filename); 00041 # elif defined (ACE_HAS_WOPENDIR) && defined (ACE_USES_WCHAR) 00042 return ::wopendir (filename); 00043 # elif defined (ACE_HAS_NONCONST_OPENDIR) 00044 return ::opendir (const_cast<char *> (filename)); 00045 # else /* ! ACE_WIN32 && ACE_LACKS_OPENDIR */ 00046 return ::opendir (ACE_TEXT_ALWAYS_CHAR (filename)); 00047 # endif /* ACE_WIN32 && ACE_LACKS_OPENDIR */ 00048 #else 00049 ACE_UNUSED_ARG (filename); 00050 ACE_NOTSUP_RETURN (0); 00051 #endif /* ACE_HAS_DIRENT */ 00052 }
ACE_INLINE struct ACE_DIRENT * ACE_OS::readdir | ( | ACE_DIR * | ) |
Definition at line 55 of file OS_NS_dirent.inl.
References ACE_NOTSUP_RETURN.
Referenced by ACE_Dirent::read(), readdir_r(), and scandir_emulation().
00056 { 00057 #if defined (ACE_HAS_DIRENT) 00058 # if defined (ACE_WIN32) && defined (ACE_LACKS_READDIR) 00059 return ACE_OS::readdir_emulation (d); 00060 # elif defined (ACE_HAS_WREADDIR) && defined (ACE_USES_WCHAR) 00061 return ::wreaddir (d); 00062 # else /* ACE_WIN32 && ACE_LACKS_READDIR */ 00063 return ::readdir (d); 00064 # endif /* ACE_WIN32 && ACE_LACKS_READDIR */ 00065 #else 00066 ACE_UNUSED_ARG (d); 00067 ACE_NOTSUP_RETURN (0); 00068 #endif /* ACE_HAS_DIRENT */ 00069 }
ACE_INLINE int ACE_OS::readdir_r | ( | ACE_DIR * | dirp, | |
struct ACE_DIRENT * | entry, | |||
struct ACE_DIRENT ** | result | |||
) |
Definition at line 72 of file OS_NS_dirent.inl.
References ACE_NOTSUP_RETURN, and readdir().
Referenced by ACE_Dirent::read().
00075 { 00076 #if !defined (ACE_HAS_REENTRANT_FUNCTIONS) 00077 ACE_UNUSED_ARG (entry); 00078 // <result> has better not be 0! 00079 *result = ACE_OS::readdir (dirp); 00080 if (*result) 00081 return 0; // Keep iterating 00082 else 00083 return 1; // Oops, some type of error! 00084 #elif defined (ACE_HAS_DIRENT) && !defined (ACE_LACKS_READDIR_R) 00085 # if defined (ACE_HAS_3_PARAM_READDIR_R) 00086 return ::readdir_r (dirp, entry, result); 00087 # else 00088 // <result> had better not be 0! 00089 *result = ::readdir_r (dirp, entry); 00090 return 0; 00091 # endif /* sun */ 00092 #else /* ! ACE_HAS_DIRENT || ACE_LACKS_READDIR_R */ 00093 ACE_UNUSED_ARG (dirp); 00094 ACE_UNUSED_ARG (entry); 00095 ACE_UNUSED_ARG (result); 00096 ACE_NOTSUP_RETURN (0); 00097 00098 #endif /* ACE_HAS_REENTRANT_FUNCTIONS */ 00099 }
ACE_INLINE void ACE_OS::rewinddir | ( | ACE_DIR * | ) |
Definition at line 102 of file OS_NS_dirent.inl.
References ace_rewinddir_helper().
Referenced by ace_rewinddir_helper(), and ACE_Dirent::rewind().
00103 { 00104 #if defined (ACE_HAS_DIRENT) 00105 # if defined (ACE_HAS_WREWINDDIR) && defined (ACE_USES_WCHAR) 00106 ::wrewinddir (d); 00107 # elif !defined (ACE_LACKS_REWINDDIR) 00108 ace_rewinddir_helper (d); 00109 # else 00110 ACE_UNUSED_ARG (d); 00111 # endif /* !defined (ACE_LACKS_REWINDDIR) */ 00112 #endif /* ACE_HAS_DIRENT */ 00113 }
ACE_INLINE int ACE_OS::scandir | ( | const ACE_TCHAR * | dirname, | |
struct ACE_DIRENT ** | namelist[], | |||
ACE_SCANDIR_SELECTOR | selector, | |||
ACE_SCANDIR_COMPARATOR | comparator | |||
) |
Definition at line 116 of file OS_NS_dirent.inl.
References ACE_TEXT_ALWAYS_CHAR, and scandir_emulation().
Referenced by ACE_Dirent_Selector::open().
00120 { 00121 #if defined (ACE_HAS_SCANDIR) 00122 return ::scandir (ACE_TEXT_ALWAYS_CHAR (dirname), 00123 namelist, 00124 # if defined (ACE_SCANDIR_SEL_LACKS_CONST) 00125 reinterpret_cast<ACE_SCANDIR_OS_SELECTOR> (selector), 00126 # else 00127 selector, 00128 # endif /* ACE_SCANDIR_SEL_LACKS_CONST */ 00129 # if defined (ACE_SCANDIR_CMP_USES_VOIDPTR) || \ 00130 defined (ACE_SCANDIR_CMP_USES_CONST_VOIDPTR) 00131 reinterpret_cast<ACE_SCANDIR_OS_COMPARATOR> (comparator)); 00132 # else 00133 comparator); 00134 # endif /* ACE_SCANDIR_CMP_USES_VOIDPTR */ 00135 00136 #else /* ! defined ( ACE_HAS_SCANDIR) */ 00137 return ACE_OS::scandir_emulation (dirname, namelist, selector, comparator); 00138 #endif /* ACE_HAS_SCANDIR */ 00139 }
ACE_INLINE int ACE_OS::alphasort | ( | const void * | , | |
const void * | ||||
) |
Definition at line 142 of file OS_NS_dirent.inl.
References ACE_DIRENT, and strcmp().
00143 { 00144 #if defined (ACE_LACKS_ALPHASORT) 00145 return ACE_OS::strcmp ((*static_cast<const struct ACE_DIRENT * const *>(a))->d_name, 00146 (*static_cast<const struct ACE_DIRENT * const *>(b))->d_name); 00147 #else 00148 # if defined (ACE_SCANDIR_CMP_USES_VOIDPTR) 00149 return ::alphasort (const_cast<void *>(a), 00150 const_cast<void *>(b)); 00151 # elif defined (ACE_SCANDIR_CMP_USES_CONST_VOIDPTR) 00152 return ::alphasort (a, b); 00153 # else 00154 return ::alphasort ((const struct ACE_DIRENT **)a, 00155 (const struct ACE_DIRENT **)b); 00156 # endif 00157 #endif 00158 }
ACE_INLINE void ACE_OS::seekdir | ( | ACE_DIR * | , | |
long | loc | |||
) |
Definition at line 161 of file OS_NS_dirent.inl.
Referenced by ACE_Dirent::seek().
00162 { 00163 #if defined (ACE_HAS_DIRENT) && !defined (ACE_LACKS_SEEKDIR) 00164 ::seekdir (d, loc); 00165 #else /* ! ACE_HAS_DIRENT || ACE_LACKS_SEEKDIR */ 00166 ACE_UNUSED_ARG (d); 00167 ACE_UNUSED_ARG (loc); 00168 #endif /* ! ACE_HAS_DIRENT || ACE_LACKS_SEEKDIR */ 00169 }
ACE_INLINE long ACE_OS::telldir | ( | ACE_DIR * | ) |
Definition at line 172 of file OS_NS_dirent.inl.
References ACE_NOTSUP_RETURN.
Referenced by ACE_Dirent::tell().
00173 { 00174 #if defined (ACE_HAS_DIRENT) && !defined (ACE_LACKS_TELLDIR) 00175 return ::telldir (d); 00176 #else /* ! ACE_HAS_DIRENT || ACE_LACKS_TELLDIR */ 00177 ACE_UNUSED_ARG (d); 00178 ACE_NOTSUP_RETURN (-1); 00179 #endif /* ! ACE_HAS_DIRENT || ACE_LACKS_TELLDIR */ 00180 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::dlclose | ( | ACE_SHLIB_HANDLE | handle | ) |
Definition at line 26 of file OS_NS_dlfcn.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT, dlclose(), and dlsym().
Referenced by ACE_DLL_Handle::close(), dlclose(), and dlopen().
00027 { 00028 ACE_OS_TRACE ("ACE_OS::dlclose"); 00029 #if defined (ACE_LACKS_DLCLOSE) 00030 ACE_UNUSED_ARG (handle); 00031 return 0; 00032 #elif defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00033 00034 # if !defined (ACE_HAS_AUTOMATIC_INIT_FINI) 00035 // SunOS4 does not automatically call _fini()! 00036 void *ptr; 00037 00038 ACE_OSCALL (::dlsym (handle, ACE_TEXT ("_fini")), void *, 0, ptr); 00039 00040 if (ptr != 0) 00041 (*((int (*)(void)) ptr)) (); // Call _fini hook explicitly. 00042 # endif /* ACE_HAS_AUTOMATIC_INIT_FINI */ 00043 #if defined (_M_UNIX) 00044 ACE_OSCALL_RETURN (::_dlclose (handle), int, -1); 00045 #else /* _MUNIX */ 00046 ACE_OSCALL_RETURN (::dlclose (handle), int, -1); 00047 #endif /* _M_UNIX */ 00048 #elif defined (ACE_WIN32) 00049 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::FreeLibrary (handle), ace_result_), int, -1); 00050 #elif defined (__hpux) 00051 // HP-UX 10.x and 32-bit 11.00 do not pay attention to the ref count 00052 // when unloading a dynamic lib. So, if the ref count is more than 00053 // 1, do not unload the lib. This will cause a library loaded more 00054 // than once to not be unloaded until the process runs down, but 00055 // that's life. It's better than unloading a library that's in use. 00056 // So far as I know, there's no way to decrement the refcnt that the 00057 // kernel is looking at - the shl_descriptor is a copy of what the 00058 // kernel has, not the actual struct. On 64-bit HP-UX using dlopen, 00059 // this problem has been fixed. 00060 struct shl_descriptor desc; 00061 if (shl_gethandle_r (handle, &desc) == -1) 00062 return -1; 00063 if (desc.ref_count > 1) 00064 return 0; 00065 # if defined(__GNUC__) || __cplusplus >= 199707L 00066 ACE_OSCALL_RETURN (::shl_unload (handle), int, -1); 00067 # else 00068 ACE_OSCALL_RETURN (::cxxshl_unload (handle), int, -1); 00069 # endif /* aC++ vs. Hp C++ */ 00070 #else 00071 ACE_UNUSED_ARG (handle); 00072 ACE_NOTSUP_RETURN (-1); 00073 #endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00074 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_TCHAR* ACE_OS::dlerror | ( | void | ) |
Definition at line 77 of file OS_NS_dlfcn.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT_CHAR_TO_TCHAR, dlerror(), sprintf(), strerror(), and strncpy().
Referenced by dlerror(), ACE_DLL_Handle::error(), and ACE_DLL::error().
00078 { 00079 ACE_OS_TRACE ("ACE_OS::dlerror"); 00080 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00081 const char *err; 00082 # if defined(_M_UNIX) 00083 ACE_OSCALL (::_dlerror (), const char *, 0, err); 00084 # else /* _M_UNIX */ 00085 ACE_OSCALL (::dlerror (), const char *, 0, err); 00086 # endif /* _M_UNIX */ 00087 if (err == 0) 00088 return 0; 00089 # if defined (ACE_USES_WCHAR) 00090 const size_t BufLen = 256; 00091 static wchar_t buf[BufLen]; 00092 ACE_OS::strncpy (buf, ACE_TEXT_CHAR_TO_TCHAR (err), BufLen); 00093 return buf; 00094 # else 00095 return const_cast <char *> (err); 00096 # endif /* ACE_USES_WCHAR */ 00097 # elif defined (__hpux) || defined (ACE_VXWORKS) 00098 //FUZZ: disable check_for_lack_ACE_OS 00099 ACE_OSCALL_RETURN (::strerror(errno), char *, 0); 00100 //FUZZ: enable check_for_lack_ACE_OS 00101 # elif defined (ACE_WIN32) 00102 static ACE_TCHAR buf[128]; 00103 # if defined (ACE_HAS_PHARLAP) 00104 ACE_OS::sprintf (buf, "error code %d", GetLastError()); 00105 # else 00106 ACE_TEXT_FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, 00107 0, 00108 ::GetLastError (), 00109 0, 00110 buf, 00111 sizeof buf / sizeof buf[0], 00112 0); 00113 # endif /* ACE_HAS_PHARLAP */ 00114 return buf; 00115 # else 00116 ACE_NOTSUP_RETURN (0); 00117 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00118 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_SHLIB_HANDLE ACE_OS::dlopen | ( | const ACE_TCHAR * | filename, | |
int | mode = ACE_DEFAULT_SHLIB_MODE | |||
) |
Definition at line 121 of file OS_NS_dlfcn.inl.
References ACE_DEFAULT_FILE_PERMS, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, close(), dlclose(), dlopen(), dlsym(), last_error(), and open().
Referenced by dlopen(), ACE_DLL_Strategy< SVC_HANDLER >::make_svc_handler(), and ACE_DLL_Handle::open().
00123 { 00124 ACE_OS_TRACE ("ACE_OS::dlopen"); 00125 00126 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00127 void *handle; 00128 # if defined (ACE_HAS_SGIDLADD) 00129 ACE_OSCALL 00130 (::sgidladd (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00131 # elif defined (_M_UNIX) 00132 ACE_OSCALL 00133 (::_dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00134 # else 00135 ACE_OSCALL 00136 (::dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00137 # endif /* ACE_HAS_SGIDLADD */ 00138 # if !defined (ACE_HAS_AUTOMATIC_INIT_FINI) 00139 if (handle != 0) 00140 { 00141 void *ptr; 00142 // Some systems (e.g., SunOS4) do not automatically call _init(), so 00143 // we'll have to call it manually. 00144 00145 ACE_OSCALL (::dlsym (handle, ACE_TEXT ("_init")), void *, 0, ptr); 00146 00147 if (ptr != 0 && (*((int (*)(void)) ptr)) () == -1) // Call _init hook explicitly. 00148 { 00149 // Close down the handle to prevent leaks. 00150 ::dlclose (handle); 00151 return 0; 00152 } 00153 } 00154 # endif /* ACE_HAS_AUTOMATIC_INIT_FINI */ 00155 return handle; 00156 # elif defined (ACE_WIN32) 00157 ACE_UNUSED_ARG (mode); 00158 00159 ACE_WIN32CALL_RETURN (ACE_TEXT_LoadLibrary (fname), ACE_SHLIB_HANDLE, 0); 00160 # elif defined (__hpux) 00161 00162 # if defined(__GNUC__) || __cplusplus >= 199707L 00163 ACE_OSCALL_RETURN (::shl_load(fname, mode, 0L), ACE_SHLIB_HANDLE, 0); 00164 # else 00165 ACE_OSCALL_RETURN (::cxxshl_load(fname, mode, 0L), ACE_SHLIB_HANDLE, 0); 00166 # endif /* aC++ vs. Hp C++ */ 00167 # elif defined (ACE_VXWORKS) && !defined (__RTP__) 00168 MODULE* handle = 0; 00169 // Open readonly 00170 ACE_HANDLE filehandle = ACE_OS::open (fname, 00171 O_RDONLY, 00172 ACE_DEFAULT_FILE_PERMS); 00173 00174 if (filehandle != ACE_INVALID_HANDLE) 00175 { 00176 ACE_OS::last_error(0); 00177 ACE_OSCALL ( ::loadModule (filehandle, LOAD_GLOBAL_SYMBOLS|LOAD_COMMON_MATCH_ALL ), MODULE *, 0, handle); 00178 int loaderror = ACE_OS::last_error(); 00179 ACE_OS::close (filehandle); 00180 00181 if ( (loaderror != 0) && (handle != 0) ) 00182 { 00183 // ouch something went wrong most likely unresolved externals 00184 if (handle) 00185 ::unldByModuleId ( handle, 0 ); 00186 handle = 0; 00187 } 00188 } 00189 else 00190 { 00191 // couldn't open file 00192 handle = 0; 00193 } 00194 return handle; 00195 # else 00196 ACE_UNUSED_ARG (fname); 00197 ACE_UNUSED_ARG (mode); 00198 ACE_NOTSUP_RETURN (0); 00199 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00200 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::dlsym | ( | ACE_SHLIB_HANDLE | handle, | |
const ACE_TCHAR * | symbol | |||
) |
Definition at line 203 of file OS_NS_dlfcn.inl.
References ACE_NEW_RETURN, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SHLIB_INVALID_HANDLE, dlsym(), strcpy(), and strlen().
Referenced by dlclose(), dlopen(), dlsym(), ACE_DLL_Strategy< SVC_HANDLER >::make_svc_handler(), and ACE_DLL_Handle::symbol().
00205 { 00206 ACE_OS_TRACE ("ACE_OS::dlsym"); 00207 00208 #if defined (ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE) 00209 // Check if the handle is valid before making any calls using it. 00210 if (handle == ACE_SHLIB_INVALID_HANDLE) 00211 return 0; 00212 #endif /* ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE */ 00213 00214 // Get the correct OS type. 00215 #if defined (ACE_HAS_WINCE) 00216 // CE (at least thru Pocket PC 2003) offers GetProcAddressW, not ...A, so 00217 // we always need a wide-char string. 00218 const wchar_t *symbolname = 0; 00219 # if defined (ACE_USES_WCHAR) 00220 symbolname = sname; 00221 # else 00222 ACE_Ascii_To_Wide sname_xlate (sname); 00223 symbolname = sname_xlate.wchar_rep (); 00224 # endif /* ACE_USES_WCHAR */ 00225 #elif defined (ACE_USES_WCHAR) 00226 // WinCE is WCHAR always; other platforms need a char * symbol name 00227 ACE_Wide_To_Ascii w_sname (sname); 00228 char *symbolname = w_sname.char_rep (); 00229 #elif defined (ACE_VXWORKS) 00230 char *symbolname = const_cast<char *> (sname); 00231 #else 00232 const char *symbolname = sname; 00233 #endif /* ACE_HAS_WINCE */ 00234 00235 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00236 00237 # if defined (ACE_USES_ASM_SYMBOL_IN_DLSYM) 00238 int l = ACE_OS::strlen (symbolname) + 2; 00239 char *asm_symbolname = 0; 00240 ACE_NEW_RETURN (asm_symbolname, char[l], 0); 00241 ACE_OS::strcpy (asm_symbolname, "_") ; 00242 ACE_OS::strcpy (asm_symbolname + 1, symbolname) ; 00243 void *ace_result; 00244 ACE_OSCALL (::dlsym (handle, asm_symbolname), void *, 0, ace_result); 00245 delete [] asm_symbolname; 00246 return ace_result; 00247 # elif defined (_M_UNIX) 00248 ACE_OSCALL_RETURN (::_dlsym (handle, symbolname), void *, 0); 00249 # else 00250 ACE_OSCALL_RETURN (::dlsym (handle, symbolname), void *, 0); 00251 # endif /* ACE_USES_ASM_SYMBOL_IN_DLSYM */ 00252 00253 # elif defined (ACE_WIN32) 00254 00255 ACE_WIN32CALL_RETURN (::GetProcAddress (handle, symbolname), void *, 0); 00256 00257 # elif defined (__hpux) 00258 00259 void *value = 0; 00260 int status; 00261 shl_t _handle = handle; 00262 ACE_OSCALL (::shl_findsym(&_handle, symbolname, TYPE_UNDEFINED, &value), int, -1, status); 00263 return status == 0 ? value : 0; 00264 00265 # elif defined (ACE_VXWORKS) && !defined (__RTP__) 00266 00267 // For now we use the VxWorks global symbol table 00268 // which resolves the most recently loaded symbols .. which resolve mostly what we want.. 00269 ACE_UNUSED_ARG (handle); 00270 SYM_TYPE symtype; 00271 char *value = 0; 00272 STATUS status; 00273 ACE_OSCALL (::symFindByName(sysSymTbl, symbolname, &value, &symtype), int, -1, status); 00274 00275 return status == OK ? reinterpret_cast <void*>(value) : 0; 00276 00277 # else 00278 00279 ACE_UNUSED_ARG (handle); 00280 ACE_UNUSED_ARG (symbolname); 00281 ACE_NOTSUP_RETURN (0); 00282 00283 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00284 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::dlclose | ( | ACE_SHLIB_HANDLE | handle | ) |
Definition at line 26 of file OS_NS_dlfcn.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT, dlclose(), and dlsym().
Referenced by ACE_DLL_Handle::close(), dlclose(), and dlopen().
00027 { 00028 ACE_OS_TRACE ("ACE_OS::dlclose"); 00029 #if defined (ACE_LACKS_DLCLOSE) 00030 ACE_UNUSED_ARG (handle); 00031 return 0; 00032 #elif defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00033 00034 # if !defined (ACE_HAS_AUTOMATIC_INIT_FINI) 00035 // SunOS4 does not automatically call _fini()! 00036 void *ptr; 00037 00038 ACE_OSCALL (::dlsym (handle, ACE_TEXT ("_fini")), void *, 0, ptr); 00039 00040 if (ptr != 0) 00041 (*((int (*)(void)) ptr)) (); // Call _fini hook explicitly. 00042 # endif /* ACE_HAS_AUTOMATIC_INIT_FINI */ 00043 #if defined (_M_UNIX) 00044 ACE_OSCALL_RETURN (::_dlclose (handle), int, -1); 00045 #else /* _MUNIX */ 00046 ACE_OSCALL_RETURN (::dlclose (handle), int, -1); 00047 #endif /* _M_UNIX */ 00048 #elif defined (ACE_WIN32) 00049 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::FreeLibrary (handle), ace_result_), int, -1); 00050 #elif defined (__hpux) 00051 // HP-UX 10.x and 32-bit 11.00 do not pay attention to the ref count 00052 // when unloading a dynamic lib. So, if the ref count is more than 00053 // 1, do not unload the lib. This will cause a library loaded more 00054 // than once to not be unloaded until the process runs down, but 00055 // that's life. It's better than unloading a library that's in use. 00056 // So far as I know, there's no way to decrement the refcnt that the 00057 // kernel is looking at - the shl_descriptor is a copy of what the 00058 // kernel has, not the actual struct. On 64-bit HP-UX using dlopen, 00059 // this problem has been fixed. 00060 struct shl_descriptor desc; 00061 if (shl_gethandle_r (handle, &desc) == -1) 00062 return -1; 00063 if (desc.ref_count > 1) 00064 return 0; 00065 # if defined(__GNUC__) || __cplusplus >= 199707L 00066 ACE_OSCALL_RETURN (::shl_unload (handle), int, -1); 00067 # else 00068 ACE_OSCALL_RETURN (::cxxshl_unload (handle), int, -1); 00069 # endif /* aC++ vs. Hp C++ */ 00070 #else 00071 ACE_UNUSED_ARG (handle); 00072 ACE_NOTSUP_RETURN (-1); 00073 #endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00074 }
ACE_INLINE ACE_TCHAR* ACE_OS::dlerror | ( | void | ) |
Definition at line 77 of file OS_NS_dlfcn.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT_CHAR_TO_TCHAR, dlerror(), sprintf(), strerror(), and strncpy().
Referenced by dlerror(), ACE_DLL::error(), and ACE_DLL_Handle::error().
00078 { 00079 ACE_OS_TRACE ("ACE_OS::dlerror"); 00080 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00081 const char *err; 00082 # if defined(_M_UNIX) 00083 ACE_OSCALL (::_dlerror (), const char *, 0, err); 00084 # else /* _M_UNIX */ 00085 ACE_OSCALL (::dlerror (), const char *, 0, err); 00086 # endif /* _M_UNIX */ 00087 if (err == 0) 00088 return 0; 00089 # if defined (ACE_USES_WCHAR) 00090 const size_t BufLen = 256; 00091 static wchar_t buf[BufLen]; 00092 ACE_OS::strncpy (buf, ACE_TEXT_CHAR_TO_TCHAR (err), BufLen); 00093 return buf; 00094 # else 00095 return const_cast <char *> (err); 00096 # endif /* ACE_USES_WCHAR */ 00097 # elif defined (__hpux) || defined (ACE_VXWORKS) 00098 //FUZZ: disable check_for_lack_ACE_OS 00099 ACE_OSCALL_RETURN (::strerror(errno), char *, 0); 00100 //FUZZ: enable check_for_lack_ACE_OS 00101 # elif defined (ACE_WIN32) 00102 static ACE_TCHAR buf[128]; 00103 # if defined (ACE_HAS_PHARLAP) 00104 ACE_OS::sprintf (buf, "error code %d", GetLastError()); 00105 # else 00106 ACE_TEXT_FormatMessage (FORMAT_MESSAGE_FROM_SYSTEM, 00107 0, 00108 ::GetLastError (), 00109 0, 00110 buf, 00111 sizeof buf / sizeof buf[0], 00112 0); 00113 # endif /* ACE_HAS_PHARLAP */ 00114 return buf; 00115 # else 00116 ACE_NOTSUP_RETURN (0); 00117 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00118 }
ACE_INLINE ACE_SHLIB_HANDLE ACE_OS::dlopen | ( | const ACE_TCHAR * | fname, | |
int | mode | |||
) |
Definition at line 121 of file OS_NS_dlfcn.inl.
References ACE_DEFAULT_FILE_PERMS, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, close(), dlclose(), dlopen(), dlsym(), last_error(), and open().
Referenced by dlopen(), ACE_DLL_Strategy< SVC_HANDLER >::make_svc_handler(), and ACE_DLL_Handle::open().
00123 { 00124 ACE_OS_TRACE ("ACE_OS::dlopen"); 00125 00126 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00127 void *handle; 00128 # if defined (ACE_HAS_SGIDLADD) 00129 ACE_OSCALL 00130 (::sgidladd (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00131 # elif defined (_M_UNIX) 00132 ACE_OSCALL 00133 (::_dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00134 # else 00135 ACE_OSCALL 00136 (::dlopen (ACE_TEXT_ALWAYS_CHAR (fname), mode), void *, 0, handle); 00137 # endif /* ACE_HAS_SGIDLADD */ 00138 # if !defined (ACE_HAS_AUTOMATIC_INIT_FINI) 00139 if (handle != 0) 00140 { 00141 void *ptr; 00142 // Some systems (e.g., SunOS4) do not automatically call _init(), so 00143 // we'll have to call it manually. 00144 00145 ACE_OSCALL (::dlsym (handle, ACE_TEXT ("_init")), void *, 0, ptr); 00146 00147 if (ptr != 0 && (*((int (*)(void)) ptr)) () == -1) // Call _init hook explicitly. 00148 { 00149 // Close down the handle to prevent leaks. 00150 ::dlclose (handle); 00151 return 0; 00152 } 00153 } 00154 # endif /* ACE_HAS_AUTOMATIC_INIT_FINI */ 00155 return handle; 00156 # elif defined (ACE_WIN32) 00157 ACE_UNUSED_ARG (mode); 00158 00159 ACE_WIN32CALL_RETURN (ACE_TEXT_LoadLibrary (fname), ACE_SHLIB_HANDLE, 0); 00160 # elif defined (__hpux) 00161 00162 # if defined(__GNUC__) || __cplusplus >= 199707L 00163 ACE_OSCALL_RETURN (::shl_load(fname, mode, 0L), ACE_SHLIB_HANDLE, 0); 00164 # else 00165 ACE_OSCALL_RETURN (::cxxshl_load(fname, mode, 0L), ACE_SHLIB_HANDLE, 0); 00166 # endif /* aC++ vs. Hp C++ */ 00167 # elif defined (ACE_VXWORKS) && !defined (__RTP__) 00168 MODULE* handle = 0; 00169 // Open readonly 00170 ACE_HANDLE filehandle = ACE_OS::open (fname, 00171 O_RDONLY, 00172 ACE_DEFAULT_FILE_PERMS); 00173 00174 if (filehandle != ACE_INVALID_HANDLE) 00175 { 00176 ACE_OS::last_error(0); 00177 ACE_OSCALL ( ::loadModule (filehandle, LOAD_GLOBAL_SYMBOLS|LOAD_COMMON_MATCH_ALL ), MODULE *, 0, handle); 00178 int loaderror = ACE_OS::last_error(); 00179 ACE_OS::close (filehandle); 00180 00181 if ( (loaderror != 0) && (handle != 0) ) 00182 { 00183 // ouch something went wrong most likely unresolved externals 00184 if (handle) 00185 ::unldByModuleId ( handle, 0 ); 00186 handle = 0; 00187 } 00188 } 00189 else 00190 { 00191 // couldn't open file 00192 handle = 0; 00193 } 00194 return handle; 00195 # else 00196 ACE_UNUSED_ARG (fname); 00197 ACE_UNUSED_ARG (mode); 00198 ACE_NOTSUP_RETURN (0); 00199 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00200 }
ACE_INLINE void* ACE_OS::dlsym | ( | ACE_SHLIB_HANDLE | handle, | |
const ACE_TCHAR * | sname | |||
) |
Definition at line 203 of file OS_NS_dlfcn.inl.
References ACE_NEW_RETURN, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SHLIB_INVALID_HANDLE, dlsym(), strcpy(), and strlen().
Referenced by dlclose(), dlopen(), dlsym(), ACE_DLL_Strategy< SVC_HANDLER >::make_svc_handler(), and ACE_DLL_Handle::symbol().
00205 { 00206 ACE_OS_TRACE ("ACE_OS::dlsym"); 00207 00208 #if defined (ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE) 00209 // Check if the handle is valid before making any calls using it. 00210 if (handle == ACE_SHLIB_INVALID_HANDLE) 00211 return 0; 00212 #endif /* ACE_HAS_DLSYM_SEGFAULT_ON_INVALID_HANDLE */ 00213 00214 // Get the correct OS type. 00215 #if defined (ACE_HAS_WINCE) 00216 // CE (at least thru Pocket PC 2003) offers GetProcAddressW, not ...A, so 00217 // we always need a wide-char string. 00218 const wchar_t *symbolname = 0; 00219 # if defined (ACE_USES_WCHAR) 00220 symbolname = sname; 00221 # else 00222 ACE_Ascii_To_Wide sname_xlate (sname); 00223 symbolname = sname_xlate.wchar_rep (); 00224 # endif /* ACE_USES_WCHAR */ 00225 #elif defined (ACE_USES_WCHAR) 00226 // WinCE is WCHAR always; other platforms need a char * symbol name 00227 ACE_Wide_To_Ascii w_sname (sname); 00228 char *symbolname = w_sname.char_rep (); 00229 #elif defined (ACE_VXWORKS) 00230 char *symbolname = const_cast<char *> (sname); 00231 #else 00232 const char *symbolname = sname; 00233 #endif /* ACE_HAS_WINCE */ 00234 00235 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING) 00236 00237 # if defined (ACE_USES_ASM_SYMBOL_IN_DLSYM) 00238 int l = ACE_OS::strlen (symbolname) + 2; 00239 char *asm_symbolname = 0; 00240 ACE_NEW_RETURN (asm_symbolname, char[l], 0); 00241 ACE_OS::strcpy (asm_symbolname, "_") ; 00242 ACE_OS::strcpy (asm_symbolname + 1, symbolname) ; 00243 void *ace_result; 00244 ACE_OSCALL (::dlsym (handle, asm_symbolname), void *, 0, ace_result); 00245 delete [] asm_symbolname; 00246 return ace_result; 00247 # elif defined (_M_UNIX) 00248 ACE_OSCALL_RETURN (::_dlsym (handle, symbolname), void *, 0); 00249 # else 00250 ACE_OSCALL_RETURN (::dlsym (handle, symbolname), void *, 0); 00251 # endif /* ACE_USES_ASM_SYMBOL_IN_DLSYM */ 00252 00253 # elif defined (ACE_WIN32) 00254 00255 ACE_WIN32CALL_RETURN (::GetProcAddress (handle, symbolname), void *, 0); 00256 00257 # elif defined (__hpux) 00258 00259 void *value = 0; 00260 int status; 00261 shl_t _handle = handle; 00262 ACE_OSCALL (::shl_findsym(&_handle, symbolname, TYPE_UNDEFINED, &value), int, -1, status); 00263 return status == 0 ? value : 0; 00264 00265 # elif defined (ACE_VXWORKS) && !defined (__RTP__) 00266 00267 // For now we use the VxWorks global symbol table 00268 // which resolves the most recently loaded symbols .. which resolve mostly what we want.. 00269 ACE_UNUSED_ARG (handle); 00270 SYM_TYPE symtype; 00271 char *value = 0; 00272 STATUS status; 00273 ACE_OSCALL (::symFindByName(sysSymTbl, symbolname, &value, &symtype), int, -1, status); 00274 00275 return status == OK ? reinterpret_cast <void*>(value) : 0; 00276 00277 # else 00278 00279 ACE_UNUSED_ARG (handle); 00280 ACE_UNUSED_ARG (symbolname); 00281 ACE_NOTSUP_RETURN (0); 00282 00283 # endif /* ACE_HAS_SVR4_DYNAMIC_LINKING */ 00284 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::last_error | ( | void | ) |
Definition at line 10 of file OS_NS_errno.inl.
Referenced by ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::connect_i(), dlopen(), ACE_Service_Repository::insert(), ACE_Log_Msg::last_error_adapter(), ACE_Service_Gestalt::process_directives_i(), set_scheduling_params(), and t_getname().
00011 { 00012 // ACE_OS_TRACE ("ACE_OS::last_error"); 00013 00014 #if defined (ACE_WIN32) 00015 // ACE_OS::last_error() prefers errnor since started out as a way to 00016 // avoid directly accessing errno in ACE code - particularly the ACE 00017 // C++ socket wrapper facades. On Windows, some things that would 00018 // use errno on UNIX require ::GetLastError(), so this method tries 00019 // to shield the rest of ACE from having to know about this. 00020 int lerror = ::GetLastError (); 00021 int lerrno = errno; 00022 return lerrno == 0 ? lerror : lerrno; 00023 #else 00024 return errno; 00025 #endif /* ACE_WIN32 */ 00026 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::last_error | ( | int | error | ) |
Definition at line 29 of file OS_NS_errno.inl.
References ACE_OS_TRACE.
00030 { 00031 ACE_OS_TRACE ("ACE_OS::last_error"); 00032 #if defined (ACE_WIN32) 00033 ::SetLastError (error); 00034 #endif /* ACE_WIN32 */ 00035 errno = error; 00036 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::set_errno_to_last_error | ( | void | ) |
Definition at line 39 of file OS_NS_errno.inl.
Referenced by ACE_TTY_IO::control(), event_timedwait(), event_wait(), filesize(), fstat(), mutex_init(), mutex_lock(), mutex_trylock(), pwrite(), sched_params(), sema_trywait(), sema_wait(), stat(), ACE_Process::wait(), and waitpid().
00040 { 00041 # if defined (ACE_WIN32) 00042 return errno = ::GetLastError (); 00043 #else 00044 return errno; 00045 # endif /* defined(ACE_WIN32) */ 00046 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::set_errno_to_wsa_last_error | ( | void | ) |
Definition at line 49 of file OS_NS_errno.inl.
Referenced by ACE_INET_Addr::get_host_addr(), recvfrom(), recvmsg(), recvv(), ACE_SPIPE_Stream::send_handle(), sendmsg(), sendto(), and sendv().
00050 { 00051 # if defined (ACE_WIN32) 00052 return errno = ::WSAGetLastError (); 00053 #else 00054 return errno; 00055 # endif /* defined(ACE_WIN32) */ 00056 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::last_error | ( | void | ) |
Definition at line 10 of file OS_NS_errno.inl.
00011 { 00012 // ACE_OS_TRACE ("ACE_OS::last_error"); 00013 00014 #if defined (ACE_WIN32) 00015 // ACE_OS::last_error() prefers errnor since started out as a way to 00016 // avoid directly accessing errno in ACE code - particularly the ACE 00017 // C++ socket wrapper facades. On Windows, some things that would 00018 // use errno on UNIX require ::GetLastError(), so this method tries 00019 // to shield the rest of ACE from having to know about this. 00020 int lerror = ::GetLastError (); 00021 int lerrno = errno; 00022 return lerrno == 0 ? lerror : lerrno; 00023 #else 00024 return errno; 00025 #endif /* ACE_WIN32 */ 00026 }
ACE_INLINE void ACE_OS::last_error | ( | int | error | ) |
Definition at line 29 of file OS_NS_errno.inl.
References ACE_OS_TRACE.
00030 { 00031 ACE_OS_TRACE ("ACE_OS::last_error"); 00032 #if defined (ACE_WIN32) 00033 ::SetLastError (error); 00034 #endif /* ACE_WIN32 */ 00035 errno = error; 00036 }
ACE_INLINE int ACE_OS::set_errno_to_last_error | ( | void | ) |
Definition at line 39 of file OS_NS_errno.inl.
Referenced by ACE_TTY_IO::control(), event_timedwait(), event_wait(), filesize(), fstat(), mutex_init(), mutex_lock(), mutex_trylock(), pwrite(), sched_params(), sema_trywait(), sema_wait(), stat(), ACE_Process::wait(), and waitpid().
00040 { 00041 # if defined (ACE_WIN32) 00042 return errno = ::GetLastError (); 00043 #else 00044 return errno; 00045 # endif /* defined(ACE_WIN32) */ 00046 }
ACE_INLINE int ACE_OS::set_errno_to_wsa_last_error | ( | void | ) |
Definition at line 49 of file OS_NS_errno.inl.
Referenced by ACE_INET_Addr::get_host_addr(), recvfrom(), recvmsg(), recvv(), ACE_SPIPE_Stream::send_handle(), sendmsg(), sendto(), and sendv().
00050 { 00051 # if defined (ACE_WIN32) 00052 return errno = ::WSAGetLastError (); 00053 #else 00054 return errno; 00055 # endif /* defined(ACE_WIN32) */ 00056 }
ACE_Export ACE_HANDLE ACE_OS::open | ( | const char * | filename, | |
int | mode, | |||
mode_t | perms = ACE_DEFAULT_OPEN_PERMS , |
|||
LPSECURITY_ATTRIBUTES | sa = 0 | |||
) |
The O_APPEND flag is only partly supported on Win32. If you specify O_APPEND, then the file pointer will be positioned at the end of the file initially during open, but it is not re-positioned at the end prior to each write, as specified by POSIX. This is generally good enough for typical situations, but it is ``not quite right'' in its semantics.
Definition at line 19 of file OS_NS_fcntl.cpp.
References access(), ACE_BIT_ENABLED, ACE_DEV_NULL, ACE_END_VERSIONED_NAMESPACE_DECL, ACE_OS_TRACE, FILE_FLAG_OVERLAPPED, FILE_FLAG_SEQUENTIAL_SCAN, FILE_FLAG_WRITE_THROUGH, GENERIC_READ, LPSECURITY_ATTRIBUTES, OPEN_EXISTING, ACE_OS_Object_Manager::preallocated_object, strcmp(), thread_mutex_lock(), and thread_mutex_unlock().
Referenced by ACE_Filecache_Object::ACE_Filecache_Object(), ACE_SPIPE_Connector::connect(), ACE_Handle_Gobbler::consume_handles(), creat(), dlopen(), filesize(), flock_init(), ACE::get_handle(), ACE::handle_timed_open(), ACE_DLL_Strategy< SVC_HANDLER >::open(), ACE_Mem_Map::open(), ACE_FIFO_Recv::open(), ACE_FIFO::open(), ACE_Active_Map_Manager< T >::open(), ACE_Strategy_Acceptor< SVC_HANDLER, >::open(), ACE::open_temp_file(), ACE_Filecache_Object::release(), sema_init(), shm_open(), and truncate().
00023 { 00024 ACE_OS_TRACE ("ACE_OS::open"); 00025 00026 #if defined (ACE_WIN32) 00027 DWORD access = GENERIC_READ; 00028 if (ACE_BIT_ENABLED (mode, O_WRONLY)) 00029 access = GENERIC_WRITE; 00030 else if (ACE_BIT_ENABLED (mode, O_RDWR)) 00031 access = GENERIC_READ | GENERIC_WRITE; 00032 00033 DWORD creation = OPEN_EXISTING; 00034 00035 if ((mode & (_O_CREAT | _O_EXCL)) == (_O_CREAT | _O_EXCL)) 00036 creation = CREATE_NEW; 00037 else if ((mode & (_O_CREAT | _O_TRUNC)) == (_O_CREAT | _O_TRUNC)) 00038 creation = CREATE_ALWAYS; 00039 else if (ACE_BIT_ENABLED (mode, _O_CREAT)) 00040 creation = OPEN_ALWAYS; 00041 else if (ACE_BIT_ENABLED (mode, _O_TRUNC)) 00042 creation = TRUNCATE_EXISTING; 00043 00044 DWORD flags = 0; 00045 00046 if (ACE_BIT_ENABLED (mode, _O_TEMPORARY)) 00047 flags |= FILE_FLAG_DELETE_ON_CLOSE | FILE_ATTRIBUTE_TEMPORARY; 00048 00049 if (ACE_BIT_ENABLED (mode, FILE_FLAG_WRITE_THROUGH)) 00050 flags |= FILE_FLAG_WRITE_THROUGH; 00051 if (ACE_BIT_ENABLED (mode, FILE_FLAG_OVERLAPPED)) 00052 flags |= FILE_FLAG_OVERLAPPED; 00053 if (ACE_BIT_ENABLED (mode, FILE_FLAG_NO_BUFFERING)) 00054 flags |= FILE_FLAG_NO_BUFFERING; 00055 if (ACE_BIT_ENABLED (mode, FILE_FLAG_RANDOM_ACCESS)) 00056 flags |= FILE_FLAG_RANDOM_ACCESS; 00057 if (ACE_BIT_ENABLED (mode, FILE_FLAG_SEQUENTIAL_SCAN)) 00058 flags |= FILE_FLAG_SEQUENTIAL_SCAN; 00059 if (ACE_BIT_ENABLED (mode, FILE_FLAG_DELETE_ON_CLOSE)) 00060 flags |= FILE_FLAG_DELETE_ON_CLOSE; 00061 if (ACE_BIT_ENABLED (mode, FILE_FLAG_BACKUP_SEMANTICS)) 00062 flags |= FILE_FLAG_BACKUP_SEMANTICS; 00063 if (ACE_BIT_ENABLED (mode, FILE_FLAG_POSIX_SEMANTICS)) 00064 flags |= FILE_FLAG_POSIX_SEMANTICS; 00065 00066 ACE_MT (ACE_thread_mutex_t *ace_os_monitor_lock = 0;) 00067 00068 if (ACE_BIT_ENABLED (mode, _O_APPEND)) 00069 { 00070 ACE_MT 00071 ( 00072 ace_os_monitor_lock = static_cast <ACE_thread_mutex_t *> ( 00073 ACE_OS_Object_Manager::preallocated_object[ 00074 ACE_OS_Object_Manager::ACE_OS_MONITOR_LOCK]); 00075 ACE_OS::thread_mutex_lock (ace_os_monitor_lock); 00076 ) 00077 } 00078 00079 DWORD shared_mode = perms; 00080 SECURITY_ATTRIBUTES sa_buffer; 00081 SECURITY_DESCRIPTOR sd_buffer; 00082 00083 #if defined (ACE_HAS_WINCE) 00084 ACE_HANDLE h = ::CreateFileW (ACE_Ascii_To_Wide (filename).wchar_rep (), 00085 access, 00086 shared_mode, 00087 ACE_OS::default_win32_security_attributes_r 00088 (sa, &sa_buffer, &sd_buffer), 00089 creation, 00090 flags, 00091 0); 00092 #else /* ACE_HAS_WINCE */ 00093 ACE_HANDLE h = ::CreateFileA (filename, 00094 access, 00095 shared_mode, 00096 ACE_OS::default_win32_security_attributes_r 00097 (sa, &sa_buffer, &sd_buffer), 00098 creation, 00099 flags, 00100 0); 00101 #endif /* ACE_HAS_WINCE */ 00102 00103 if (ACE_BIT_ENABLED (mode, _O_APPEND)) 00104 { 00105 LONG high_size = 0; 00106 if (h != ACE_INVALID_HANDLE 00107 && ::SetFilePointer (h, 00108 0, 00109 &high_size, 00110 FILE_END) == INVALID_SET_FILE_POINTER 00111 && GetLastError () != NO_ERROR) 00112 { 00113 ACE_MT (ACE_OS::thread_mutex_unlock (ace_os_monitor_lock);) 00114 ACE_FAIL_RETURN (ACE_INVALID_HANDLE); 00115 } 00116 00117 ACE_MT (ACE_OS::thread_mutex_unlock (ace_os_monitor_lock);) 00118 } 00119 00120 if (h == ACE_INVALID_HANDLE) 00121 ACE_FAIL_RETURN (h); 00122 else 00123 return h; 00124 #elif defined (INTEGRITY) 00125 ACE_UNUSED_ARG (sa); 00126 if(!strcmp(filename,ACE_DEV_NULL)) { 00127 ACE_OSCALL_RETURN (::AllocateNullConsoleDescriptor(), ACE_HANDLE, -1); 00128 } 00129 else { 00130 ACE_OSCALL_RETURN (::open (filename, mode, perms), ACE_HANDLE, -1); 00131 } 00132 #else 00133 ACE_UNUSED_ARG (sa); 00134 ACE_OSCALL_RETURN (::open (filename, mode, perms), ACE_HANDLE, ACE_INVALID_HANDLE); 00135 #endif /* ACE_WIN32 */ 00136 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fcntl | ( | ACE_HANDLE | handle, | |
int | cmd, | |||
long | arg = 0 | |||
) |
Definition at line 10 of file OS_NS_fcntl.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fcntl().
Referenced by ACE::clr_flags(), ACE_IPC_SAP::disable(), ACE_IO_SAP::disable(), ACE_IPC_SAP::enable(), ACE_IO_SAP::enable(), fcntl(), flock_rdlock(), flock_tryrdlock(), flock_trywrlock(), flock_unlock(), flock_wrlock(), ACE::get_flags(), ACE_Select_Reactor_Notify::open(), sema_init(), sema_trywait(), and ACE::set_flags().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::fcntl"); 00013 # if defined (ACE_LACKS_FCNTL) 00014 ACE_UNUSED_ARG (handle); 00015 ACE_UNUSED_ARG (cmd); 00016 ACE_UNUSED_ARG (arg); 00017 ACE_NOTSUP_RETURN (-1); 00018 # else 00019 ACE_OSCALL_RETURN (::fcntl (handle, cmd, arg), int, -1); 00020 # endif /* ACE_LACKS_FCNTL */ 00021 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::fcntl | ( | ACE_HANDLE | handle, | |
int | cmd, | |||
long | arg | |||
) |
Definition at line 10 of file OS_NS_fcntl.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fcntl().
Referenced by ACE::clr_flags(), ACE_IO_SAP::disable(), ACE_IPC_SAP::disable(), ACE_IO_SAP::enable(), ACE_IPC_SAP::enable(), fcntl(), flock_rdlock(), flock_tryrdlock(), flock_trywrlock(), flock_unlock(), flock_wrlock(), ACE::get_flags(), ACE_Select_Reactor_Notify::open(), sema_init(), sema_trywait(), and ACE::set_flags().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::fcntl"); 00013 # if defined (ACE_LACKS_FCNTL) 00014 ACE_UNUSED_ARG (handle); 00015 ACE_UNUSED_ARG (cmd); 00016 ACE_UNUSED_ARG (arg); 00017 ACE_NOTSUP_RETURN (-1); 00018 # else 00019 ACE_OSCALL_RETURN (::fcntl (handle, cmd, arg), int, -1); 00020 # endif /* ACE_LACKS_FCNTL */ 00021 }
ACE_INLINE double ACE_OS::floor | ( | double | x | ) |
This method computes the largest integral value not greater than x.
Definition at line 10 of file OS_NS_math.inl.
Referenced by ACE_Stats::square_root().
00011 { 00012 // This method computes the largest integral value not greater than x. 00013 if(x > 0) 00014 return static_cast<long> (x); 00015 else if (static_cast<long> (x) == x) 00016 return x; 00017 else 00018 return static_cast<long>(x) - 1; 00019 }
ACE_INLINE double ACE_OS::ceil | ( | double | x | ) |
This method computes the smallest integral value not less than x.
Definition at line 22 of file OS_NS_math.inl.
00023 { 00024 // This method computes the smallest integral value not less than x. 00025 if (x < 0) 00026 return static_cast<long> (x); 00027 else if (static_cast<long> (x) == x) 00028 return x; 00029 else 00030 return static_cast<long> (x) + 1; 00031 }
ACE_INLINE double ACE_OS::log2 | ( | double | x | ) |
This method computes the base-2 logarithm of x.
Definition at line 34 of file OS_NS_math.inl.
References ace_log2_helper().
00035 { 00036 return ace_log2_helper (x); 00037 }
ACE_Export int ACE_OS::getmacaddress | ( | struct macaddr_node_t * | node | ) |
Definition at line 219 of file OS_NS_netdb.cpp.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, AF_INET, close(), gethostbyname(), hostname(), ioctl(), MAXHOSTNAMELEN, memcpy(), memset(), ACE_OS::macaddr_node_t::node, PF_INET, SOCK_DGRAM, socket(), sprintf(), and strcpy().
Referenced by ACE_Utils::UUID_Generator::init().
00220 { 00221 ACE_OS_TRACE ("ACE_OS::getmacaddress"); 00222 00223 #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) 00224 # if !defined (ACE_HAS_PHARLAP) 00225 /** Define a structure for use with the netbios routine */ 00226 struct ADAPTERSTAT 00227 { 00228 ADAPTER_STATUS adapt; 00229 NAME_BUFFER NameBuff [30]; 00230 }; 00231 00232 NCB ncb; 00233 LANA_ENUM lenum; 00234 unsigned char result; 00235 00236 ACE_OS::memset (&ncb, 0, sizeof(ncb)); 00237 ncb.ncb_command = NCBENUM; 00238 ncb.ncb_buffer = reinterpret_cast<unsigned char*> (&lenum); 00239 ncb.ncb_length = sizeof(lenum); 00240 00241 result = Netbios (&ncb); 00242 00243 for(int i = 0; i < lenum.length; i++) 00244 { 00245 ACE_OS::memset (&ncb, 0, sizeof(ncb)); 00246 ncb.ncb_command = NCBRESET; 00247 ncb.ncb_lana_num = lenum.lana [i]; 00248 00249 /** Reset the netbios */ 00250 result = Netbios (&ncb); 00251 00252 if (ncb.ncb_retcode != NRC_GOODRET) 00253 { 00254 return -1; 00255 } 00256 00257 ADAPTERSTAT adapter; 00258 ACE_OS::memset (&ncb, 0, sizeof (ncb)); 00259 ACE_OS::strcpy (reinterpret_cast<char*> (ncb.ncb_callname), "*"); 00260 ncb.ncb_command = NCBASTAT; 00261 ncb.ncb_lana_num = lenum.lana[i]; 00262 ncb.ncb_buffer = reinterpret_cast<unsigned char*> (&adapter); 00263 ncb.ncb_length = sizeof (adapter); 00264 00265 result = Netbios (&ncb); 00266 00267 if (result == 0) 00268 { 00269 ACE_OS::memcpy (node->node, 00270 adapter.adapt.adapter_address, 00271 6); 00272 return 0; 00273 } 00274 } 00275 return 0; 00276 # else 00277 # if defined (ACE_HAS_PHARLAP_RT) 00278 DEVHANDLE ip_dev = (DEVHANDLE)0; 00279 EK_TCPIPCFG *devp; 00280 size_t i; 00281 ACE_TCHAR dev_name[16]; 00282 00283 for (i = 0; i < 10; i++) 00284 { 00285 // Ethernet. 00286 ACE_OS::sprintf (dev_name, 00287 "ether%d", 00288 i); 00289 ip_dev = EtsTCPGetDeviceHandle (dev_name); 00290 if (ip_dev != 0) 00291 break; 00292 } 00293 if (ip_dev == 0) 00294 return -1; 00295 devp = EtsTCPGetDeviceCfg (ip_dev); 00296 if (devp == 0) 00297 return -1; 00298 ACE_OS::memcpy (node->node, 00299 &devp->EthernetAddress[0], 00300 6); 00301 return 0; 00302 # else 00303 ACE_UNUSED_ARG (node); 00304 ACE_NOTSUP_RETURN (-1); 00305 # endif /* ACE_HAS_PHARLAP_RT */ 00306 # endif /* ACE_HAS_PHARLAP */ 00307 #elif defined (sun) 00308 00309 /** obtain the local host name */ 00310 char hostname [MAXHOSTNAMELEN]; 00311 ACE_OS::hostname (hostname, sizeof (hostname)); 00312 00313 /** Get the hostent to use with ioctl */ 00314 struct hostent *phost = 00315 ACE_OS::gethostbyname (hostname); 00316 00317 if (phost == 0) 00318 return -1; 00319 00320 ACE_HANDLE handle = 00321 ACE_OS::socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP); 00322 00323 if (handle == ACE_INVALID_HANDLE) 00324 return -1; 00325 00326 char **paddrs = phost->h_addr_list; 00327 00328 struct arpreq ar; 00329 00330 struct sockaddr_in *psa = 00331 (struct sockaddr_in *)&(ar.arp_pa); 00332 00333 ACE_OS::memset (&ar, 00334 0, 00335 sizeof (struct arpreq)); 00336 00337 psa->sin_family = AF_INET; 00338 00339 ACE_OS::memcpy (&(psa->sin_addr), 00340 *paddrs, 00341 sizeof (struct in_addr)); 00342 00343 if (ACE_OS::ioctl (handle, 00344 SIOCGARP, 00345 &ar) == -1) 00346 { 00347 ACE_OS::close (handle); 00348 return -1; 00349 } 00350 00351 ACE_OS::close (handle); 00352 00353 ACE_OS::memcpy (node->node, 00354 ar.arp_ha.sa_data, 00355 6); 00356 00357 return 0; 00358 00359 #elif defined (linux) && !defined (ACE_LACKS_NETWORKING) 00360 00361 struct ifreq ifr; 00362 00363 ACE_HANDLE handle = 00364 ACE_OS::socket (PF_INET, SOCK_DGRAM, 0); 00365 00366 if (handle == ACE_INVALID_HANDLE) 00367 return -1; 00368 00369 ACE_OS::strcpy (ifr.ifr_name, "eth0"); 00370 00371 if (ACE_OS::ioctl (handle/*s*/, SIOCGIFHWADDR, &ifr) < 0) 00372 { 00373 ACE_OS::close (handle); 00374 return -1; 00375 } 00376 00377 struct sockaddr* sa = 00378 (struct sockaddr *) &ifr.ifr_addr; 00379 00380 ACE_OS::close (handle); 00381 00382 ACE_OS::memcpy (node->node, 00383 sa->sa_data, 00384 6); 00385 00386 return 0; 00387 00388 #else 00389 ACE_UNUSED_ARG (node); 00390 ACE_NOTSUP_RETURN (-1); 00391 #endif 00392 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::gethostbyaddr | ( | const char * | addr, | |
int | length, | |||
int | type | |||
) |
Definition at line 48 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyaddr(), and gethostbyaddr_r().
Referenced by ACE_INET_Addr::get_host_name_i(), gethostbyaddr(), gethostbyaddr_r(), and getipnodebyaddr().
00049 { 00050 ACE_OS_TRACE ("ACE_OS::gethostbyaddr"); 00051 # if defined (ACE_LACKS_GETHOSTBYADDR) 00052 ACE_UNUSED_ARG (addr); 00053 ACE_UNUSED_ARG (length); 00054 ACE_UNUSED_ARG (type); 00055 ACE_NOTSUP_RETURN (0); 00056 # else 00057 00058 if (0 == addr || '\0' == addr[0]) 00059 return 0; 00060 00061 # if defined (ACE_VXWORKS) 00062 // VxWorks 6.x has a gethostbyaddr() that is threadsafe and 00063 // returns an heap-allocated hostentry structure. 00064 // just call ACE_OS::gethostbyaddr_r () which knows how to handle this. 00065 struct hostent hentry; 00066 ACE_HOSTENT_DATA buf; 00067 int h_error; // Not the same as errno! 00068 return ACE_OS::gethostbyaddr_r (addr, length, type, &hentry, buf, &h_error); 00069 # elif defined (ACE_HAS_NONCONST_GETBY) 00070 //FUZZ: disable check_for_lack_ACE_OS 00071 ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), 00072 (ACE_SOCKET_LEN) length, 00073 type), 00074 struct hostent *, 00075 0); 00076 //FUZZ: enable check_for_lack_ACE_OS 00077 # else 00078 //FUZZ: disable check_for_lack_ACE_OS 00079 ACE_SOCKCALL_RETURN (::gethostbyaddr (addr, 00080 (ACE_SOCKET_LEN) length, 00081 type), 00082 struct hostent *, 00083 0); 00084 //FUZZ: enable check_for_lack_ACE_OS 00085 # endif /* ACE_HAS_NONCONST_GETBY */ 00086 # endif /* !ACE_LACKS_GETHOSTBYADDR */ 00087 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::gethostbyaddr_r | ( | const char * | addr, | |
int | length, | |||
int | type, | |||
struct hostent * | result, | |||
ACE_HOSTENT_DATA | buffer, | |||
int * | h_errnop | |||
) |
Definition at line 94 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyaddr(), gethostbyaddr_r(), memcpy(), memset(), strcpy(), and strlen().
Referenced by ACE::get_fqdn(), ACE_INET_Addr::get_host_name_i(), gethostbyaddr(), and gethostbyaddr_r().
00100 { 00101 ACE_OS_TRACE ("ACE_OS::gethostbyaddr_r"); 00102 # if defined (ACE_LACKS_GETHOSTBYADDR_R) 00103 ACE_UNUSED_ARG (addr); 00104 ACE_UNUSED_ARG (length); 00105 ACE_UNUSED_ARG (type); 00106 ACE_UNUSED_ARG (result); 00107 ACE_UNUSED_ARG (buffer); 00108 ACE_UNUSED_ARG (h_errnop); 00109 ACE_NOTSUP_RETURN (0); 00110 # elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00111 00112 if (0 == addr || '\0' == addr[0]) 00113 return 0; 00114 00115 # if defined (AIX) || defined (DIGITAL_UNIX) 00116 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00117 00118 //FUZZ: disable check_for_lack_ACE_OS 00119 if (::gethostbyaddr_r ((char *) addr, length, type, result, 00120 (struct hostent_data *) buffer)== 0) 00121 return result; 00122 //FUZZ: enable check_for_lack_ACE_OS 00123 else 00124 { 00125 *h_errnop = h_errno; 00126 return (struct hostent *) 0; 00127 } 00128 # elif defined (__GLIBC__) 00129 // GNU C library has a different signature 00130 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00131 00132 //FUZZ: disable check_for_lack_ACE_OS 00133 if (::gethostbyaddr_r ((char *) addr, 00134 length, 00135 type, 00136 result, 00137 buffer, 00138 sizeof (ACE_HOSTENT_DATA), 00139 &result, 00140 h_errnop) == 0) 00141 return result; 00142 //FUZZ: enable check_for_lack_ACE_OS 00143 else 00144 return (struct hostent *) 0; 00145 # elif defined (ACE_VXWORKS) 00146 // VxWorks 6.x has a threadsafe gethostbyaddr() which returns a heap-allocated 00147 // data structure which needs to be freed with hostentFree() 00148 //FUZZ: disable check_for_lack_ACE_OS 00149 struct hostent* hp = ::gethostbyaddr (addr, length, type); 00150 //FUZZ: enable check_for_lack_ACE_OS 00151 00152 if (hp) 00153 { 00154 result->h_addrtype = hp->h_addrtype; 00155 result->h_length = hp->h_length; 00156 00157 // buffer layout: 00158 // buffer[0-3]: h_addr_list[0], pointer to the addr. 00159 // buffer[4-7]: h_addr_list[1], null terminator for the h_addr_list. 00160 // buffer[8..(8+h_length)]: the first (and only) addr. 00161 // buffer[(8+h_length)...]: hostname 00162 00163 // Store the address list in buffer. 00164 result->h_addr_list = (char **) buffer; 00165 // Store the actual address _after_ the address list. 00166 result->h_addr_list[0] = (char *) &result->h_addr_list[2]; 00167 ACE_OS::memcpy (result->h_addr_list[0], hp->h_addr_list[0], hp->h_length); 00168 // Null-terminate the list of addresses. 00169 result->h_addr_list[1] = 0; 00170 // And no aliases, so null-terminate h_aliases. 00171 result->h_aliases = &result->h_addr_list[1]; 00172 00173 if (((2*sizeof(char*))+hp->h_length+ACE_OS::strlen (hp->h_name)+1) <= sizeof (ACE_HOSTENT_DATA)) 00174 { 00175 result->h_name = (char *) result->h_addr_list[0] + hp->h_length; 00176 ACE_OS::strcpy (result->h_name, hp->h_name); 00177 } 00178 else 00179 { 00180 result->h_name = (char *)0; 00181 } 00182 00183 // free hostent memory 00184 ::hostentFree (hp); 00185 00186 return result; 00187 } 00188 else 00189 { 00190 return (struct hostent *) 0; 00191 } 00192 # else 00193 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00194 ACE_UNUSED_ARG (result); 00195 ACE_UNUSED_ARG (h_errnop); 00196 //FUZZ: disable check_for_lack_ACE_OS 00197 ACE_NETDBCALL_RETURN (::gethostbyaddr (addr, (ACE_SOCKET_LEN) length, type), 00198 struct hostent *, 0, 00199 buffer, sizeof (ACE_HOSTENT_DATA)); 00200 //FUZZ: enable check_for_lack_ACE_OS 00201 # else 00202 //FUZZ: disable check_for_lack_ACE_OS 00203 ACE_SOCKCALL_RETURN (::gethostbyaddr_r (addr, length, type, result, 00204 buffer, sizeof (ACE_HOSTENT_DATA), 00205 h_errnop), 00206 struct hostent *, 0); 00207 //FUZZ: enable check_for_lack_ACE_OS 00208 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00209 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00210 # elif defined (ACE_HAS_NONCONST_GETBY) 00211 ACE_UNUSED_ARG (result); 00212 ACE_UNUSED_ARG (buffer); 00213 ACE_UNUSED_ARG (h_errnop); 00214 //FUZZ: disable check_for_lack_ACE_OS 00215 ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), 00216 (ACE_SOCKET_LEN) length, 00217 type), 00218 struct hostent *, 00219 0); 00220 //FUZZ: enable check_for_lack_ACE_OS 00221 # else 00222 ACE_UNUSED_ARG (h_errnop); 00223 ACE_UNUSED_ARG (buffer); 00224 ACE_UNUSED_ARG (result); 00225 00226 //FUZZ: disable check_for_lack_ACE_OS 00227 ACE_SOCKCALL_RETURN (::gethostbyaddr (addr, 00228 (ACE_SOCKET_LEN) length, 00229 type), 00230 struct hostent *, 00231 0); 00232 //FUZZ: enable check_for_lack_ACE_OS 00233 # endif /* ACE_LACKS_GETHOSTBYADDR_R */ 00234 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::gethostbyname | ( | const char * | name | ) |
Definition at line 241 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyname(), and gethostbyname_r().
Referenced by ACE::get_bcast_addr(), gethostbyname(), gethostbyname_r(), getipnodebyname(), getmacaddress(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), and ACE_INET_Addr::set().
00242 { 00243 ACE_OS_TRACE ("ACE_OS::gethostbyname"); 00244 # if defined (ACE_LACKS_GETHOSTBYNAME) 00245 ACE_UNUSED_ARG (name); 00246 ACE_NOTSUP_RETURN (0); 00247 # else 00248 00249 if (0 == name || '\0' == name[0]) 00250 return 0; 00251 00252 # if defined (ACE_VXWORKS) 00253 // VxWorks 6.x has a gethostbyname() that is threadsafe and 00254 // returns an heap-allocated hostentry structure. 00255 // just call ACE_OS::gethostbyname_r () which knows how to handle this. 00256 struct hostent hentry; 00257 ACE_HOSTENT_DATA buf; 00258 int h_error; // Not the same as errno! 00259 return ACE_OS::gethostbyname_r (name, &hentry, buf, &h_error); 00260 # elif defined (ACE_HAS_NONCONST_GETBY) 00261 //FUZZ: disable check_for_lack_ACE_OS 00262 ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), 00263 struct hostent *, 00264 0); 00265 //FUZZ: enable check_for_lack_ACE_OS 00266 # else 00267 //FUZZ: disable check_for_lack_ACE_OS 00268 ACE_SOCKCALL_RETURN (::gethostbyname (name), 00269 struct hostent *, 00270 0); 00271 //FUZZ: enable check_for_lack_ACE_OS 00272 # endif /* ACE_HAS_NONCONST_GETBY */ 00273 # endif /* !ACE_LACKS_GETHOSTBYNAME */ 00274 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::gethostbyname_r | ( | const char * | name, | |
struct hostent * | result, | |||
ACE_HOSTENT_DATA | buffer, | |||
int * | h_errnop | |||
) |
Definition at line 281 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyname(), gethostbyname_r(), memcpy(), memset(), strcpy(), and strlen().
Referenced by gethostbyname(), gethostbyname_r(), and ACE_INET_Addr::set().
00285 { 00286 ACE_OS_TRACE ("ACE_OS::gethostbyname_r"); 00287 #if defined (ACE_LACKS_GETHOSTBYNAME) 00288 ACE_UNUSED_ARG (name); 00289 ACE_UNUSED_ARG (result); 00290 ACE_UNUSED_ARG (buffer); 00291 ACE_UNUSED_ARG (h_errnop); 00292 ACE_NOTSUP_RETURN (0); 00293 # elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00294 00295 if (0 == name || '\0' == name[0]) 00296 return (struct hostent *)0; 00297 00298 # if defined (DIGITAL_UNIX) || \ 00299 (defined (ACE_AIX_MINOR_VERS) && (ACE_AIX_MINOR_VERS > 2)) 00300 ACE_UNUSED_ARG (result); 00301 ACE_UNUSED_ARG (buffer); 00302 ACE_UNUSED_ARG (h_errnop); 00303 00304 // gethostbyname returns thread-specific storage on Digital Unix and 00305 // AIX 4.3 00306 //FUZZ: disable check_for_lack_ACE_OS 00307 ACE_SOCKCALL_RETURN (::gethostbyname (name), struct hostent *, 0); 00308 //FUZZ: enable check_for_lack_ACE_OS 00309 # elif defined (AIX) 00310 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00311 00312 //FUZZ: disable check_for_lack_ACE_OS 00313 if (::gethostbyname_r (name, result, (struct hostent_data *) buffer) == 0) 00314 return result; 00315 //FUZZ: enable check_for_lack_ACE_OS 00316 else 00317 { 00318 *h_errnop = h_errno; 00319 return (struct hostent *) 0; 00320 } 00321 # elif defined (__GLIBC__) 00322 // GNU C library has a different signature 00323 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00324 00325 //FUZZ: disable check_for_lack_ACE_OS 00326 if (::gethostbyname_r (name, 00327 result, 00328 buffer, 00329 sizeof (ACE_HOSTENT_DATA), 00330 &result, 00331 h_errnop) == 0) 00332 return result; 00333 //FUZZ: enable check_for_lack_ACE_OS 00334 else 00335 return (struct hostent *) 0; 00336 # elif defined (ACE_VXWORKS) 00337 // VxWorks 6.x has a threadsafe gethostbyname() which returns a heap-allocated 00338 // data structure which needs to be freed with hostentFree() 00339 //FUZZ: disable check_for_lack_ACE_OS 00340 struct hostent* hp = ::gethostbyname (name); 00341 //FUZZ: enable check_for_lack_ACE_OS 00342 00343 if (hp) 00344 { 00345 result->h_addrtype = hp->h_addrtype; 00346 result->h_length = hp->h_length; 00347 00348 // buffer layout: 00349 // buffer[0-3]: h_addr_list[0], pointer to the addr. 00350 // buffer[4-7]: h_addr_list[1], null terminator for the h_addr_list. 00351 // buffer[8...]: the first (and only) addr. 00352 00353 // Store the address list in buffer. 00354 result->h_addr_list = (char **) buffer; 00355 // Store the actual address _after_ the address list. 00356 result->h_addr_list[0] = (char *) &result->h_addr_list[2]; 00357 ACE_OS::memcpy (result->h_addr_list[0], hp->h_addr_list[0], hp->h_length); 00358 // Null-terminate the list of addresses. 00359 result->h_addr_list[1] = 0; 00360 // And no aliases, so null-terminate h_aliases. 00361 result->h_aliases = &result->h_addr_list[1]; 00362 00363 if (((2*sizeof(char*))+hp->h_length+ACE_OS::strlen (hp->h_name)+1) <= sizeof (ACE_HOSTENT_DATA)) 00364 { 00365 result->h_name = (char *) result->h_addr_list[0] + hp->h_length; 00366 ACE_OS::strcpy (result->h_name, hp->h_name); 00367 } 00368 else 00369 { 00370 result->h_name = (char *)0; 00371 } 00372 00373 // free hostent memory 00374 ::hostentFree (hp); 00375 00376 return result; 00377 } 00378 else 00379 { 00380 return (struct hostent *) 0; 00381 } 00382 # else 00383 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00384 ACE_UNUSED_ARG (result); 00385 ACE_UNUSED_ARG (h_errnop); 00386 //FUZZ: disable check_for_lack_ACE_OS 00387 ACE_NETDBCALL_RETURN (::gethostbyname (name), 00388 struct hostent *, 0, 00389 buffer, sizeof (ACE_HOSTENT_DATA)); 00390 //FUZZ: enable check_for_lack_ACE_OS 00391 # else 00392 //FUZZ: disable check_for_lack_ACE_OS 00393 ACE_SOCKCALL_RETURN (::gethostbyname_r (name, result, buffer, 00394 sizeof (ACE_HOSTENT_DATA), 00395 h_errnop), 00396 struct hostent *, 00397 0); 00398 //FUZZ: enable check_for_lack_ACE_OS 00399 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00400 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00401 # elif defined (ACE_HAS_NONCONST_GETBY) 00402 ACE_UNUSED_ARG (result); 00403 ACE_UNUSED_ARG (buffer); 00404 ACE_UNUSED_ARG (h_errnop); 00405 //FUZZ: disable check_for_lack_ACE_OS 00406 ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), 00407 struct hostent *, 00408 0); 00409 //FUZZ: enable check_for_lack_ACE_OS 00410 # else 00411 ACE_UNUSED_ARG (result); 00412 ACE_UNUSED_ARG (buffer); 00413 ACE_UNUSED_ARG (h_errnop); 00414 00415 //FUZZ: disable check_for_lack_ACE_OS 00416 ACE_SOCKCALL_RETURN (::gethostbyname (name), 00417 struct hostent *, 00418 0); 00419 //FUZZ: enable check_for_lack_ACE_OS 00420 # endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00421 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::getipnodebyaddr | ( | const void * | src, | |
size_t | len, | |||
int | family | |||
) |
Definition at line 426 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, AF_INET, gethostbyaddr(), and getipnodebyaddr().
Referenced by getipnodebyaddr().
00427 { 00428 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00429 # if defined (ACE_LACKS_GETIPNODEBYADDR) 00430 ACE_UNUSED_ARG (src); 00431 ACE_UNUSED_ARG (len); 00432 ACE_UNUSED_ARG (family); 00433 ACE_NOTSUP_RETURN (0); 00434 # else 00435 struct hostent *hptr = 0; 00436 int errnum; 00437 //FUZZ: disable check_for_lack_ACE_OS 00438 if ((hptr = ::getipnodebyaddr (src, len, family, &errnum)) == 0) 00439 { 00440 errno = errnum; 00441 } 00442 //FUZZ: enable check_for_lack_ACE_OS 00443 return hptr; 00444 # endif /* ACE_LACKS_GETIPNODEBYADDR */ 00445 #else 00446 // IPv4-only implementation 00447 if (family == AF_INET) 00448 return ACE_OS::gethostbyaddr (static_cast<const char *> (src), 00449 static_cast<int> (len), 00450 family); 00451 00452 ACE_NOTSUP_RETURN (0); 00453 # endif /* defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) */ 00454 }
ACE_NAMESPACE_INLINE_FUNCTION struct hostent* ACE_OS::getipnodebyname | ( | const char * | name, | |
int | family, | |||
int | flags = 0 | |||
) |
Definition at line 457 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, AF_INET, gethostbyname(), and getipnodebyname().
Referenced by getipnodebyname().
00458 { 00459 ACE_OS_TRACE ("ACE_OS::getipnodebyname"); 00460 # if defined (ACE_HAS_IPV6) && !defined (ACE_LACKS_GETIPNODEBYNAME_IPV6) 00461 # if defined (ACE_LACKS_GETIPNODEBYNAME) 00462 ACE_UNUSED_ARG (flags); 00463 # if defined (ACE_HAS_NONCONST_GETBY) 00464 ACE_SOCKCALL_RETURN (::gethostbyname2 (const_cast<char *> (name), 00465 family), 00466 struct hostent *, 0); 00467 # else 00468 ACE_SOCKCALL_RETURN (::gethostbyname2 (name, family), 00469 struct hostent *, 0); 00470 # endif /* ACE_HAS_NONCONST_GETBY */ 00471 # else 00472 struct hostent *hptr = 0; 00473 int errnum; 00474 //FUZZ: disable check_for_lack_ACE_OS 00475 if ((hptr = ::getipnodebyname (name, family, flags, &errnum)) == 0) 00476 { 00477 errno = errnum; 00478 } 00479 //FUZZ: enable check_for_lack_ACE_OS 00480 return hptr; 00481 # endif /* ACE_LACKS_GETIPNODEBYNAME */ 00482 # else 00483 // IPv4-only implementation 00484 ACE_UNUSED_ARG (flags); 00485 if (family == AF_INET) 00486 return ACE_OS::gethostbyname (name); 00487 00488 ACE_NOTSUP_RETURN (0); 00489 # endif /* defined (ACE_HAS_IPV6) && !ACE_LACKS_GETIPNODEBYNAME_IPV6 */ 00490 }
ACE_NAMESPACE_INLINE_FUNCTION struct protoent* ACE_OS::getprotobyname | ( | const char * | name | ) |
Definition at line 493 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, and getprotobyname().
Referenced by getprotobyname(), and getprotobyname_r().
00494 { 00495 #if defined (ACE_LACKS_GETPROTOBYNAME) 00496 ACE_UNUSED_ARG (name); 00497 ACE_NOTSUP_RETURN (0); 00498 #elif defined (ACE_HAS_NONCONST_GETBY) 00499 //FUZZ: disable check_for_lack_ACE_OS 00500 ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), 00501 struct protoent *, 00502 0); 00503 //FUZZ: enable check_for_lack_ACE_OS 00504 #else 00505 //FUZZ: disable check_for_lack_ACE_OS 00506 ACE_SOCKCALL_RETURN (::getprotobyname (name), 00507 struct protoent *, 00508 0); 00509 //FUZZ: enable check_for_lack_ACE_OS 00510 #endif /* ACE_LACKS_GETPROTOBYNAME */ 00511 }
ACE_NAMESPACE_INLINE_FUNCTION struct protoent* ACE_OS::getprotobyname_r | ( | const char * | name, | |
struct protoent * | result, | |||
ACE_PROTOENT_DATA | buffer | |||
) |
Definition at line 514 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, getprotobyname(), and getprotobyname_r().
Referenced by getprotobyname_r().
00517 { 00518 #if defined (ACE_LACKS_GETPROTOBYNAME) 00519 ACE_UNUSED_ARG (name); 00520 ACE_UNUSED_ARG (result); 00521 ACE_UNUSED_ARG (buffer); 00522 ACE_NOTSUP_RETURN (0); 00523 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00524 # if defined (AIX) || defined (DIGITAL_UNIX) 00525 //FUZZ: disable check_for_lack_ACE_OS 00526 if (::getprotobyname_r (name, result, (struct protoent_data *) buffer) == 0) 00527 return result; 00528 else 00529 return 0; 00530 //FUZZ: enable check_for_lack_ACE_OS 00531 # elif defined (__GLIBC__) 00532 // GNU C library has a different signature 00533 //FUZZ: disable check_for_lack_ACE_OS 00534 if (::getprotobyname_r (name, 00535 result, 00536 buffer, 00537 sizeof (ACE_PROTOENT_DATA), 00538 &result) == 0) 00539 //FUZZ: enable check_for_lack_ACE_OS 00540 return result; 00541 else 00542 return 0; 00543 # else 00544 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00545 ACE_UNUSED_ARG (result); 00546 //FUZZ: disable check_for_lack_ACE_OS 00547 ACE_NETDBCALL_RETURN (::getprotobyname (name), 00548 struct protoent *, 0, 00549 buffer, sizeof (ACE_PROTOENT_DATA)); 00550 //FUZZ: enable check_for_lack_ACE_OS 00551 # else 00552 //FUZZ: disable check_for_lack_ACE_OS 00553 ACE_SOCKCALL_RETURN (::getprotobyname_r (name, 00554 result, 00555 buffer, 00556 sizeof (ACE_PROTOENT_DATA)), 00557 struct protoent *, 0); 00558 //FUZZ: enable check_for_lack_ACE_OS 00559 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00560 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00561 #elif defined (ACE_HAS_NONCONST_GETBY) 00562 ACE_UNUSED_ARG (result); 00563 ACE_UNUSED_ARG (buffer); 00564 //FUZZ: disable check_for_lack_ACE_OS 00565 ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), 00566 struct protoent *, 0); 00567 //FUZZ: enable check_for_lack_ACE_OS 00568 #else 00569 ACE_UNUSED_ARG (buffer); 00570 ACE_UNUSED_ARG (result); 00571 00572 //FUZZ: disable check_for_lack_ACE_OS 00573 ACE_SOCKCALL_RETURN (::getprotobyname (name), 00574 struct protoent *, 00575 0); 00576 //FUZZ: enable check_for_lack_ACE_OS 00577 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) !defined (UNIXWARE) */ 00578 }
ACE_NAMESPACE_INLINE_FUNCTION struct protoent* ACE_OS::getprotobynumber | ( | int | proto | ) |
Definition at line 581 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, and getprotobynumber().
Referenced by getprotobynumber(), and getprotobynumber_r().
00582 { 00583 #if defined (ACE_LACKS_GETPROTOBYNUMBER) 00584 ACE_UNUSED_ARG (proto); 00585 ACE_NOTSUP_RETURN (0); 00586 #else 00587 //FUZZ: disable check_for_lack_ACE_OS 00588 ACE_SOCKCALL_RETURN (::getprotobynumber (proto), 00589 struct protoent *, 0); 00590 //FUZZ: enable check_for_lack_ACE_OS 00591 #endif /* ACE_LACKS_GETPROTOBYNUMBER */ 00592 }
ACE_NAMESPACE_INLINE_FUNCTION struct protoent* ACE_OS::getprotobynumber_r | ( | int | proto, | |
struct protoent * | result, | |||
ACE_PROTOENT_DATA | buffer | |||
) |
Definition at line 595 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, getprotobynumber(), and getprotobynumber_r().
Referenced by getprotobynumber_r().
00598 { 00599 #if defined (ACE_LACKS_GETPROTOBYNUMBER) 00600 ACE_UNUSED_ARG (proto); 00601 ACE_UNUSED_ARG (result); 00602 ACE_UNUSED_ARG (buffer); 00603 ACE_NOTSUP_RETURN (0); 00604 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00605 # if defined (AIX) || defined (DIGITAL_UNIX) 00606 //FUZZ: disable check_for_lack_ACE_OS 00607 if (::getprotobynumber_r (proto, result, (struct protoent_data *) buffer) == 0) 00608 return result; 00609 //FUZZ: enable check_for_lack_ACE_OS 00610 else 00611 return 0; 00612 # elif defined (__GLIBC__) 00613 // GNU C library has a different signature 00614 //FUZZ: disable check_for_lack_ACE_OS 00615 if (::getprotobynumber_r (proto, 00616 result, 00617 buffer, 00618 sizeof (ACE_PROTOENT_DATA), 00619 &result) == 0) 00620 //FUZZ: enable check_for_lack_ACE_OS 00621 return result; 00622 else 00623 return 0; 00624 # else 00625 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00626 ACE_UNUSED_ARG (result); 00627 //FUZZ: disable check_for_lack_ACE_OS 00628 ACE_NETDBCALL_RETURN (::getprotobynumber (proto), 00629 struct protoent *, 0, 00630 buffer, sizeof (ACE_PROTOENT_DATA)); 00631 //FUZZ: enable check_for_lack_ACE_OS 00632 # else 00633 //FUZZ: disable check_for_lack_ACE_OS 00634 ACE_SOCKCALL_RETURN (::getprotobynumber_r (proto, result, buffer, sizeof (ACE_PROTOENT_DATA)), 00635 struct protoent *, 0); 00636 //FUZZ: enable check_for_lack_ACE_OS 00637 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00638 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00639 #else 00640 ACE_UNUSED_ARG (buffer); 00641 ACE_UNUSED_ARG (result); 00642 00643 //FUZZ: disable check_for_lack_ACE_OS 00644 ACE_SOCKCALL_RETURN (::getprotobynumber (proto), 00645 struct protoent *, 0); 00646 //FUZZ: enable check_for_lack_ACE_OS 00647 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00648 }
ACE_NAMESPACE_INLINE_FUNCTION struct servent* ACE_OS::getservbyname | ( | const char * | svc, | |
const char * | proto | |||
) |
Definition at line 651 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and getservbyname().
Referenced by getservbyname(), and getservbyname_r().
00652 { 00653 ACE_OS_TRACE ("ACE_OS::getservbyname"); 00654 #if defined (ACE_LACKS_GETSERVBYNAME) 00655 ACE_UNUSED_ARG (svc); 00656 ACE_UNUSED_ARG (proto); 00657 ACE_NOTSUP_RETURN (0); 00658 #elif defined (ACE_HAS_NONCONST_GETBY) 00659 //FUZZ: disable check_for_lack_ACE_OS 00660 ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), 00661 const_cast<char *> (proto)), 00662 struct servent *, 00663 0); 00664 //FUZZ: enable check_for_lack_ACE_OS 00665 #else 00666 //FUZZ: disable check_for_lack_ACE_OS 00667 ACE_SOCKCALL_RETURN (::getservbyname (svc, 00668 proto), 00669 struct servent *, 00670 0); 00671 //FUZZ: enable check_for_lack_ACE_OS 00672 #endif /* ACE_HAS_NONCONST_GETBY */ 00673 }
ACE_NAMESPACE_INLINE_FUNCTION struct servent* ACE_OS::getservbyname_r | ( | const char * | svc, | |
const char * | proto, | |||
struct servent * | result, | |||
ACE_SERVENT_DATA | buf | |||
) |
Definition at line 676 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, getservbyname(), getservbyname_r(), and memset().
Referenced by get_port_number_from_name(), and getservbyname_r().
00680 { 00681 ACE_OS_TRACE ("ACE_OS::getservbyname_r"); 00682 #if defined (ACE_LACKS_GETSERVBYNAME) 00683 ACE_UNUSED_ARG (svc); 00684 ACE_UNUSED_ARG (proto); 00685 ACE_UNUSED_ARG (result); 00686 ACE_UNUSED_ARG (buf); 00687 ACE_NOTSUP_RETURN (0); 00688 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00689 # if defined (AIX) || defined (DIGITAL_UNIX) 00690 ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA)); 00691 00692 //FUZZ: disable check_for_lack_ACE_OS 00693 if (::getservbyname_r (svc, proto, result, (struct servent_data *) buf) == 0) 00694 return result; 00695 //FUZZ: enable check_for_lack_ACE_OS 00696 else 00697 return (struct servent *) 0; 00698 # elif defined (__GLIBC__) 00699 // GNU C library has a different signature 00700 ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA)); 00701 00702 //FUZZ: disable check_for_lack_ACE_OS 00703 if (::getservbyname_r (svc, 00704 proto, 00705 result, 00706 buf, 00707 sizeof (ACE_SERVENT_DATA), 00708 &result) == 0) 00709 return result; 00710 //FUZZ: enable check_for_lack_ACE_OS 00711 else 00712 return (struct servent *) 0; 00713 # else 00714 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00715 ACE_UNUSED_ARG (result); 00716 //FUZZ: disable check_for_lack_ACE_OS 00717 ACE_NETDBCALL_RETURN (::getservbyname (svc, proto), 00718 struct servent *, 0, 00719 buf, sizeof (ACE_SERVENT_DATA)); 00720 //FUZZ: enable check_for_lack_ACE_OS 00721 # else 00722 //FUZZ: disable check_for_lack_ACE_OS 00723 ACE_SOCKCALL_RETURN (::getservbyname_r (svc, proto, result, buf, 00724 sizeof (ACE_SERVENT_DATA)), 00725 struct servent *, 0); 00726 //FUZZ: enable check_for_lack_ACE_OS 00727 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00728 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00729 #elif defined (ACE_HAS_NONCONST_GETBY) 00730 ACE_UNUSED_ARG (buf); 00731 ACE_UNUSED_ARG (result); 00732 //FUZZ: disable check_for_lack_ACE_OS 00733 ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), 00734 const_cast<char *> (proto)), 00735 struct servent *, 00736 0); 00737 //FUZZ: enable check_for_lack_ACE_OS 00738 #else 00739 ACE_UNUSED_ARG (buf); 00740 ACE_UNUSED_ARG (result); 00741 //FUZZ: disable check_for_lack_ACE_OS 00742 ACE_SOCKCALL_RETURN (::getservbyname (svc, 00743 proto), 00744 struct servent *, 00745 0); 00746 //FUZZ: enable check_for_lack_ACE_OS 00747 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00748 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE struct hostent* ACE_OS::gethostbyaddr | ( | const char * | addr, | |
int | length, | |||
int | type | |||
) |
Definition at line 48 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyaddr(), and gethostbyaddr_r().
Referenced by ACE_INET_Addr::get_host_name_i(), gethostbyaddr(), gethostbyaddr_r(), and getipnodebyaddr().
00049 { 00050 ACE_OS_TRACE ("ACE_OS::gethostbyaddr"); 00051 # if defined (ACE_LACKS_GETHOSTBYADDR) 00052 ACE_UNUSED_ARG (addr); 00053 ACE_UNUSED_ARG (length); 00054 ACE_UNUSED_ARG (type); 00055 ACE_NOTSUP_RETURN (0); 00056 # else 00057 00058 if (0 == addr || '\0' == addr[0]) 00059 return 0; 00060 00061 # if defined (ACE_VXWORKS) 00062 // VxWorks 6.x has a gethostbyaddr() that is threadsafe and 00063 // returns an heap-allocated hostentry structure. 00064 // just call ACE_OS::gethostbyaddr_r () which knows how to handle this. 00065 struct hostent hentry; 00066 ACE_HOSTENT_DATA buf; 00067 int h_error; // Not the same as errno! 00068 return ACE_OS::gethostbyaddr_r (addr, length, type, &hentry, buf, &h_error); 00069 # elif defined (ACE_HAS_NONCONST_GETBY) 00070 //FUZZ: disable check_for_lack_ACE_OS 00071 ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), 00072 (ACE_SOCKET_LEN) length, 00073 type), 00074 struct hostent *, 00075 0); 00076 //FUZZ: enable check_for_lack_ACE_OS 00077 # else 00078 //FUZZ: disable check_for_lack_ACE_OS 00079 ACE_SOCKCALL_RETURN (::gethostbyaddr (addr, 00080 (ACE_SOCKET_LEN) length, 00081 type), 00082 struct hostent *, 00083 0); 00084 //FUZZ: enable check_for_lack_ACE_OS 00085 # endif /* ACE_HAS_NONCONST_GETBY */ 00086 # endif /* !ACE_LACKS_GETHOSTBYADDR */ 00087 }
ACE_INLINE struct hostent* ACE_OS::gethostbyaddr_r | ( | const char * | addr, | |
int | length, | |||
int | type, | |||
struct hostent * | result, | |||
ACE_HOSTENT_DATA | buffer, | |||
int * | h_errnop | |||
) |
Definition at line 94 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyaddr(), gethostbyaddr_r(), memcpy(), memset(), strcpy(), and strlen().
Referenced by ACE::get_fqdn(), ACE_INET_Addr::get_host_name_i(), gethostbyaddr(), and gethostbyaddr_r().
00100 { 00101 ACE_OS_TRACE ("ACE_OS::gethostbyaddr_r"); 00102 # if defined (ACE_LACKS_GETHOSTBYADDR_R) 00103 ACE_UNUSED_ARG (addr); 00104 ACE_UNUSED_ARG (length); 00105 ACE_UNUSED_ARG (type); 00106 ACE_UNUSED_ARG (result); 00107 ACE_UNUSED_ARG (buffer); 00108 ACE_UNUSED_ARG (h_errnop); 00109 ACE_NOTSUP_RETURN (0); 00110 # elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00111 00112 if (0 == addr || '\0' == addr[0]) 00113 return 0; 00114 00115 # if defined (AIX) || defined (DIGITAL_UNIX) 00116 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00117 00118 //FUZZ: disable check_for_lack_ACE_OS 00119 if (::gethostbyaddr_r ((char *) addr, length, type, result, 00120 (struct hostent_data *) buffer)== 0) 00121 return result; 00122 //FUZZ: enable check_for_lack_ACE_OS 00123 else 00124 { 00125 *h_errnop = h_errno; 00126 return (struct hostent *) 0; 00127 } 00128 # elif defined (__GLIBC__) 00129 // GNU C library has a different signature 00130 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00131 00132 //FUZZ: disable check_for_lack_ACE_OS 00133 if (::gethostbyaddr_r ((char *) addr, 00134 length, 00135 type, 00136 result, 00137 buffer, 00138 sizeof (ACE_HOSTENT_DATA), 00139 &result, 00140 h_errnop) == 0) 00141 return result; 00142 //FUZZ: enable check_for_lack_ACE_OS 00143 else 00144 return (struct hostent *) 0; 00145 # elif defined (ACE_VXWORKS) 00146 // VxWorks 6.x has a threadsafe gethostbyaddr() which returns a heap-allocated 00147 // data structure which needs to be freed with hostentFree() 00148 //FUZZ: disable check_for_lack_ACE_OS 00149 struct hostent* hp = ::gethostbyaddr (addr, length, type); 00150 //FUZZ: enable check_for_lack_ACE_OS 00151 00152 if (hp) 00153 { 00154 result->h_addrtype = hp->h_addrtype; 00155 result->h_length = hp->h_length; 00156 00157 // buffer layout: 00158 // buffer[0-3]: h_addr_list[0], pointer to the addr. 00159 // buffer[4-7]: h_addr_list[1], null terminator for the h_addr_list. 00160 // buffer[8..(8+h_length)]: the first (and only) addr. 00161 // buffer[(8+h_length)...]: hostname 00162 00163 // Store the address list in buffer. 00164 result->h_addr_list = (char **) buffer; 00165 // Store the actual address _after_ the address list. 00166 result->h_addr_list[0] = (char *) &result->h_addr_list[2]; 00167 ACE_OS::memcpy (result->h_addr_list[0], hp->h_addr_list[0], hp->h_length); 00168 // Null-terminate the list of addresses. 00169 result->h_addr_list[1] = 0; 00170 // And no aliases, so null-terminate h_aliases. 00171 result->h_aliases = &result->h_addr_list[1]; 00172 00173 if (((2*sizeof(char*))+hp->h_length+ACE_OS::strlen (hp->h_name)+1) <= sizeof (ACE_HOSTENT_DATA)) 00174 { 00175 result->h_name = (char *) result->h_addr_list[0] + hp->h_length; 00176 ACE_OS::strcpy (result->h_name, hp->h_name); 00177 } 00178 else 00179 { 00180 result->h_name = (char *)0; 00181 } 00182 00183 // free hostent memory 00184 ::hostentFree (hp); 00185 00186 return result; 00187 } 00188 else 00189 { 00190 return (struct hostent *) 0; 00191 } 00192 # else 00193 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00194 ACE_UNUSED_ARG (result); 00195 ACE_UNUSED_ARG (h_errnop); 00196 //FUZZ: disable check_for_lack_ACE_OS 00197 ACE_NETDBCALL_RETURN (::gethostbyaddr (addr, (ACE_SOCKET_LEN) length, type), 00198 struct hostent *, 0, 00199 buffer, sizeof (ACE_HOSTENT_DATA)); 00200 //FUZZ: enable check_for_lack_ACE_OS 00201 # else 00202 //FUZZ: disable check_for_lack_ACE_OS 00203 ACE_SOCKCALL_RETURN (::gethostbyaddr_r (addr, length, type, result, 00204 buffer, sizeof (ACE_HOSTENT_DATA), 00205 h_errnop), 00206 struct hostent *, 0); 00207 //FUZZ: enable check_for_lack_ACE_OS 00208 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00209 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00210 # elif defined (ACE_HAS_NONCONST_GETBY) 00211 ACE_UNUSED_ARG (result); 00212 ACE_UNUSED_ARG (buffer); 00213 ACE_UNUSED_ARG (h_errnop); 00214 //FUZZ: disable check_for_lack_ACE_OS 00215 ACE_SOCKCALL_RETURN (::gethostbyaddr (const_cast<char *> (addr), 00216 (ACE_SOCKET_LEN) length, 00217 type), 00218 struct hostent *, 00219 0); 00220 //FUZZ: enable check_for_lack_ACE_OS 00221 # else 00222 ACE_UNUSED_ARG (h_errnop); 00223 ACE_UNUSED_ARG (buffer); 00224 ACE_UNUSED_ARG (result); 00225 00226 //FUZZ: disable check_for_lack_ACE_OS 00227 ACE_SOCKCALL_RETURN (::gethostbyaddr (addr, 00228 (ACE_SOCKET_LEN) length, 00229 type), 00230 struct hostent *, 00231 0); 00232 //FUZZ: enable check_for_lack_ACE_OS 00233 # endif /* ACE_LACKS_GETHOSTBYADDR_R */ 00234 }
ACE_INLINE struct hostent* ACE_OS::gethostbyname | ( | const char * | name | ) |
Definition at line 241 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyname(), and gethostbyname_r().
Referenced by ACE::get_bcast_addr(), gethostbyname(), gethostbyname_r(), getipnodebyname(), getmacaddress(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), and ACE_INET_Addr::set().
00242 { 00243 ACE_OS_TRACE ("ACE_OS::gethostbyname"); 00244 # if defined (ACE_LACKS_GETHOSTBYNAME) 00245 ACE_UNUSED_ARG (name); 00246 ACE_NOTSUP_RETURN (0); 00247 # else 00248 00249 if (0 == name || '\0' == name[0]) 00250 return 0; 00251 00252 # if defined (ACE_VXWORKS) 00253 // VxWorks 6.x has a gethostbyname() that is threadsafe and 00254 // returns an heap-allocated hostentry structure. 00255 // just call ACE_OS::gethostbyname_r () which knows how to handle this. 00256 struct hostent hentry; 00257 ACE_HOSTENT_DATA buf; 00258 int h_error; // Not the same as errno! 00259 return ACE_OS::gethostbyname_r (name, &hentry, buf, &h_error); 00260 # elif defined (ACE_HAS_NONCONST_GETBY) 00261 //FUZZ: disable check_for_lack_ACE_OS 00262 ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), 00263 struct hostent *, 00264 0); 00265 //FUZZ: enable check_for_lack_ACE_OS 00266 # else 00267 //FUZZ: disable check_for_lack_ACE_OS 00268 ACE_SOCKCALL_RETURN (::gethostbyname (name), 00269 struct hostent *, 00270 0); 00271 //FUZZ: enable check_for_lack_ACE_OS 00272 # endif /* ACE_HAS_NONCONST_GETBY */ 00273 # endif /* !ACE_LACKS_GETHOSTBYNAME */ 00274 }
ACE_INLINE struct hostent* ACE_OS::gethostbyname_r | ( | const char * | name, | |
struct hostent * | result, | |||
ACE_HOSTENT_DATA | buffer, | |||
int * | h_errnop | |||
) |
Definition at line 281 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, gethostbyname(), gethostbyname_r(), memcpy(), memset(), strcpy(), and strlen().
Referenced by gethostbyname(), gethostbyname_r(), and ACE_INET_Addr::set().
00285 { 00286 ACE_OS_TRACE ("ACE_OS::gethostbyname_r"); 00287 #if defined (ACE_LACKS_GETHOSTBYNAME) 00288 ACE_UNUSED_ARG (name); 00289 ACE_UNUSED_ARG (result); 00290 ACE_UNUSED_ARG (buffer); 00291 ACE_UNUSED_ARG (h_errnop); 00292 ACE_NOTSUP_RETURN (0); 00293 # elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00294 00295 if (0 == name || '\0' == name[0]) 00296 return (struct hostent *)0; 00297 00298 # if defined (DIGITAL_UNIX) || \ 00299 (defined (ACE_AIX_MINOR_VERS) && (ACE_AIX_MINOR_VERS > 2)) 00300 ACE_UNUSED_ARG (result); 00301 ACE_UNUSED_ARG (buffer); 00302 ACE_UNUSED_ARG (h_errnop); 00303 00304 // gethostbyname returns thread-specific storage on Digital Unix and 00305 // AIX 4.3 00306 //FUZZ: disable check_for_lack_ACE_OS 00307 ACE_SOCKCALL_RETURN (::gethostbyname (name), struct hostent *, 0); 00308 //FUZZ: enable check_for_lack_ACE_OS 00309 # elif defined (AIX) 00310 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00311 00312 //FUZZ: disable check_for_lack_ACE_OS 00313 if (::gethostbyname_r (name, result, (struct hostent_data *) buffer) == 0) 00314 return result; 00315 //FUZZ: enable check_for_lack_ACE_OS 00316 else 00317 { 00318 *h_errnop = h_errno; 00319 return (struct hostent *) 0; 00320 } 00321 # elif defined (__GLIBC__) 00322 // GNU C library has a different signature 00323 ACE_OS::memset (buffer, 0, sizeof (ACE_HOSTENT_DATA)); 00324 00325 //FUZZ: disable check_for_lack_ACE_OS 00326 if (::gethostbyname_r (name, 00327 result, 00328 buffer, 00329 sizeof (ACE_HOSTENT_DATA), 00330 &result, 00331 h_errnop) == 0) 00332 return result; 00333 //FUZZ: enable check_for_lack_ACE_OS 00334 else 00335 return (struct hostent *) 0; 00336 # elif defined (ACE_VXWORKS) 00337 // VxWorks 6.x has a threadsafe gethostbyname() which returns a heap-allocated 00338 // data structure which needs to be freed with hostentFree() 00339 //FUZZ: disable check_for_lack_ACE_OS 00340 struct hostent* hp = ::gethostbyname (name); 00341 //FUZZ: enable check_for_lack_ACE_OS 00342 00343 if (hp) 00344 { 00345 result->h_addrtype = hp->h_addrtype; 00346 result->h_length = hp->h_length; 00347 00348 // buffer layout: 00349 // buffer[0-3]: h_addr_list[0], pointer to the addr. 00350 // buffer[4-7]: h_addr_list[1], null terminator for the h_addr_list. 00351 // buffer[8...]: the first (and only) addr. 00352 00353 // Store the address list in buffer. 00354 result->h_addr_list = (char **) buffer; 00355 // Store the actual address _after_ the address list. 00356 result->h_addr_list[0] = (char *) &result->h_addr_list[2]; 00357 ACE_OS::memcpy (result->h_addr_list[0], hp->h_addr_list[0], hp->h_length); 00358 // Null-terminate the list of addresses. 00359 result->h_addr_list[1] = 0; 00360 // And no aliases, so null-terminate h_aliases. 00361 result->h_aliases = &result->h_addr_list[1]; 00362 00363 if (((2*sizeof(char*))+hp->h_length+ACE_OS::strlen (hp->h_name)+1) <= sizeof (ACE_HOSTENT_DATA)) 00364 { 00365 result->h_name = (char *) result->h_addr_list[0] + hp->h_length; 00366 ACE_OS::strcpy (result->h_name, hp->h_name); 00367 } 00368 else 00369 { 00370 result->h_name = (char *)0; 00371 } 00372 00373 // free hostent memory 00374 ::hostentFree (hp); 00375 00376 return result; 00377 } 00378 else 00379 { 00380 return (struct hostent *) 0; 00381 } 00382 # else 00383 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00384 ACE_UNUSED_ARG (result); 00385 ACE_UNUSED_ARG (h_errnop); 00386 //FUZZ: disable check_for_lack_ACE_OS 00387 ACE_NETDBCALL_RETURN (::gethostbyname (name), 00388 struct hostent *, 0, 00389 buffer, sizeof (ACE_HOSTENT_DATA)); 00390 //FUZZ: enable check_for_lack_ACE_OS 00391 # else 00392 //FUZZ: disable check_for_lack_ACE_OS 00393 ACE_SOCKCALL_RETURN (::gethostbyname_r (name, result, buffer, 00394 sizeof (ACE_HOSTENT_DATA), 00395 h_errnop), 00396 struct hostent *, 00397 0); 00398 //FUZZ: enable check_for_lack_ACE_OS 00399 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00400 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00401 # elif defined (ACE_HAS_NONCONST_GETBY) 00402 ACE_UNUSED_ARG (result); 00403 ACE_UNUSED_ARG (buffer); 00404 ACE_UNUSED_ARG (h_errnop); 00405 //FUZZ: disable check_for_lack_ACE_OS 00406 ACE_SOCKCALL_RETURN (::gethostbyname (const_cast<char *> (name)), 00407 struct hostent *, 00408 0); 00409 //FUZZ: enable check_for_lack_ACE_OS 00410 # else 00411 ACE_UNUSED_ARG (result); 00412 ACE_UNUSED_ARG (buffer); 00413 ACE_UNUSED_ARG (h_errnop); 00414 00415 //FUZZ: disable check_for_lack_ACE_OS 00416 ACE_SOCKCALL_RETURN (::gethostbyname (name), 00417 struct hostent *, 00418 0); 00419 //FUZZ: enable check_for_lack_ACE_OS 00420 # endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00421 }
ACE_INLINE struct hostent* ACE_OS::getipnodebyaddr | ( | const void * | src, | |
size_t | len, | |||
int | family | |||
) |
Definition at line 426 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, AF_INET, gethostbyaddr(), and getipnodebyaddr().
Referenced by getipnodebyaddr().
00427 { 00428 #if defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) 00429 # if defined (ACE_LACKS_GETIPNODEBYADDR) 00430 ACE_UNUSED_ARG (src); 00431 ACE_UNUSED_ARG (len); 00432 ACE_UNUSED_ARG (family); 00433 ACE_NOTSUP_RETURN (0); 00434 # else 00435 struct hostent *hptr = 0; 00436 int errnum; 00437 //FUZZ: disable check_for_lack_ACE_OS 00438 if ((hptr = ::getipnodebyaddr (src, len, family, &errnum)) == 0) 00439 { 00440 errno = errnum; 00441 } 00442 //FUZZ: enable check_for_lack_ACE_OS 00443 return hptr; 00444 # endif /* ACE_LACKS_GETIPNODEBYADDR */ 00445 #else 00446 // IPv4-only implementation 00447 if (family == AF_INET) 00448 return ACE_OS::gethostbyaddr (static_cast<const char *> (src), 00449 static_cast<int> (len), 00450 family); 00451 00452 ACE_NOTSUP_RETURN (0); 00453 # endif /* defined (ACE_HAS_IPV6) && !defined (ACE_WIN32) */ 00454 }
ACE_INLINE struct hostent* ACE_OS::getipnodebyname | ( | const char * | name, | |
int | family, | |||
int | flags | |||
) |
Definition at line 457 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, AF_INET, gethostbyname(), and getipnodebyname().
Referenced by getipnodebyname().
00458 { 00459 ACE_OS_TRACE ("ACE_OS::getipnodebyname"); 00460 # if defined (ACE_HAS_IPV6) && !defined (ACE_LACKS_GETIPNODEBYNAME_IPV6) 00461 # if defined (ACE_LACKS_GETIPNODEBYNAME) 00462 ACE_UNUSED_ARG (flags); 00463 # if defined (ACE_HAS_NONCONST_GETBY) 00464 ACE_SOCKCALL_RETURN (::gethostbyname2 (const_cast<char *> (name), 00465 family), 00466 struct hostent *, 0); 00467 # else 00468 ACE_SOCKCALL_RETURN (::gethostbyname2 (name, family), 00469 struct hostent *, 0); 00470 # endif /* ACE_HAS_NONCONST_GETBY */ 00471 # else 00472 struct hostent *hptr = 0; 00473 int errnum; 00474 //FUZZ: disable check_for_lack_ACE_OS 00475 if ((hptr = ::getipnodebyname (name, family, flags, &errnum)) == 0) 00476 { 00477 errno = errnum; 00478 } 00479 //FUZZ: enable check_for_lack_ACE_OS 00480 return hptr; 00481 # endif /* ACE_LACKS_GETIPNODEBYNAME */ 00482 # else 00483 // IPv4-only implementation 00484 ACE_UNUSED_ARG (flags); 00485 if (family == AF_INET) 00486 return ACE_OS::gethostbyname (name); 00487 00488 ACE_NOTSUP_RETURN (0); 00489 # endif /* defined (ACE_HAS_IPV6) && !ACE_LACKS_GETIPNODEBYNAME_IPV6 */ 00490 }
ACE_INLINE struct protoent* ACE_OS::getprotobyname | ( | const char * | name | ) |
Definition at line 493 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, and getprotobyname().
Referenced by getprotobyname(), and getprotobyname_r().
00494 { 00495 #if defined (ACE_LACKS_GETPROTOBYNAME) 00496 ACE_UNUSED_ARG (name); 00497 ACE_NOTSUP_RETURN (0); 00498 #elif defined (ACE_HAS_NONCONST_GETBY) 00499 //FUZZ: disable check_for_lack_ACE_OS 00500 ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), 00501 struct protoent *, 00502 0); 00503 //FUZZ: enable check_for_lack_ACE_OS 00504 #else 00505 //FUZZ: disable check_for_lack_ACE_OS 00506 ACE_SOCKCALL_RETURN (::getprotobyname (name), 00507 struct protoent *, 00508 0); 00509 //FUZZ: enable check_for_lack_ACE_OS 00510 #endif /* ACE_LACKS_GETPROTOBYNAME */ 00511 }
ACE_INLINE struct protoent* ACE_OS::getprotobyname_r | ( | const char * | name, | |
struct protoent * | result, | |||
ACE_PROTOENT_DATA | buffer | |||
) |
Definition at line 514 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, getprotobyname(), and getprotobyname_r().
Referenced by getprotobyname_r().
00517 { 00518 #if defined (ACE_LACKS_GETPROTOBYNAME) 00519 ACE_UNUSED_ARG (name); 00520 ACE_UNUSED_ARG (result); 00521 ACE_UNUSED_ARG (buffer); 00522 ACE_NOTSUP_RETURN (0); 00523 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00524 # if defined (AIX) || defined (DIGITAL_UNIX) 00525 //FUZZ: disable check_for_lack_ACE_OS 00526 if (::getprotobyname_r (name, result, (struct protoent_data *) buffer) == 0) 00527 return result; 00528 else 00529 return 0; 00530 //FUZZ: enable check_for_lack_ACE_OS 00531 # elif defined (__GLIBC__) 00532 // GNU C library has a different signature 00533 //FUZZ: disable check_for_lack_ACE_OS 00534 if (::getprotobyname_r (name, 00535 result, 00536 buffer, 00537 sizeof (ACE_PROTOENT_DATA), 00538 &result) == 0) 00539 //FUZZ: enable check_for_lack_ACE_OS 00540 return result; 00541 else 00542 return 0; 00543 # else 00544 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00545 ACE_UNUSED_ARG (result); 00546 //FUZZ: disable check_for_lack_ACE_OS 00547 ACE_NETDBCALL_RETURN (::getprotobyname (name), 00548 struct protoent *, 0, 00549 buffer, sizeof (ACE_PROTOENT_DATA)); 00550 //FUZZ: enable check_for_lack_ACE_OS 00551 # else 00552 //FUZZ: disable check_for_lack_ACE_OS 00553 ACE_SOCKCALL_RETURN (::getprotobyname_r (name, 00554 result, 00555 buffer, 00556 sizeof (ACE_PROTOENT_DATA)), 00557 struct protoent *, 0); 00558 //FUZZ: enable check_for_lack_ACE_OS 00559 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00560 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00561 #elif defined (ACE_HAS_NONCONST_GETBY) 00562 ACE_UNUSED_ARG (result); 00563 ACE_UNUSED_ARG (buffer); 00564 //FUZZ: disable check_for_lack_ACE_OS 00565 ACE_SOCKCALL_RETURN (::getprotobyname (const_cast<char *> (name)), 00566 struct protoent *, 0); 00567 //FUZZ: enable check_for_lack_ACE_OS 00568 #else 00569 ACE_UNUSED_ARG (buffer); 00570 ACE_UNUSED_ARG (result); 00571 00572 //FUZZ: disable check_for_lack_ACE_OS 00573 ACE_SOCKCALL_RETURN (::getprotobyname (name), 00574 struct protoent *, 00575 0); 00576 //FUZZ: enable check_for_lack_ACE_OS 00577 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) !defined (UNIXWARE) */ 00578 }
ACE_INLINE struct protoent* ACE_OS::getprotobynumber | ( | int | proto | ) |
Definition at line 581 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, and getprotobynumber().
Referenced by getprotobynumber(), and getprotobynumber_r().
00582 { 00583 #if defined (ACE_LACKS_GETPROTOBYNUMBER) 00584 ACE_UNUSED_ARG (proto); 00585 ACE_NOTSUP_RETURN (0); 00586 #else 00587 //FUZZ: disable check_for_lack_ACE_OS 00588 ACE_SOCKCALL_RETURN (::getprotobynumber (proto), 00589 struct protoent *, 0); 00590 //FUZZ: enable check_for_lack_ACE_OS 00591 #endif /* ACE_LACKS_GETPROTOBYNUMBER */ 00592 }
ACE_INLINE struct protoent* ACE_OS::getprotobynumber_r | ( | int | proto, | |
struct protoent * | result, | |||
ACE_PROTOENT_DATA | buffer | |||
) |
Definition at line 595 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, getprotobynumber(), and getprotobynumber_r().
Referenced by getprotobynumber_r().
00598 { 00599 #if defined (ACE_LACKS_GETPROTOBYNUMBER) 00600 ACE_UNUSED_ARG (proto); 00601 ACE_UNUSED_ARG (result); 00602 ACE_UNUSED_ARG (buffer); 00603 ACE_NOTSUP_RETURN (0); 00604 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00605 # if defined (AIX) || defined (DIGITAL_UNIX) 00606 //FUZZ: disable check_for_lack_ACE_OS 00607 if (::getprotobynumber_r (proto, result, (struct protoent_data *) buffer) == 0) 00608 return result; 00609 //FUZZ: enable check_for_lack_ACE_OS 00610 else 00611 return 0; 00612 # elif defined (__GLIBC__) 00613 // GNU C library has a different signature 00614 //FUZZ: disable check_for_lack_ACE_OS 00615 if (::getprotobynumber_r (proto, 00616 result, 00617 buffer, 00618 sizeof (ACE_PROTOENT_DATA), 00619 &result) == 0) 00620 //FUZZ: enable check_for_lack_ACE_OS 00621 return result; 00622 else 00623 return 0; 00624 # else 00625 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00626 ACE_UNUSED_ARG (result); 00627 //FUZZ: disable check_for_lack_ACE_OS 00628 ACE_NETDBCALL_RETURN (::getprotobynumber (proto), 00629 struct protoent *, 0, 00630 buffer, sizeof (ACE_PROTOENT_DATA)); 00631 //FUZZ: enable check_for_lack_ACE_OS 00632 # else 00633 //FUZZ: disable check_for_lack_ACE_OS 00634 ACE_SOCKCALL_RETURN (::getprotobynumber_r (proto, result, buffer, sizeof (ACE_PROTOENT_DATA)), 00635 struct protoent *, 0); 00636 //FUZZ: enable check_for_lack_ACE_OS 00637 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00638 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00639 #else 00640 ACE_UNUSED_ARG (buffer); 00641 ACE_UNUSED_ARG (result); 00642 00643 //FUZZ: disable check_for_lack_ACE_OS 00644 ACE_SOCKCALL_RETURN (::getprotobynumber (proto), 00645 struct protoent *, 0); 00646 //FUZZ: enable check_for_lack_ACE_OS 00647 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00648 }
ACE_INLINE struct servent* ACE_OS::getservbyname | ( | const char * | svc, | |
const char * | proto | |||
) |
Definition at line 651 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and getservbyname().
Referenced by getservbyname(), and getservbyname_r().
00652 { 00653 ACE_OS_TRACE ("ACE_OS::getservbyname"); 00654 #if defined (ACE_LACKS_GETSERVBYNAME) 00655 ACE_UNUSED_ARG (svc); 00656 ACE_UNUSED_ARG (proto); 00657 ACE_NOTSUP_RETURN (0); 00658 #elif defined (ACE_HAS_NONCONST_GETBY) 00659 //FUZZ: disable check_for_lack_ACE_OS 00660 ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), 00661 const_cast<char *> (proto)), 00662 struct servent *, 00663 0); 00664 //FUZZ: enable check_for_lack_ACE_OS 00665 #else 00666 //FUZZ: disable check_for_lack_ACE_OS 00667 ACE_SOCKCALL_RETURN (::getservbyname (svc, 00668 proto), 00669 struct servent *, 00670 0); 00671 //FUZZ: enable check_for_lack_ACE_OS 00672 #endif /* ACE_HAS_NONCONST_GETBY */ 00673 }
ACE_INLINE struct servent* ACE_OS::getservbyname_r | ( | const char * | svc, | |
const char * | proto, | |||
struct servent * | result, | |||
ACE_SERVENT_DATA | buf | |||
) |
Definition at line 676 of file OS_NS_netdb.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, getservbyname(), getservbyname_r(), and memset().
Referenced by get_port_number_from_name(), and getservbyname_r().
00680 { 00681 ACE_OS_TRACE ("ACE_OS::getservbyname_r"); 00682 #if defined (ACE_LACKS_GETSERVBYNAME) 00683 ACE_UNUSED_ARG (svc); 00684 ACE_UNUSED_ARG (proto); 00685 ACE_UNUSED_ARG (result); 00686 ACE_UNUSED_ARG (buf); 00687 ACE_NOTSUP_RETURN (0); 00688 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) 00689 # if defined (AIX) || defined (DIGITAL_UNIX) 00690 ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA)); 00691 00692 //FUZZ: disable check_for_lack_ACE_OS 00693 if (::getservbyname_r (svc, proto, result, (struct servent_data *) buf) == 0) 00694 return result; 00695 //FUZZ: enable check_for_lack_ACE_OS 00696 else 00697 return (struct servent *) 0; 00698 # elif defined (__GLIBC__) 00699 // GNU C library has a different signature 00700 ACE_OS::memset (buf, 0, sizeof (ACE_SERVENT_DATA)); 00701 00702 //FUZZ: disable check_for_lack_ACE_OS 00703 if (::getservbyname_r (svc, 00704 proto, 00705 result, 00706 buf, 00707 sizeof (ACE_SERVENT_DATA), 00708 &result) == 0) 00709 return result; 00710 //FUZZ: enable check_for_lack_ACE_OS 00711 else 00712 return (struct servent *) 0; 00713 # else 00714 # if defined(ACE_LACKS_NETDB_REENTRANT_FUNCTIONS) 00715 ACE_UNUSED_ARG (result); 00716 //FUZZ: disable check_for_lack_ACE_OS 00717 ACE_NETDBCALL_RETURN (::getservbyname (svc, proto), 00718 struct servent *, 0, 00719 buf, sizeof (ACE_SERVENT_DATA)); 00720 //FUZZ: enable check_for_lack_ACE_OS 00721 # else 00722 //FUZZ: disable check_for_lack_ACE_OS 00723 ACE_SOCKCALL_RETURN (::getservbyname_r (svc, proto, result, buf, 00724 sizeof (ACE_SERVENT_DATA)), 00725 struct servent *, 0); 00726 //FUZZ: enable check_for_lack_ACE_OS 00727 # endif /* ACE_LACKS_NETDB_REENTRANT_FUNCTIONS */ 00728 # endif /* defined (AIX) || defined (DIGITAL_UNIX) */ 00729 #elif defined (ACE_HAS_NONCONST_GETBY) 00730 ACE_UNUSED_ARG (buf); 00731 ACE_UNUSED_ARG (result); 00732 //FUZZ: disable check_for_lack_ACE_OS 00733 ACE_SOCKCALL_RETURN (::getservbyname (const_cast<char *> (svc), 00734 const_cast<char *> (proto)), 00735 struct servent *, 00736 0); 00737 //FUZZ: enable check_for_lack_ACE_OS 00738 #else 00739 ACE_UNUSED_ARG (buf); 00740 ACE_UNUSED_ARG (result); 00741 //FUZZ: disable check_for_lack_ACE_OS 00742 ACE_SOCKCALL_RETURN (::getservbyname (svc, 00743 proto), 00744 struct servent *, 00745 0); 00746 //FUZZ: enable check_for_lack_ACE_OS 00747 #endif /* defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (UNIXWARE) */ 00748 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::poll | ( | struct pollfd * | pollfds, | |
unsigned long | len, | |||
const ACE_Time_Value * | tv = 0 | |||
) |
Definition at line 11 of file OS_NS_poll.inl.
Referenced by ACE::handle_ready(), ACE::handle_timed_accept(), ACE::handle_timed_complete(), and poll().
00014 { 00015 ACE_OS_TRACE ("ACE_OS::poll"); 00016 #if defined (ACE_HAS_POLL) 00017 int to = timeout == 0 ? -1 : int (timeout->msec ()); 00018 ACE_OSCALL_RETURN (::poll (pollfds, len, to), int, -1); 00019 #else 00020 ACE_UNUSED_ARG (timeout); 00021 ACE_UNUSED_ARG (len); 00022 ACE_UNUSED_ARG (pollfds); 00023 00024 ACE_NOTSUP_RETURN (-1); 00025 #endif /* ACE_HAS_POLL */ 00026 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::poll | ( | struct pollfd * | pollfds, | |
unsigned long | len, | |||
const ACE_Time_Value & | tv | |||
) |
Definition at line 29 of file OS_NS_poll.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_Time_Value::msec(), and poll().
00032 { 00033 ACE_OS_TRACE ("ACE_OS::poll"); 00034 #if defined (ACE_HAS_POLL) 00035 ACE_OSCALL_RETURN (::poll (pollfds, len, int (timeout.msec ())), int, -1); 00036 #else 00037 ACE_UNUSED_ARG (timeout); 00038 ACE_UNUSED_ARG (len); 00039 ACE_UNUSED_ARG (pollfds); 00040 00041 ACE_NOTSUP_RETURN (-1); 00042 #endif /* ACE_HAS_POLL */ 00043 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::poll | ( | struct pollfd * | pollfds, | |
unsigned long | len, | |||
const ACE_Time_Value * | timeout | |||
) |
Definition at line 11 of file OS_NS_poll.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_Time_Value::msec(), and poll().
00014 { 00015 ACE_OS_TRACE ("ACE_OS::poll"); 00016 #if defined (ACE_HAS_POLL) 00017 int to = timeout == 0 ? -1 : int (timeout->msec ()); 00018 ACE_OSCALL_RETURN (::poll (pollfds, len, to), int, -1); 00019 #else 00020 ACE_UNUSED_ARG (timeout); 00021 ACE_UNUSED_ARG (len); 00022 ACE_UNUSED_ARG (pollfds); 00023 00024 ACE_NOTSUP_RETURN (-1); 00025 #endif /* ACE_HAS_POLL */ 00026 }
ACE_INLINE int ACE_OS::poll | ( | struct pollfd * | pollfds, | |
unsigned long | len, | |||
const ACE_Time_Value & | timeout | |||
) |
Definition at line 29 of file OS_NS_poll.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_Time_Value::msec(), and poll().
00032 { 00033 ACE_OS_TRACE ("ACE_OS::poll"); 00034 #if defined (ACE_HAS_POLL) 00035 ACE_OSCALL_RETURN (::poll (pollfds, len, int (timeout.msec ())), int, -1); 00036 #else 00037 ACE_UNUSED_ARG (timeout); 00038 ACE_UNUSED_ARG (len); 00039 ACE_UNUSED_ARG (pollfds); 00040 00041 ACE_NOTSUP_RETURN (-1); 00042 #endif /* ACE_HAS_POLL */ 00043 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::endpwent | ( | void | ) |
Definition at line 12 of file OS_NS_pwd.inl.
References endpwent().
Referenced by cuserid(), and endpwent().
00013 { 00014 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00015 ::endpwent (); 00016 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00017 }
ACE_NAMESPACE_INLINE_FUNCTION struct passwd* ACE_OS::getpwent | ( | void | ) |
Definition at line 20 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwent().
Referenced by getpwent().
00021 { 00022 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00023 return ::getpwent (); 00024 #else 00025 ACE_NOTSUP_RETURN (0); 00026 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00027 }
ACE_NAMESPACE_INLINE_FUNCTION struct passwd* ACE_OS::getpwnam | ( | const char * | user | ) |
Definition at line 30 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwnam().
Referenced by getpwnam(), and ACE_Process_Options::setreugid().
00031 { 00032 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00033 return ::getpwnam (name); 00034 # else 00035 ACE_UNUSED_ARG (name); 00036 ACE_NOTSUP_RETURN (0); 00037 #endif /* ACE_LACKS_PWD_FUNCTIONS */ 00038 }
ACE_NAMESPACE_INLINE_FUNCTION struct passwd* ACE_OS::getpwnam_r | ( | const char * | name, | |
struct passwd * | pwent, | |||
char * | buffer, | |||
int | buflen | |||
) |
Definition at line 41 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwnam_r().
Referenced by getpwnam_r().
00043 { 00044 #if defined (ACE_HAS_POSIX_GETPWNAM_R) 00045 struct passwd *result = 0; 00046 00047 int const status = ::getpwnam_r (name, pwent, buffer, buflen, &result); 00048 00049 if (status != 0) 00050 { 00051 errno = status; 00052 result = 0; 00053 } 00054 return result; 00055 #elif !defined (ACE_LACKS_PWD_FUNCTIONS) 00056 # if defined (ACE_HAS_REENTRANT_FUNCTIONS) 00057 # if !defined (ACE_LACKS_PWD_REENTRANT_FUNCTIONS) 00058 # if defined (ACE_HAS_PTHREADS) && \ 00059 !defined (ACE_HAS_STHREADS) || \ 00060 defined (HPUX_11) || \ 00061 defined (__USLC__) // Added by Roland Gigler for SCO UnixWare 7. 00062 struct passwd *result; 00063 int status; 00064 # if defined (DIGITAL_UNIX) 00065 ::_Pgetpwnam_r (name, pwent, buffer, buflen, &result); 00066 # else 00067 // VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined 00068 // in pwd.h, and that redefinition is used here 00069 # if defined (__IBMCPP__) && (__IBMCPP__ >= 400) /* VAC++ 4 */ 00070 status = _posix_getpwnam_r (name, pwent, buffer, buflen, &result); 00071 # else 00072 status = ::getpwnam_r (name, pwent, buffer, buflen, &result); 00073 # endif /* __IBMCPP__ && (__IBMCPP__ >= 400) */ 00074 if (status != 0) 00075 { 00076 errno = status; 00077 result = 0; 00078 } 00079 # endif /* (DIGITAL_UNIX) */ 00080 return result; 00081 # elif defined (AIX) 00082 if (::getpwnam_r (name, pwent, buffer, buflen) == -1) 00083 return 0; 00084 else 00085 return pwent; 00086 # else 00087 return ::getpwnam_r (name, pwent, buffer, buflen); 00088 # endif /* ACE_HAS_PTHREADS */ 00089 # else 00090 ACE_UNUSED_ARG (name); 00091 ACE_UNUSED_ARG (pwent); 00092 ACE_UNUSED_ARG (buffer); 00093 ACE_UNUSED_ARG (buflen); 00094 ACE_NOTSUP_RETURN (0); 00095 # endif /* ! ACE_LACKS_PWD_REENTRANT_FUNCTIONS */ 00096 # else 00097 ACE_UNUSED_ARG (name); 00098 ACE_UNUSED_ARG (pwent); 00099 ACE_UNUSED_ARG (buffer); 00100 ACE_UNUSED_ARG (buflen); 00101 ACE_NOTSUP_RETURN (0); 00102 # endif /* ACE_HAS_REENTRANT_FUNCTIONS */ 00103 #else 00104 ACE_UNUSED_ARG (name); 00105 ACE_UNUSED_ARG (pwent); 00106 ACE_UNUSED_ARG (buffer); 00107 ACE_UNUSED_ARG (buflen); 00108 ACE_NOTSUP_RETURN (0); 00109 #endif /* ACE_HAS_POSIX_GETPWNAM_R */ 00110 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::setpwent | ( | void | ) |
Definition at line 113 of file OS_NS_pwd.inl.
References setpwent().
Referenced by cuserid(), and setpwent().
00114 { 00115 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00116 ::setpwent (); 00117 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00118 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void ACE_OS::endpwent | ( | void | ) |
Definition at line 12 of file OS_NS_pwd.inl.
References endpwent().
Referenced by cuserid(), and endpwent().
00013 { 00014 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00015 ::endpwent (); 00016 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00017 }
ACE_INLINE struct passwd* ACE_OS::getpwent | ( | void | ) |
Definition at line 20 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwent().
Referenced by getpwent().
00021 { 00022 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00023 return ::getpwent (); 00024 #else 00025 ACE_NOTSUP_RETURN (0); 00026 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00027 }
ACE_INLINE struct passwd* ACE_OS::getpwnam | ( | const char * | name | ) |
Definition at line 30 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwnam().
Referenced by getpwnam(), and ACE_Process_Options::setreugid().
00031 { 00032 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00033 return ::getpwnam (name); 00034 # else 00035 ACE_UNUSED_ARG (name); 00036 ACE_NOTSUP_RETURN (0); 00037 #endif /* ACE_LACKS_PWD_FUNCTIONS */ 00038 }
ACE_INLINE struct passwd* ACE_OS::getpwnam_r | ( | const char * | name, | |
struct passwd * | pwent, | |||
char * | buffer, | |||
int | buflen | |||
) |
Definition at line 41 of file OS_NS_pwd.inl.
References ACE_NOTSUP_RETURN, and getpwnam_r().
Referenced by getpwnam_r().
00043 { 00044 #if defined (ACE_HAS_POSIX_GETPWNAM_R) 00045 struct passwd *result = 0; 00046 00047 int const status = ::getpwnam_r (name, pwent, buffer, buflen, &result); 00048 00049 if (status != 0) 00050 { 00051 errno = status; 00052 result = 0; 00053 } 00054 return result; 00055 #elif !defined (ACE_LACKS_PWD_FUNCTIONS) 00056 # if defined (ACE_HAS_REENTRANT_FUNCTIONS) 00057 # if !defined (ACE_LACKS_PWD_REENTRANT_FUNCTIONS) 00058 # if defined (ACE_HAS_PTHREADS) && \ 00059 !defined (ACE_HAS_STHREADS) || \ 00060 defined (HPUX_11) || \ 00061 defined (__USLC__) // Added by Roland Gigler for SCO UnixWare 7. 00062 struct passwd *result; 00063 int status; 00064 # if defined (DIGITAL_UNIX) 00065 ::_Pgetpwnam_r (name, pwent, buffer, buflen, &result); 00066 # else 00067 // VAC++ doesn't correctly grok the ::getpwnam_r - the function is redefined 00068 // in pwd.h, and that redefinition is used here 00069 # if defined (__IBMCPP__) && (__IBMCPP__ >= 400) /* VAC++ 4 */ 00070 status = _posix_getpwnam_r (name, pwent, buffer, buflen, &result); 00071 # else 00072 status = ::getpwnam_r (name, pwent, buffer, buflen, &result); 00073 # endif /* __IBMCPP__ && (__IBMCPP__ >= 400) */ 00074 if (status != 0) 00075 { 00076 errno = status; 00077 result = 0; 00078 } 00079 # endif /* (DIGITAL_UNIX) */ 00080 return result; 00081 # elif defined (AIX) 00082 if (::getpwnam_r (name, pwent, buffer, buflen) == -1) 00083 return 0; 00084 else 00085 return pwent; 00086 # else 00087 return ::getpwnam_r (name, pwent, buffer, buflen); 00088 # endif /* ACE_HAS_PTHREADS */ 00089 # else 00090 ACE_UNUSED_ARG (name); 00091 ACE_UNUSED_ARG (pwent); 00092 ACE_UNUSED_ARG (buffer); 00093 ACE_UNUSED_ARG (buflen); 00094 ACE_NOTSUP_RETURN (0); 00095 # endif /* ! ACE_LACKS_PWD_REENTRANT_FUNCTIONS */ 00096 # else 00097 ACE_UNUSED_ARG (name); 00098 ACE_UNUSED_ARG (pwent); 00099 ACE_UNUSED_ARG (buffer); 00100 ACE_UNUSED_ARG (buflen); 00101 ACE_NOTSUP_RETURN (0); 00102 # endif /* ACE_HAS_REENTRANT_FUNCTIONS */ 00103 #else 00104 ACE_UNUSED_ARG (name); 00105 ACE_UNUSED_ARG (pwent); 00106 ACE_UNUSED_ARG (buffer); 00107 ACE_UNUSED_ARG (buflen); 00108 ACE_NOTSUP_RETURN (0); 00109 #endif /* ACE_HAS_POSIX_GETPWNAM_R */ 00110 }
ACE_INLINE void ACE_OS::setpwent | ( | void | ) |
Definition at line 113 of file OS_NS_pwd.inl.
References setpwent().
Referenced by cuserid(), and setpwent().
00114 { 00115 #if !defined (ACE_LACKS_PWD_FUNCTIONS) 00116 ::setpwent (); 00117 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */ 00118 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::compile | ( | const char * | instring, | |
char * | expbuf, | |||
char * | endbuf | |||
) |
Definition at line 11 of file OS_NS_regex.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and compile().
Referenced by compile(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), and ACE_Local_Name_Space<, ACE_LOCK >::list_types_i().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::compile"); 00014 #if defined (ACE_HAS_REGEX) 00015 ACE_OSCALL_RETURN (::compile (instring, expbuf, endbuf), char *, 0); 00016 #else 00017 ACE_UNUSED_ARG (instring); 00018 ACE_UNUSED_ARG (expbuf); 00019 ACE_UNUSED_ARG (endbuf); 00020 00021 ACE_NOTSUP_RETURN (0); 00022 #endif /* ACE_HAS_REGEX */ 00023 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::step | ( | const char * | str, | |
char * | expbuf | |||
) |
Definition at line 26 of file OS_NS_regex.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and step().
Referenced by ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), and step().
00027 { 00028 ACE_OS_TRACE ("ACE_OS::step"); 00029 #if defined (ACE_HAS_REGEX) 00030 ACE_OSCALL_RETURN (::step (str, expbuf), int, -1); 00031 #else 00032 ACE_UNUSED_ARG (str); 00033 ACE_UNUSED_ARG (expbuf); 00034 00035 ACE_NOTSUP_RETURN (-1); 00036 #endif /* ACE_HAS_REGEX */ 00037 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE char* ACE_OS::compile | ( | const char * | instring, | |
char * | expbuf, | |||
char * | endbuf | |||
) |
Definition at line 11 of file OS_NS_regex.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and compile().
Referenced by compile(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), and ACE_Local_Name_Space<, ACE_LOCK >::list_types_i().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::compile"); 00014 #if defined (ACE_HAS_REGEX) 00015 ACE_OSCALL_RETURN (::compile (instring, expbuf, endbuf), char *, 0); 00016 #else 00017 ACE_UNUSED_ARG (instring); 00018 ACE_UNUSED_ARG (expbuf); 00019 ACE_UNUSED_ARG (endbuf); 00020 00021 ACE_NOTSUP_RETURN (0); 00022 #endif /* ACE_HAS_REGEX */ 00023 }
ACE_INLINE int ACE_OS::step | ( | const char * | str, | |
char * | expbuf | |||
) |
Definition at line 26 of file OS_NS_regex.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and step().
Referenced by ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), and step().
00027 { 00028 ACE_OS_TRACE ("ACE_OS::step"); 00029 #if defined (ACE_HAS_REGEX) 00030 ACE_OSCALL_RETURN (::step (str, expbuf), int, -1); 00031 #else 00032 ACE_UNUSED_ARG (str); 00033 ACE_UNUSED_ARG (expbuf); 00034 00035 ACE_NOTSUP_RETURN (-1); 00036 #endif /* ACE_HAS_REGEX */ 00037 }
ACE_INLINE int ACE_OS::kill | ( | pid_t | pid, | |
int | signum | |||
) |
Definition at line 14 of file OS_NS_signal.inl.
References ACE_NOTSUP_RETURN, and ACE_OS_TRACE.
Referenced by ACE_Process::kill(), ACE::process_active(), ACE_Process::running(), ACE_Process_Manager::terminate(), ACE::terminate_process(), and thr_kill().
00015 { 00016 ACE_OS_TRACE ("ACE_OS::kill"); 00017 #if defined (ACE_LACKS_KILL) 00018 ACE_UNUSED_ARG (pid); 00019 ACE_UNUSED_ARG (signum); 00020 ACE_NOTSUP_RETURN (-1); 00021 #else 00022 ACE_OSCALL_RETURN (::kill (pid, signum), int, -1); 00023 #endif /* ACE_LACKS_KILL */ 00024 }
ACE_INLINE int ACE_OS::pthread_sigmask | ( | int | how, | |
const sigset_t * | nsp, | |||
sigset_t * | osp | |||
) |
Definition at line 27 of file OS_NS_signal.inl.
References ACE_ADAPT_RETVAL, and ACE_NOTSUP_RETURN.
Referenced by ACE_Asynch_Pseudo_Task::svc(), and thr_sigsetmask().
00028 { 00029 #if defined (ACE_HAS_PTHREADS) && !defined (ACE_LACKS_PTHREAD_SIGMASK) 00030 int result; 00031 ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::pthread_sigmask (how, nsp, osp), 00032 result), 00033 int, 00034 -1); 00035 #else /* !ACE_HAS_PTHREADS && !ACE_LACKS_PTHREAD_SIGMASK */ 00036 ACE_UNUSED_ARG (how); 00037 ACE_UNUSED_ARG (nsp); 00038 ACE_UNUSED_ARG (osp); 00039 ACE_NOTSUP_RETURN (-1); 00040 #endif /* ACE_HAS_PTHREADS && !ACE_LACKS_PTHREAD_SIGMASK */ 00041 }
ACE_INLINE int ACE_OS::sigaction | ( | int | signum, | |
const ACE_SIGACTION * | nsa, | |||
ACE_SIGACTION * | osa | |||
) |
Definition at line 44 of file OS_NS_signal.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, SIG_ERR, SIG_IGN, and signal().
Referenced by ACE_Sig_Action::ACE_Sig_Action(), ACE_Sig_Action::register_action(), ACE_Sig_Action::restore_action(), and ACE_Sig_Action::retrieve_action().
00045 { 00046 ACE_OS_TRACE ("ACE_OS::sigaction"); 00047 if (signum == 0) 00048 return 0; 00049 #if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) 00050 struct sigaction sa; 00051 00052 if (osa == 0) 00053 osa = &sa; 00054 00055 if (nsa == 0) 00056 { 00057 osa->sa_handler = ::signal (signum, SIG_IGN); 00058 ::signal (signum, osa->sa_handler); 00059 } 00060 else 00061 osa->sa_handler = ::signal (signum, nsa->sa_handler); 00062 return osa->sa_handler == SIG_ERR ? -1 : 0; 00063 #elif defined (ACE_LACKS_SIGACTION) 00064 ACE_UNUSED_ARG (nsa); 00065 ACE_UNUSED_ARG (osa); 00066 ACE_NOTSUP_RETURN (-1); 00067 #elif !defined (ACE_HAS_SIGACTION_CONSTP2) 00068 ACE_OSCALL_RETURN (::sigaction (signum, 00069 const_cast<ACE_SIGACTION*> (nsa), 00070 osa), 00071 int, -1); 00072 #else 00073 ACE_OSCALL_RETURN (::sigaction (signum, nsa, osa), int, -1); 00074 #endif /* ACE_WIN32 !ACE_HAS_WINCE */ 00075 }
ACE_INLINE int ACE_OS::sigaddset | ( | sigset_t * | s, | |
int | signum | |||
) |
Definition at line 78 of file OS_NS_signal.inl.
References ACE_NSIG, and ACE_OS_TRACE.
Referenced by ACE_Sig_Set::sig_add(), and ACE_Asynch_Pseudo_Task::svc().
00079 { 00080 ACE_OS_TRACE ("ACE_OS::sigaddset"); 00081 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00082 if (s == 0) 00083 { 00084 errno = EFAULT; 00085 return -1; 00086 } 00087 else if (signum < 1 || signum >= ACE_NSIG) 00088 { 00089 errno = EINVAL; 00090 return -1; // Invalid signum, return error 00091 } 00092 *s |= (1 << (signum - 1)) ; 00093 return 0 ; 00094 #else 00095 ACE_OSCALL_RETURN (::sigaddset (s, signum), int, -1); 00096 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00097 }
ACE_INLINE int ACE_OS::sigdelset | ( | sigset_t * | s, | |
int | signum | |||
) |
Definition at line 100 of file OS_NS_signal.inl.
References ACE_NSIG.
Referenced by ACE_Sig_Set::sig_del().
00101 { 00102 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00103 if (s == 0) 00104 { 00105 errno = EFAULT; 00106 return -1; 00107 } 00108 else if (signum < 1 || signum >= ACE_NSIG) 00109 { 00110 errno = EINVAL; 00111 return -1; // Invalid signum, return error 00112 } 00113 *s &= ~(1 << (signum - 1)) ; 00114 return 0; 00115 #else 00116 ACE_OSCALL_RETURN (::sigdelset (s, signum), int, -1); 00117 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00118 }
ACE_INLINE int ACE_OS::sigemptyset | ( | sigset_t * | s | ) |
Definition at line 121 of file OS_NS_signal.inl.
Referenced by ACE_Log_Msg_Sig_Guard::ACE_Log_Msg_Sig_Guard(), ACE_Sig_Action::ACE_Sig_Action(), ACE_Sig_Set::ACE_Sig_Set(), ACE_Sig_Set::empty_set(), sigsuspend(), ACE_Asynch_Pseudo_Task::svc(), and ACE_Sig_Set::~ACE_Sig_Set().
00122 { 00123 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00124 if (s == 0) 00125 { 00126 errno = EFAULT; 00127 return -1; 00128 } 00129 *s = 0 ; 00130 return 0; 00131 #else 00132 ACE_OSCALL_RETURN (::sigemptyset (s), int, -1); 00133 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00134 }
ACE_INLINE int ACE_OS::sigfillset | ( | sigset_t * | s | ) |
Definition at line 137 of file OS_NS_signal.inl.
Referenced by ACE_Sig_Set::ACE_Sig_Set(), ACE_Sig_Set::fill_set(), and ACE_OS_Object_Manager::init().
00138 { 00139 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00140 if (s == 0) 00141 { 00142 errno = EFAULT; 00143 return -1; 00144 } 00145 *s = ~(sigset_t) 0; 00146 return 0 ; 00147 #else 00148 ACE_OSCALL_RETURN (::sigfillset (s), int, -1); 00149 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00150 }
ACE_INLINE int ACE_OS::sigismember | ( | sigset_t * | s, | |
int | signum | |||
) |
Definition at line 153 of file OS_NS_signal.inl.
References ACE_NSIG.
Referenced by ACE_Sig_Set::is_member().
00154 { 00155 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00156 if (s == 0) 00157 { 00158 errno = EFAULT; 00159 return -1; 00160 } 00161 else if (signum < 1 || signum >= ACE_NSIG) 00162 { 00163 errno = EINVAL; 00164 return -1; // Invalid signum, return error 00165 } 00166 return ((*s & (1 << (signum - 1))) != 0) ; 00167 #else 00168 # if defined (ACE_HAS_SIGISMEMBER_BUG) 00169 if (signum < 1 || signum >= ACE_NSIG) 00170 { 00171 errno = EINVAL; 00172 return -1; // Invalid signum, return error 00173 } 00174 # endif /* ACE_HAS_SIGISMEMBER_BUG */ 00175 ACE_OSCALL_RETURN (::sigismember (s, signum), int, -1); 00176 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00177 }
ACE_INLINE ACE_SignalHandler ACE_OS::signal | ( | int | signum, | |
ACE_SignalHandler | ||||
) |
Definition at line 180 of file OS_NS_signal.inl.
References ACE_NOTSUP_RETURN.
Referenced by ACE::daemonize(), and sigaction().
00181 { 00182 if (signum == 0) 00183 return 0; 00184 else 00185 # if defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) || !defined (ACE_LACKS_UNIX_SIGNALS) 00186 # if !defined (ACE_HAS_TANDEM_SIGNALS) && !defined (ACE_HAS_LYNXOS_SIGNALS) 00187 return ::signal (signum, func); 00188 # else 00189 return (ACE_SignalHandler) ::signal (signum, (void (*)(int)) func); 00190 # endif /* !ACE_HAS_TANDEM_SIGNALS */ 00191 #else 00192 // @@ WINCE: Don't know how to implement signal on WinCE (yet.) 00193 ACE_UNUSED_ARG (signum); 00194 ACE_UNUSED_ARG (func); 00195 ACE_NOTSUP_RETURN (0); // Should return SIG_ERR but it is not defined on WinCE. 00196 #endif /* defined (ACE_WIN32) && !defined (ACE_HAS_WINCE) || !defined (ACE_LACKS_UNIX_SIGNALS) */ 00197 }
ACE_INLINE int ACE_OS::sigprocmask | ( | int | how, | |
const sigset_t * | nsp, | |||
sigset_t * | osp | |||
) |
Definition at line 200 of file OS_NS_signal.inl.
References ACE_NOTSUP_RETURN.
Referenced by ACE_Log_Msg_Sig_Guard::ACE_Log_Msg_Sig_Guard(), ACE_Sig_Guard::ACE_Sig_Guard(), ACE_Log_Msg_Sig_Guard::~ACE_Log_Msg_Sig_Guard(), and ACE_Sig_Guard::~ACE_Sig_Guard().
00201 { 00202 #if defined (ACE_LACKS_SIGSET) || defined (ACE_LACKS_SIGSET_DEFINITIONS) 00203 ACE_UNUSED_ARG (how); 00204 ACE_UNUSED_ARG (nsp); 00205 ACE_UNUSED_ARG (osp); 00206 ACE_NOTSUP_RETURN (-1); 00207 #else 00208 ACE_OSCALL_RETURN (::sigprocmask (how, nsp, osp), int, -1); 00209 #endif /* ACE_LACKS_SIGSET || ACE_LACKS_SIGSET_DEFINITIONS */ 00210 }
ACE_INLINE int ACE_OS::sigsuspend | ( | const sigset_t * | set | ) |
Definition at line 213 of file OS_NS_signal.inl.
References ACE_NOTSUP_RETURN, and sigemptyset().
00214 { 00215 #if defined (ACE_HAS_SIGSUSPEND) 00216 sigset_t s; 00217 00218 if (sigset == 0) 00219 { 00220 sigset = &s; 00221 ACE_OS::sigemptyset (&s); 00222 } 00223 ACE_OSCALL_RETURN (::sigsuspend (sigset), int, -1); 00224 #else 00225 ACE_UNUSED_ARG (sigset); 00226 ACE_NOTSUP_RETURN (-1); 00227 #endif /* ACE_HAS_SIGSUSPEND */ 00228 }
ACE_Export int ACE_OS::fprintf | ( | FILE * | fp, | |
const char * | format, | |||
... | ||||
) |
Definition at line 264 of file OS_NS_stdio.cpp.
References vfprintf().
Referenced by ACE_Service_Type::dump(), ACE_Svc_Conf_Lexer::input(), ACE_Log_Msg::log(), ACE_Service_Config::open_i(), ACE_Name_Options::parse_args(), ACE_Log_Record::print(), ACE_OS_Object_Manager::print_error_message(), ACE_Stats::print_summary(), socket_fini(), and socket_init().
00265 { 00266 // ACE_OS_TRACE ("ACE_OS::fprintf"); 00267 int result = 0; 00268 va_list ap; 00269 va_start (ap, format); 00270 result = ACE_OS::vfprintf (fp, format, ap); 00271 va_end (ap); 00272 return result; 00273 }
ACE_Export int ACE_OS::asprintf | ( | char ** | bufp, | |
const char * | format, | |||
... | ||||
) |
Definition at line 290 of file OS_NS_stdio.cpp.
References vasprintf().
00291 { 00292 // ACE_OS_TRACE ("ACE_OS::asprintf"); 00293 int result; 00294 va_list ap; 00295 va_start (ap, format); 00296 result = ACE_OS::vasprintf (bufp, format, ap); 00297 va_end (ap); 00298 return result; 00299 }
ACE_Export int ACE_OS::printf | ( | const char * | format, | |
... | ||||
) |
Definition at line 316 of file OS_NS_stdio.cpp.
References vprintf().
Referenced by ACE_Log_Msg::close(), and ACE_Throughput_Stats::sample().
00317 { 00318 // ACE_OS_TRACE ("ACE_OS::printf"); 00319 int result; 00320 va_list ap; 00321 va_start (ap, format); 00322 result = ACE_OS::vprintf (format, ap); 00323 va_end (ap); 00324 return result; 00325 }
ACE_Export int ACE_OS::snprintf | ( | char * | buf, | |
size_t | maxlen, | |||
const char * | format, | |||
... | ||||
) |
Definition at line 342 of file OS_NS_stdio.cpp.
References vsnprintf().
Referenced by ACE_Log_Msg::log().
00343 { 00344 // ACE_OS_TRACE ("ACE_OS::snprintf"); 00345 int result; 00346 va_list ap; 00347 va_start (ap, format); 00348 result = ACE_OS::vsnprintf (buf, maxlen, format, ap); 00349 va_end (ap); 00350 return result; 00351 }
ACE_Export int ACE_OS::sprintf | ( | char * | buf, | |
const char * | format, | |||
... | ||||
) |
Definition at line 368 of file OS_NS_stdio.cpp.
References vsprintf().
Referenced by ACE_MEM_Acceptor::accept(), ACE_Message_Queue< ACE_SYNCH_USE >::ACE_Message_Queue(), ACE_INET_Addr::addr_to_string(), dlerror(), ACE_Ini_ImpExp::export_section(), ACE_Registry_ImpExp::export_section(), ACE::format_hexdump(), ACE_Log_Record::format_msg(), ACE_Utils::UUID_Generator::generate_UUID(), ACE_INET_Addr::get_host_addr(), getmacaddress(), ACE_Logging_Strategy::handle_timeout(), inet_ntop(), ACE_Stream_Type::info(), ACE_Module_Type::info(), ACE_Service_Manager::info(), ACE_Naming_Context::info(), ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info(), ACE_Oneshot_Acceptor< SVC_HANDLER, >::info(), ACE_Strategy_Acceptor< SVC_HANDLER, >::info(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info(), ACE::ldfind(), ACE_Log_Msg::log(), ACE_Log_Msg::log_hexdump(), ACE_High_Res_Timer::print_ave(), ACE_Stats::print_summary(), ACE_High_Res_Timer::print_total(), ACE_Process_Options::setenv(), shm_open(), shm_unlink(), ACE::sock_error(), socket_fini(), socket_init(), ACE_Process::spawn(), strerror(), ACE::timestamp(), ACE_Utils::UUID::to_string(), uname(), and unique_name().
00369 { 00370 // ACE_OS_TRACE ("ACE_OS::sprintf"); 00371 int result; 00372 va_list ap; 00373 va_start (ap, format); 00374 result = ACE_OS::vsprintf (buf, format, ap); 00375 va_end (ap); 00376 return result; 00377 }
ACE_Export int ACE_OS::vasprintf_emulation | ( | char ** | bufp, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 395 of file OS_NS_stdio.cpp.
References malloc(), va_copy, and vsnprintf().
Referenced by vasprintf().
00396 { 00397 int size; 00398 00399 va_list ap; 00400 va_copy (ap, argptr); 00401 size = ACE_OS::vsnprintf(0, 0, format, ap); 00402 va_end (ap); 00403 00404 if (size != -1) 00405 { 00406 char *buf = reinterpret_cast<char*>(ACE_OS::malloc(size + 1)); 00407 if (!buf) 00408 return -1; 00409 00410 va_list aq; 00411 va_copy (aq, argptr); 00412 size = ACE_OS::vsnprintf(buf, size + 1, format, aq); 00413 va_end (aq); 00414 00415 if (size != -1) 00416 *bufp = buf; 00417 } 00418 00419 return size; 00420 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::clearerr | ( | FILE * | fp | ) |
Definition at line 344 of file OS_NS_stdio.inl.
References ace_clearerr_helper().
Referenced by ace_clearerr_helper(), and ACE_Svc_Conf_Lexer::input().
00345 { 00346 ace_clearerr_helper (fp); 00347 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::cuserid | ( | char * | user, | |
size_t | maxlen = ACE_MAX_USERID | |||
) |
Definition at line 352 of file OS_NS_stdio.inl.
References ace_cuserid(), ACE_NOTSUP_RETURN, ACE_OS_TRACE, endpwent(), geteuid(), setpwent(), strcpy(), and strlen().
Referenced by ace_cuserid().
00353 { 00354 ACE_OS_TRACE ("ACE_OS::cuserid"); 00355 #if defined (ACE_VXWORKS) 00356 ACE_UNUSED_ARG (maxlen); 00357 if (user == 0) 00358 { 00359 // Require that the user field be non-null, i.e., don't 00360 // allocate or use static storage. 00361 ACE_NOTSUP_RETURN (0); 00362 } 00363 else 00364 { 00365 ::remCurIdGet (user, 0); 00366 return user; 00367 } 00368 #elif defined (__QNXNTO__) || defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) 00369 ACE_UNUSED_ARG (user); 00370 ACE_UNUSED_ARG (maxlen); 00371 ACE_NOTSUP_RETURN (0); 00372 #elif defined (ACE_WIN32) 00373 BOOL result = GetUserNameA (user, (u_long *) &maxlen); 00374 if (result == FALSE) 00375 ACE_FAIL_RETURN (0); 00376 else 00377 return user; 00378 #elif defined (ACE_HAS_ALT_CUSERID) 00379 # if defined (ACE_LACKS_PWD_FUNCTIONS) 00380 # error Cannot use alternate cuserid() without POSIX password functions! 00381 # endif /* ACE_LACKS_PWD_FUNCTIONS */ 00382 00383 // POSIX.1 dropped the cuserid() function. 00384 // GNU GLIBC and other platforms correctly deprecate the cuserid() 00385 // function. 00386 00387 if (maxlen == 0) 00388 { 00389 // It doesn't make sense to have a zero length user ID. 00390 errno = EINVAL; 00391 return 0; 00392 } 00393 00394 struct passwd *pw = 0; 00395 00396 // Make sure the file pointer is at the beginning of the password file 00397 ACE_OS::setpwent (); 00398 // Should use ACE_OS::setpwent() but I didn't want to move this 00399 // method after it. 00400 00401 // Use the effective user ID to determine the user name. 00402 pw = ::getpwuid (ACE_OS::geteuid ()); 00403 00404 // Make sure the password file is closed. 00405 ACE_OS::endpwent (); 00406 00407 if (pw == 0) 00408 { 00409 errno = ENOENT; 00410 return 0; 00411 } 00412 00413 size_t max_length = 0; 00414 char *userid = 0; 00415 00416 if (user == 0) 00417 { 00418 // Not reentrant/thread-safe, but nothing else can be done if a 00419 // zero pointer was passed in as the destination. 00420 00421 #if defined (_POSIX_SOURCE) && defined (L_cuserid) 00422 const size_t ACE_L_cuserid = L_cuserid; 00423 #else 00424 const size_t ACE_L_cuserid = 9; // 8 character user ID + NULL 00425 #endif /* _POSIX_SOURCE */ 00426 00427 static char tmp[ACE_L_cuserid] = { '\0' }; 00428 max_length = ACE_L_cuserid - 1; // Do not include NULL in length 00429 00430 userid = tmp; 00431 } 00432 else 00433 { 00434 max_length = maxlen; 00435 userid = user; 00436 } 00437 00438 // Extract the user name from the passwd structure. 00439 if (ACE_OS::strlen (pw->pw_name) <= max_length) 00440 { 00441 return ACE_OS::strcpy (userid, pw->pw_name); 00442 } 00443 else 00444 { 00445 errno = ENOSPC; // Buffer is not large enough. 00446 return 0; 00447 } 00448 #else 00449 // Hackish because of missing buffer size! 00450 ACE_UNUSED_ARG (maxlen); 00451 ACE_OSCALL_RETURN (::ace_cuserid(user), char*, 0); 00452 #endif /* ACE_VXWORKS */ 00453 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fclose | ( | FILE * | fp | ) |
Definition at line 490 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fclose().
Referenced by access(), ACE::count_interfaces(), ACE_Ini_ImpExp::export_config(), ACE_Registry_ImpExp::export_config(), fclose(), ACE_Capabilities::getent(), ACE_Logging_Strategy::handle_timeout(), ACE_Ini_ImpExp::import_config(), ACE_Registry_ImpExp::import_config(), ACE_Logging_Strategy::init(), ACE_Service_Gestalt::init_i(), ACE_Log_Msg::msg_ostream(), ACE_Service_Config::open_i(), ACE_Service_Gestalt::process_file(), ACE_Log_Msg::~ACE_Log_Msg(), and ACE_Read_Buffer::~ACE_Read_Buffer().
00491 { 00492 ACE_OS_TRACE ("ACE_OS::fclose"); 00493 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fclose (fp), int, -1); 00494 }
ACE_NAMESPACE_INLINE_FUNCTION FILE* ACE_OS::fdopen | ( | ACE_HANDLE | handle, | |
const ACE_TCHAR * | mode | |||
) |
Definition at line 497 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, ACE_TEXT_ALWAYS_WCHAR, and fdopen().
Referenced by fdopen().
00498 { 00499 ACE_OS_TRACE ("ACE_OS::fdopen"); 00500 #if defined (ACE_HAS_WINCE) 00501 ACE_OSCALL_RETURN (::_wfdopen (handle, ACE_TEXT_ALWAYS_WCHAR (mode)), 00502 FILE*, 00503 0); 00504 #elif defined (ACE_WIN32) 00505 // kernel file handle -> FILE* conversion... 00506 // Options: _O_APPEND, _O_RDONLY and _O_TEXT are lost 00507 00508 FILE * file = 0; 00509 00510 int const crt_handle = ::_open_osfhandle (intptr_t (handle), 0); 00511 00512 if (crt_handle != -1) 00513 { 00514 # if defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR) 00515 file = ::_fdopen (crt_handle, const_cast<ACE_TCHAR *> (mode)); 00516 # elif defined (ACE_HAS_NONCONST_FDOPEN) && defined (ACE_USES_WCHAR) 00517 file = ::_wfdopen (crt_handle, const_cast<ACE_TCHAR *> (mode)); 00518 # elif defined (ACE_USES_WCHAR) 00519 file = ::_wfdopen (crt_handle, mode); 00520 # else 00521 file = ::_fdopen (crt_handle, mode); 00522 # endif /* __BORLANDC__ */ 00523 00524 if (!file) 00525 { 00526 # if defined(__BORLANDC__) 00527 ::_rtl_close (crt_handle); 00528 # else 00529 ::_close (crt_handle); 00530 # endif /* defined(__BORLANDC__) */ 00531 } 00532 } 00533 00534 return file; 00535 #elif defined (ACE_LACKS_FDOPEN) 00536 ACE_UNUSED_ARG (handle); 00537 ACE_UNUSED_ARG (mode); 00538 ACE_NOTSUP_RETURN (0); 00539 #else 00540 ACE_OSCALL_RETURN 00541 (::fdopen (handle, ACE_TEXT_ALWAYS_CHAR (mode)), FILE *, 0); 00542 #endif /* ACE_HAS_WINCE */ 00543 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fflush | ( | FILE * | fp | ) |
Definition at line 546 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fflush().
Referenced by fflush(), and ACE_Log_Record::print().
00547 { 00548 ACE_OS_TRACE ("ACE_OS::fflush"); 00549 #if defined (ACE_VXWORKS) 00550 if (fp == 0) 00551 { 00552 // Do not allow fflush(0) on VxWorks 00553 return 0; 00554 } 00555 #endif /* ACE_VXWORKS */ 00556 00557 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fflush (fp), int, -1); 00558 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fgetc | ( | FILE * | fp | ) |
Definition at line 561 of file OS_NS_stdio.inl.
References ace_fgetc_helper().
Referenced by ace_fgetc_helper(), and ACE_Capabilities::getline().
00562 { 00563 return ace_fgetc_helper (fp); 00564 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getc | ( | FILE * | fp | ) |
Definition at line 567 of file OS_NS_stdio.inl.
References ace_getc_helper().
Referenced by ace_getc_helper(), and ACE_Read_Buffer::rec_read().
00568 { 00569 return ace_getc_helper (fp); 00570 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fgetpos | ( | FILE * | fp, | |
fpos_t * | pos | |||
) |
Definition at line 573 of file OS_NS_stdio.inl.
References fgetpos().
Referenced by fgetpos().
00574 { 00575 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgetpos (fp, pos), int, -1); 00576 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::fgets | ( | char * | buf, | |
int | size, | |||
FILE * | fp | |||
) |
Definition at line 579 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fgets().
Referenced by fgets(), ACE_Ini_ImpExp::import_config(), and ACE_Registry_ImpExp::import_config().
00580 { 00581 ACE_OS_TRACE ("ACE_OS::fgets"); 00582 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgets (buf, size, fp), char *, 0); 00583 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_init | ( | ace_flock_t * | lock, | |
int | flags = 0 , |
|||
const ACE_TCHAR * | name = 0 , |
|||
mode_t | perms = 0 | |||
) |
Definition at line 90 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_OS::ace_flock_t::handle_, ACE_OS::ace_flock_t::lockname_, open(), and strdup().
Referenced by ACE_File_Lock::ACE_File_Lock(), and ACE_File_Lock::open().
00094 { 00095 ACE_OS_TRACE ("ACE_OS::flock_init"); 00096 #if defined (ACE_WIN32) 00097 // Once initialized, these values are never changed. 00098 lock->overlapped_.Internal = 0; 00099 lock->overlapped_.InternalHigh = 0; 00100 lock->overlapped_.OffsetHigh = 0; 00101 lock->overlapped_.hEvent = 0; 00102 #endif /* ACE_WIN32 */ 00103 lock->handle_ = ACE_INVALID_HANDLE; 00104 lock->lockname_ = 0; 00105 00106 if (name != 0) 00107 { 00108 ACE_OSCALL (ACE_OS::open (name, flags, perms), 00109 ACE_HANDLE, 00110 ACE_INVALID_HANDLE, 00111 lock->handle_); 00112 if (lock->handle_ != ACE_INVALID_HANDLE) 00113 lock->lockname_ = ACE_OS::strdup (name); 00114 return lock->handle_ == ACE_INVALID_HANDLE ? -1 : 0; 00115 } 00116 else 00117 return 0; 00118 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_destroy | ( | ace_flock_t * | lock, | |
int | unlink_file = 1 | |||
) |
Definition at line 158 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, close(), flock_unlock(), free(), ACE_OS::ace_flock_t::handle_, and unlink().
Referenced by ACE_File_Lock::remove().
00160 { 00161 ACE_OS_TRACE ("ACE_OS::flock_destroy"); 00162 if (lock->handle_ != ACE_INVALID_HANDLE) 00163 { 00164 ACE_OS::flock_unlock (lock); 00165 // Close the handle. 00166 ACE_OS::close (lock->handle_); 00167 lock->handle_ = ACE_INVALID_HANDLE; 00168 if (lock->lockname_ != 0) 00169 { 00170 if (unlink_file) 00171 ACE_OS::unlink (lock->lockname_); 00172 ACE_OS::free ( 00173 static_cast<void *> (const_cast<ACE_TCHAR *> (lock->lockname_))); 00174 } 00175 lock->lockname_ = 0; 00176 } 00177 return 0; 00178 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_rdlock | ( | ace_flock_t * | lock, | |
short | whence = 0 , |
|||
ACE_OFF_T | start = 0 , |
|||
ACE_OFF_T | len = 0 | |||
) |
Definition at line 181 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::acquire_read().
00185 { 00186 ACE_OS_TRACE ("ACE_OS::flock_rdlock"); 00187 #if defined (ACE_LACKS_FILELOCKS) 00188 ACE_UNUSED_ARG (lock); 00189 ACE_UNUSED_ARG (whence); 00190 ACE_UNUSED_ARG (start); 00191 ACE_UNUSED_ARG (len); 00192 ACE_NOTSUP_RETURN (-1); 00193 #elif defined (ACE_WIN32) 00194 ACE_OS::flock_adjust_params (lock, whence, start, len); 00195 DWORD low_len = ACE_LOW_PART (len); 00196 DWORD high_len = ACE_HIGH_PART (len); 00197 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00198 0, 00199 0, 00200 low_len, 00201 high_len, 00202 &lock->overlapped_), 00203 ace_result_), int, -1); 00204 #else 00205 lock->lock_.l_whence = whence; 00206 lock->lock_.l_start = start; 00207 lock->lock_.l_len = len; 00208 lock->lock_.l_type = F_RDLCK; // set read lock 00209 // block, if no access 00210 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, 00211 reinterpret_cast<long> (&lock->lock_)), 00212 int, -1); 00213 #endif /* ACE_WIN32 */ 00214 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_tryrdlock | ( | ace_flock_t * | lock, | |
short | whence = 0 , |
|||
ACE_OFF_T | start = 0 , |
|||
ACE_OFF_T | len = 0 | |||
) |
Definition at line 217 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, EBUSY, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::tryacquire_read().
00221 { 00222 ACE_OS_TRACE ("ACE_OS::ace_flock_tryrdlock"); 00223 #if defined (ACE_LACKS_FILELOCKS) 00224 ACE_UNUSED_ARG (lock); 00225 ACE_UNUSED_ARG (whence); 00226 ACE_UNUSED_ARG (start); 00227 ACE_UNUSED_ARG (len); 00228 ACE_NOTSUP_RETURN (-1); 00229 #elif defined (ACE_WIN32) 00230 ACE_OS::flock_adjust_params (lock, whence, start, len); 00231 DWORD low_len = ACE_LOW_PART (len); 00232 DWORD high_len = ACE_HIGH_PART (len); 00233 ACE_WIN32CALL_RETURN ( 00234 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00235 LOCKFILE_FAIL_IMMEDIATELY, 00236 0, 00237 low_len, 00238 high_len, 00239 &lock->overlapped_), 00240 ace_result_), int, -1); 00241 #else 00242 lock->lock_.l_whence = whence; 00243 lock->lock_.l_start = start; 00244 lock->lock_.l_len = len; 00245 lock->lock_.l_type = F_RDLCK; // set read lock 00246 00247 int result = 0; 00248 // Does not block, if no access, returns -1 and set errno = EBUSY; 00249 ACE_OSCALL (ACE_OS::fcntl (lock->handle_, F_SETLK, 00250 reinterpret_cast<long> (&lock->lock_)), 00251 int, -1, result); 00252 00253 if (result == -1 && (errno == EACCES || errno == EAGAIN)) 00254 errno = EBUSY; 00255 00256 return result; 00257 #endif /* ACE_WIN32 */ 00258 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_trywrlock | ( | ace_flock_t * | lock, | |
short | whence = 0 , |
|||
ACE_OFF_T | start = 0 , |
|||
ACE_OFF_T | len = 0 | |||
) |
Definition at line 261 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, EBUSY, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::tryacquire_write(), and ACE_File_Lock::tryacquire_write_upgrade().
00265 { 00266 ACE_OS_TRACE ("ACE_OS::ace_flock_trywrlock"); 00267 #if defined (ACE_LACKS_FILELOCKS) 00268 ACE_UNUSED_ARG (lock); 00269 ACE_UNUSED_ARG (whence); 00270 ACE_UNUSED_ARG (start); 00271 ACE_UNUSED_ARG (len); 00272 ACE_NOTSUP_RETURN (-1); 00273 #elif defined (ACE_WIN32) 00274 ACE_OS::flock_adjust_params (lock, whence, start, len); 00275 DWORD low_len = ACE_LOW_PART (len); 00276 DWORD high_len = ACE_HIGH_PART (len); 00277 ACE_WIN32CALL_RETURN ( 00278 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00279 LOCKFILE_FAIL_IMMEDIATELY | LOCKFILE_EXCLUSIVE_LOCK, 00280 0, 00281 low_len, 00282 high_len, 00283 &lock->overlapped_), 00284 ace_result_), int, -1); 00285 #else 00286 lock->lock_.l_whence = whence; 00287 lock->lock_.l_start = start; 00288 lock->lock_.l_len = len; 00289 lock->lock_.l_type = F_WRLCK; // set write lock 00290 00291 int result = 0; 00292 // Does not block, if no access, returns -1 and set errno = EBUSY; 00293 ACE_OSCALL (ACE_OS::fcntl (lock->handle_, 00294 F_SETLK, 00295 reinterpret_cast<long> (&lock->lock_)), 00296 int, -1, result); 00297 00298 if (result == -1 && (errno == EACCES || errno == EAGAIN)) 00299 errno = EBUSY; 00300 00301 return result; 00302 #endif /* ACE_WIN32 */ 00303 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_unlock | ( | ace_flock_t * | lock, | |
short | whence = 0 , |
|||
ACE_OFF_T | start = 0 , |
|||
ACE_OFF_T | len = 0 | |||
) |
Definition at line 121 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by flock_destroy(), and ACE_File_Lock::release().
00125 { 00126 ACE_OS_TRACE ("ACE_OS::flock_unlock"); 00127 #if defined (ACE_LACKS_FILELOCKS) 00128 ACE_UNUSED_ARG (lock); 00129 ACE_UNUSED_ARG (whence); 00130 ACE_UNUSED_ARG (start); 00131 ACE_UNUSED_ARG (len); 00132 ACE_NOTSUP_RETURN (-1); 00133 #elif defined (ACE_WIN32) 00134 ACE_OS::flock_adjust_params (lock, whence, start, len); 00135 DWORD low_len = ACE_LOW_PART (len); 00136 DWORD high_len = ACE_HIGH_PART (len); 00137 ACE_WIN32CALL_RETURN ( 00138 ACE_ADAPT_RETVAL (::UnlockFile (lock->handle_, 00139 lock->overlapped_.Offset, 00140 lock->overlapped_.OffsetHigh, 00141 low_len, 00142 high_len), 00143 ace_result_), int, -1); 00144 #else 00145 lock->lock_.l_whence = whence; 00146 lock->lock_.l_start = start; 00147 lock->lock_.l_len = len; 00148 lock->lock_.l_type = F_UNLCK; // Unlock file. 00149 00150 // release lock 00151 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLK, 00152 reinterpret_cast<long> (&lock->lock_)), 00153 int, -1); 00154 #endif /* ACE_WIN32 */ 00155 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::flock_wrlock | ( | ace_flock_t * | lock, | |
short | whence = 0 , |
|||
ACE_OFF_T | start = 0 , |
|||
ACE_OFF_T | len = 0 | |||
) |
Definition at line 306 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::acquire_write().
00310 { 00311 ACE_OS_TRACE ("ACE_OS::flock_wrlock"); 00312 #if defined (ACE_LACKS_FILELOCKS) 00313 ACE_UNUSED_ARG (lock); 00314 ACE_UNUSED_ARG (whence); 00315 ACE_UNUSED_ARG (start); 00316 ACE_UNUSED_ARG (len); 00317 ACE_NOTSUP_RETURN (-1); 00318 #elif defined (ACE_WIN32) 00319 ACE_OS::flock_adjust_params (lock, whence, start, len); 00320 DWORD low_len = ACE_LOW_PART (len); 00321 DWORD high_len = ACE_HIGH_PART (len); 00322 ACE_WIN32CALL_RETURN ( 00323 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00324 LOCKFILE_EXCLUSIVE_LOCK, 00325 0, 00326 low_len, 00327 high_len, 00328 &lock->overlapped_), 00329 ace_result_), int, -1); 00330 #else 00331 lock->lock_.l_whence = whence; 00332 lock->lock_.l_start = start; 00333 lock->lock_.l_len = len; 00334 lock->lock_.l_type = F_WRLCK; // set write lock 00335 // block, if no access 00336 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, 00337 reinterpret_cast<long> (&lock->lock_)), 00338 int, -1); 00339 #endif /* ACE_WIN32 */ 00340 }
ACE_NAMESPACE_INLINE_FUNCTION FILE* ACE_OS::fopen | ( | const char * | filename, | |
const ACE_TCHAR * | mode | |||
) |
Definition at line 597 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, and fopen().
Referenced by access(), ACE::count_interfaces(), ACE_Ini_ImpExp::export_config(), ACE_Registry_ImpExp::export_config(), fopen(), ACE_Capabilities::getent(), ACE_Logging_Strategy::handle_timeout(), ACE_Ini_ImpExp::import_config(), ACE_Registry_ImpExp::import_config(), ACE_Logging_Strategy::init(), ACE_Service_Gestalt::init_i(), ACE::ldopen(), ACE_Service_Config::open_i(), and ACE_Service_Gestalt::process_file().
00598 { 00599 ACE_OS_TRACE ("ACE_OS::fopen"); 00600 ACE_OSCALL_RETURN 00601 (::fopen (filename, ACE_TEXT_ALWAYS_CHAR (mode)), FILE *, 0); 00602 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ungetc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 624 of file OS_NS_stdio.inl.
References ace_ungetc_helper().
Referenced by ace_ungetc_helper(), and ACE_Read_Buffer::rec_read().
00625 { 00626 return ace_ungetc_helper (c, fp); 00627 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fputc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 630 of file OS_NS_stdio.inl.
References ace_fputc_helper().
Referenced by ace_fputc_helper().
00631 { 00632 return ace_fputc_helper (c, fp); 00633 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::putc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 636 of file OS_NS_stdio.inl.
References ace_putc_helper().
Referenced by ace_putc_helper().
00637 { 00638 return ace_putc_helper (c, fp); 00639 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fputs | ( | const char * | s, | |
FILE * | stream | |||
) |
Definition at line 642 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fputs().
Referenced by ACE_Ini_ImpExp::export_section(), ACE_Registry_ImpExp::export_section(), and fputs().
00643 { 00644 ACE_OS_TRACE ("ACE_OS::fputs"); 00645 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fputs (s, stream), int, -1); 00646 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::fread | ( | void * | ptr, | |
size_t | size, | |||
size_t | nelems, | |||
FILE * | fp | |||
) |
Definition at line 658 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fread().
Referenced by fread(), and ACE_Svc_Conf_Lexer::input().
00659 { 00660 ACE_OS_TRACE ("ACE_OS::fread"); 00661 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fread (ptr, size, nelems, fp), 00662 size_t, 00663 0); 00664 }
ACE_NAMESPACE_INLINE_FUNCTION FILE* ACE_OS::freopen | ( | const ACE_TCHAR * | filename, | |
const ACE_TCHAR * | mode, | |||
FILE * | stream | |||
) |
Definition at line 667 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, ACE_TEXT_ALWAYS_WCHAR, and freopen().
Referenced by freopen().
00668 { 00669 ACE_OS_TRACE ("ACE_OS::freopen"); 00670 #if defined (ACE_WIN32) && (defined(ACE_USES_WCHAR) || defined(ACE_HAS_WINCE)) 00671 ACE_OSCALL_RETURN (::_wfreopen (ACE_TEXT_ALWAYS_WCHAR (filename), 00672 ACE_TEXT_ALWAYS_WCHAR (mode), 00673 stream), 00674 FILE *, 0); 00675 #else 00676 ACE_OSCALL_RETURN 00677 (ACE_STD_NAMESPACE::freopen (ACE_TEXT_ALWAYS_CHAR (filename), 00678 ACE_TEXT_ALWAYS_CHAR (mode), 00679 stream), 00680 FILE *, 0); 00681 #endif /* ACE_WIN32 && ACE_USES_WCHAR */ 00682 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fseek | ( | FILE * | fp, | |
long | offset, | |||
int | ptrname | |||
) |
Definition at line 685 of file OS_NS_stdio.inl.
References fseek().
Referenced by fseek(), and rewind().
00686 { 00687 # if defined (ACE_WIN32) 00688 # if SEEK_SET != FILE_BEGIN || SEEK_CUR != FILE_CURRENT || SEEK_END != FILE_END 00689 //#error Windows NT is evil AND rude! 00690 switch (whence) 00691 { 00692 case SEEK_SET: 00693 whence = FILE_BEGIN; 00694 break; 00695 case SEEK_CUR: 00696 whence = FILE_CURRENT; 00697 break; 00698 case SEEK_END: 00699 whence = FILE_END; 00700 break; 00701 default: 00702 errno = EINVAL; 00703 return -1; // rather safe than sorry 00704 } 00705 # endif /* SEEK_SET != FILE_BEGIN || SEEK_CUR != FILE_CURRENT || SEEK_END != FILE_END */ 00706 # endif /* ACE_WIN32 */ 00707 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fseek (fp, offset, whence), int, -1); 00708 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fsetpos | ( | FILE * | fp, | |
fpos_t * | pos | |||
) |
Definition at line 711 of file OS_NS_stdio.inl.
References fsetpos().
Referenced by fsetpos().
00712 { 00713 ACE_OSCALL_RETURN (::fsetpos (fp, pos), int, -1); 00714 }
ACE_NAMESPACE_INLINE_FUNCTION long ACE_OS::ftell | ( | FILE * | fp | ) |
Definition at line 717 of file OS_NS_stdio.inl.
References ftell().
Referenced by ftell(), and ACE_Logging_Strategy::handle_timeout().
00718 { 00719 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::ftell (fp), long, -1); 00720 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::fwrite | ( | const void * | ptr, | |
size_t | size, | |||
size_t | nitems, | |||
FILE * | fp | |||
) |
Definition at line 723 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fwrite().
Referenced by fwrite().
00724 { 00725 ACE_OS_TRACE ("ACE_OS::fwrite"); 00726 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fwrite (ptr, size, nitems, fp), 00727 size_t, 00728 0); 00729 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::perror | ( | const char * | s | ) |
Definition at line 732 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and perror().
Referenced by perror(), and ACE_OS_Object_Manager::print_error_message().
00733 { 00734 ACE_OS_TRACE ("ACE_OS::perror"); 00735 #if defined (ACE_LACKS_PERROR) 00736 ACE_UNUSED_ARG (s); 00737 #else 00738 ::perror (s); 00739 #endif /* ACE_HAS_WINCE */ 00740 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::puts | ( | const char * | s | ) |
Definition at line 759 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and puts().
Referenced by puts().
00760 { 00761 ACE_OS_TRACE ("ACE_OS::puts"); 00762 ACE_OSCALL_RETURN (::puts (s), int, -1); 00763 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::rename | ( | const char * | old_name, | |
const char * | new_name, | |||
int | flags = -1 | |||
) |
Definition at line 781 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_TEXT_CHAR_TO_TCHAR, and rename().
Referenced by ACE_Logging_Strategy::handle_timeout(), and rename().
00784 { 00785 # if defined (ACE_LACKS_RENAME) 00786 ACE_UNUSED_ARG (old_name); 00787 ACE_UNUSED_ARG (new_name); 00788 ACE_UNUSED_ARG (flags); 00789 ACE_NOTSUP_RETURN (-1); 00790 # elif defined (ACE_HAS_WINCE) 00791 // Win CE is always wide-char. 00792 ACE_UNUSED_ARG (flags); 00793 if (0 != MoveFile (ACE_TEXT_CHAR_TO_TCHAR (old_name), 00794 ACE_TEXT_CHAR_TO_TCHAR (new_name))) 00795 ACE_FAIL_RETURN (-1); 00796 return 0; 00797 # elif defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_MOVEFILEEX) 00798 // NT4 (and up) provides a way to rename/move a file with similar semantics 00799 // to what's usually done on UNIX - if there's an existing file with 00800 // <new_name> it is removed before the file is renamed/moved. The 00801 // MOVEFILE_COPY_ALLOWED is specified to allow such a rename across drives. 00802 if (flags == -1) 00803 flags = MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING; 00804 if (::MoveFileExA (old_name, new_name, flags) == 0) 00805 ACE_FAIL_RETURN (-1); 00806 return 0; 00807 # else /* ACE_LACKS_RENAME */ 00808 ACE_UNUSED_ARG (flags); 00809 ACE_OSCALL_RETURN (::rename (old_name, new_name), int, -1); 00810 # endif /* ACE_LACKS_RENAME */ 00811 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::rewind | ( | FILE * | fp | ) |
Definition at line 851 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, fseek(), and rewind().
Referenced by rewind().
00852 { 00853 #if !defined (ACE_HAS_WINCE) 00854 ACE_OS_TRACE ("ACE_OS::rewind"); 00855 ::rewind (fp); 00856 #else 00857 // This isn't perfect since it doesn't reset EOF, but it's probably 00858 // the closest we can get on WINCE. 00859 (void) fseek (fp, 0L, SEEK_SET); 00860 #endif /* ACE_HAS_WINCE */ 00861 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::tempnam | ( | const char * | dir = 0 , |
|
const char * | pfx = 0 | |||
) |
Definition at line 864 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and tempnam().
Referenced by tempnam().
00865 { 00866 ACE_OS_TRACE ("ACE_OS::tempnam"); 00867 #if defined (ACE_LACKS_TEMPNAM) 00868 ACE_UNUSED_ARG (dir); 00869 ACE_UNUSED_ARG (pfx); 00870 ACE_NOTSUP_RETURN (0); 00871 #elif defined (ACE_HAS_NONCONST_TEMPNAM) 00872 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::tempnam (const_cast <char *> (dir), const_cast<char *> (pfx)), char *, 0); 00873 #else /* ACE_LACKS_TEMPNAM */ 00874 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::tempnam (dir, pfx), char *, 0); 00875 #endif /* ACE_LACKS_TEMPNAM */ 00876 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::vasprintf | ( | char ** | bufp, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 916 of file OS_NS_stdio.inl.
References vasprintf(), and vasprintf_emulation().
Referenced by asprintf(), and vasprintf().
00917 { 00918 #if defined (ACE_HAS_VASPRINTF) 00919 return ::vasprintf (bufp, format, argptr); 00920 #else 00921 return ACE_OS::vasprintf_emulation (bufp, format, argptr); 00922 #endif /* ACE_HAS_VASPRINTF */ 00923 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::vprintf | ( | const char * | format, | |
va_list | argptr | |||
) |
Definition at line 938 of file OS_NS_stdio.inl.
References vprintf().
Referenced by printf(), and vprintf().
00939 { 00940 return ::vprintf (format, argptr); 00941 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::vfprintf | ( | FILE * | fp, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 958 of file OS_NS_stdio.inl.
References vfprintf().
Referenced by fprintf(), and vfprintf().
00959 { 00960 return ACE_STD_NAMESPACE::vfprintf (fp, format, argptr); 00961 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::vsprintf | ( | char * | buffer, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 979 of file OS_NS_stdio.inl.
References vsprintf().
Referenced by ACE_Process_Options::command_line(), ACE_Process_Options::setenv(), sprintf(), and vsprintf().
00980 { 00981 return ::vsprintf (buffer, format, argptr); 00982 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::vsnprintf | ( | char * | buffer, | |
size_t | maxlen, | |||
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 1019 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, and vsnprintf().
Referenced by ACE_Process_Options::command_line(), ACE_Process_Options::setenv(), snprintf(), vasprintf_emulation(), and vsnprintf().
01020 { 01021 #if !defined (ACE_LACKS_VSNPRINTF) 01022 int result; 01023 # if 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 01024 // _vsnprintf_s() doesn't report the length needed when it truncates. This 01025 // info is needed and relied on by others things in ACE+TAO, so don't use 01026 // this. There's adequate protection via the maxlen. 01027 result = _vsnprintf_s (buffer, maxlen, _TRUNCATE, format, ap); 01028 # elif !defined (ACE_WIN32) 01029 result = ::vsnprintf (buffer, maxlen, format, ap); 01030 # else 01031 result = ::_vsnprintf (buffer, maxlen, format, ap); 01032 01033 // Win32 doesn't regard a full buffer with no 0-terminate as an overrun. 01034 if (result == static_cast<int> (maxlen)) 01035 buffer[maxlen-1] = '\0'; 01036 01037 // Win32 doesn't 0-terminate the string if it overruns maxlen. 01038 if (result == -1) 01039 buffer[maxlen-1] = '\0'; 01040 # endif 01041 // In out-of-range conditions, C99 defines vsnprintf() to return the number 01042 // of characters that would have been written if enough space was available. 01043 // Earlier variants of the vsnprintf() (e.g. UNIX98) defined it to return 01044 // -1. This method follows the C99 standard, but needs to guess at the 01045 // value; uses maxlen + 1. 01046 if (result == -1) 01047 { 01048 result = static_cast <int> (maxlen + 1); 01049 } 01050 01051 return result; 01052 #elif defined (ACE_HAS_TRIO) 01053 return trio_vsnprintf (buffer, maxlen, format, ap); 01054 #else 01055 ACE_UNUSED_ARG (buffer); 01056 ACE_UNUSED_ARG (maxlen); 01057 ACE_UNUSED_ARG (format); 01058 ACE_UNUSED_ARG (ap); 01059 ACE_NOTSUP_RETURN (-1); 01060 #endif /* ACE_LACKS_VSNPRINTF */ 01061 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::flock_init | ( | ACE_OS::ace_flock_t * | lock, | |
int | flags, | |||
const ACE_TCHAR * | name, | |||
mode_t | perms | |||
) |
Definition at line 90 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_OS::ace_flock_t::handle_, ACE_OS::ace_flock_t::lockname_, open(), and strdup().
Referenced by ACE_File_Lock::ACE_File_Lock(), and ACE_File_Lock::open().
00094 { 00095 ACE_OS_TRACE ("ACE_OS::flock_init"); 00096 #if defined (ACE_WIN32) 00097 // Once initialized, these values are never changed. 00098 lock->overlapped_.Internal = 0; 00099 lock->overlapped_.InternalHigh = 0; 00100 lock->overlapped_.OffsetHigh = 0; 00101 lock->overlapped_.hEvent = 0; 00102 #endif /* ACE_WIN32 */ 00103 lock->handle_ = ACE_INVALID_HANDLE; 00104 lock->lockname_ = 0; 00105 00106 if (name != 0) 00107 { 00108 ACE_OSCALL (ACE_OS::open (name, flags, perms), 00109 ACE_HANDLE, 00110 ACE_INVALID_HANDLE, 00111 lock->handle_); 00112 if (lock->handle_ != ACE_INVALID_HANDLE) 00113 lock->lockname_ = ACE_OS::strdup (name); 00114 return lock->handle_ == ACE_INVALID_HANDLE ? -1 : 0; 00115 } 00116 else 00117 return 0; 00118 }
ACE_INLINE int ACE_OS::flock_unlock | ( | ACE_OS::ace_flock_t * | lock, | |
short | whence, | |||
ACE_OFF_T | start, | |||
ACE_OFF_T | len | |||
) |
Definition at line 121 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by flock_destroy(), and ACE_File_Lock::release().
00125 { 00126 ACE_OS_TRACE ("ACE_OS::flock_unlock"); 00127 #if defined (ACE_LACKS_FILELOCKS) 00128 ACE_UNUSED_ARG (lock); 00129 ACE_UNUSED_ARG (whence); 00130 ACE_UNUSED_ARG (start); 00131 ACE_UNUSED_ARG (len); 00132 ACE_NOTSUP_RETURN (-1); 00133 #elif defined (ACE_WIN32) 00134 ACE_OS::flock_adjust_params (lock, whence, start, len); 00135 DWORD low_len = ACE_LOW_PART (len); 00136 DWORD high_len = ACE_HIGH_PART (len); 00137 ACE_WIN32CALL_RETURN ( 00138 ACE_ADAPT_RETVAL (::UnlockFile (lock->handle_, 00139 lock->overlapped_.Offset, 00140 lock->overlapped_.OffsetHigh, 00141 low_len, 00142 high_len), 00143 ace_result_), int, -1); 00144 #else 00145 lock->lock_.l_whence = whence; 00146 lock->lock_.l_start = start; 00147 lock->lock_.l_len = len; 00148 lock->lock_.l_type = F_UNLCK; // Unlock file. 00149 00150 // release lock 00151 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLK, 00152 reinterpret_cast<long> (&lock->lock_)), 00153 int, -1); 00154 #endif /* ACE_WIN32 */ 00155 }
ACE_INLINE int ACE_OS::flock_destroy | ( | ACE_OS::ace_flock_t * | lock, | |
int | unlink_file | |||
) |
Definition at line 158 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, close(), flock_unlock(), free(), ACE_OS::ace_flock_t::handle_, and unlink().
Referenced by ACE_File_Lock::remove().
00160 { 00161 ACE_OS_TRACE ("ACE_OS::flock_destroy"); 00162 if (lock->handle_ != ACE_INVALID_HANDLE) 00163 { 00164 ACE_OS::flock_unlock (lock); 00165 // Close the handle. 00166 ACE_OS::close (lock->handle_); 00167 lock->handle_ = ACE_INVALID_HANDLE; 00168 if (lock->lockname_ != 0) 00169 { 00170 if (unlink_file) 00171 ACE_OS::unlink (lock->lockname_); 00172 ACE_OS::free ( 00173 static_cast<void *> (const_cast<ACE_TCHAR *> (lock->lockname_))); 00174 } 00175 lock->lockname_ = 0; 00176 } 00177 return 0; 00178 }
ACE_INLINE int ACE_OS::flock_rdlock | ( | ACE_OS::ace_flock_t * | lock, | |
short | whence, | |||
ACE_OFF_T | start, | |||
ACE_OFF_T | len | |||
) |
Definition at line 181 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::acquire_read().
00185 { 00186 ACE_OS_TRACE ("ACE_OS::flock_rdlock"); 00187 #if defined (ACE_LACKS_FILELOCKS) 00188 ACE_UNUSED_ARG (lock); 00189 ACE_UNUSED_ARG (whence); 00190 ACE_UNUSED_ARG (start); 00191 ACE_UNUSED_ARG (len); 00192 ACE_NOTSUP_RETURN (-1); 00193 #elif defined (ACE_WIN32) 00194 ACE_OS::flock_adjust_params (lock, whence, start, len); 00195 DWORD low_len = ACE_LOW_PART (len); 00196 DWORD high_len = ACE_HIGH_PART (len); 00197 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00198 0, 00199 0, 00200 low_len, 00201 high_len, 00202 &lock->overlapped_), 00203 ace_result_), int, -1); 00204 #else 00205 lock->lock_.l_whence = whence; 00206 lock->lock_.l_start = start; 00207 lock->lock_.l_len = len; 00208 lock->lock_.l_type = F_RDLCK; // set read lock 00209 // block, if no access 00210 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, 00211 reinterpret_cast<long> (&lock->lock_)), 00212 int, -1); 00213 #endif /* ACE_WIN32 */ 00214 }
ACE_INLINE int ACE_OS::flock_tryrdlock | ( | ACE_OS::ace_flock_t * | lock, | |
short | whence, | |||
ACE_OFF_T | start, | |||
ACE_OFF_T | len | |||
) |
Definition at line 217 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, EBUSY, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::tryacquire_read().
00221 { 00222 ACE_OS_TRACE ("ACE_OS::ace_flock_tryrdlock"); 00223 #if defined (ACE_LACKS_FILELOCKS) 00224 ACE_UNUSED_ARG (lock); 00225 ACE_UNUSED_ARG (whence); 00226 ACE_UNUSED_ARG (start); 00227 ACE_UNUSED_ARG (len); 00228 ACE_NOTSUP_RETURN (-1); 00229 #elif defined (ACE_WIN32) 00230 ACE_OS::flock_adjust_params (lock, whence, start, len); 00231 DWORD low_len = ACE_LOW_PART (len); 00232 DWORD high_len = ACE_HIGH_PART (len); 00233 ACE_WIN32CALL_RETURN ( 00234 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00235 LOCKFILE_FAIL_IMMEDIATELY, 00236 0, 00237 low_len, 00238 high_len, 00239 &lock->overlapped_), 00240 ace_result_), int, -1); 00241 #else 00242 lock->lock_.l_whence = whence; 00243 lock->lock_.l_start = start; 00244 lock->lock_.l_len = len; 00245 lock->lock_.l_type = F_RDLCK; // set read lock 00246 00247 int result = 0; 00248 // Does not block, if no access, returns -1 and set errno = EBUSY; 00249 ACE_OSCALL (ACE_OS::fcntl (lock->handle_, F_SETLK, 00250 reinterpret_cast<long> (&lock->lock_)), 00251 int, -1, result); 00252 00253 if (result == -1 && (errno == EACCES || errno == EAGAIN)) 00254 errno = EBUSY; 00255 00256 return result; 00257 #endif /* ACE_WIN32 */ 00258 }
ACE_INLINE int ACE_OS::flock_trywrlock | ( | ACE_OS::ace_flock_t * | lock, | |
short | whence, | |||
ACE_OFF_T | start, | |||
ACE_OFF_T | len | |||
) |
Definition at line 261 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, EBUSY, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::tryacquire_write(), and ACE_File_Lock::tryacquire_write_upgrade().
00265 { 00266 ACE_OS_TRACE ("ACE_OS::ace_flock_trywrlock"); 00267 #if defined (ACE_LACKS_FILELOCKS) 00268 ACE_UNUSED_ARG (lock); 00269 ACE_UNUSED_ARG (whence); 00270 ACE_UNUSED_ARG (start); 00271 ACE_UNUSED_ARG (len); 00272 ACE_NOTSUP_RETURN (-1); 00273 #elif defined (ACE_WIN32) 00274 ACE_OS::flock_adjust_params (lock, whence, start, len); 00275 DWORD low_len = ACE_LOW_PART (len); 00276 DWORD high_len = ACE_HIGH_PART (len); 00277 ACE_WIN32CALL_RETURN ( 00278 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00279 LOCKFILE_FAIL_IMMEDIATELY | LOCKFILE_EXCLUSIVE_LOCK, 00280 0, 00281 low_len, 00282 high_len, 00283 &lock->overlapped_), 00284 ace_result_), int, -1); 00285 #else 00286 lock->lock_.l_whence = whence; 00287 lock->lock_.l_start = start; 00288 lock->lock_.l_len = len; 00289 lock->lock_.l_type = F_WRLCK; // set write lock 00290 00291 int result = 0; 00292 // Does not block, if no access, returns -1 and set errno = EBUSY; 00293 ACE_OSCALL (ACE_OS::fcntl (lock->handle_, 00294 F_SETLK, 00295 reinterpret_cast<long> (&lock->lock_)), 00296 int, -1, result); 00297 00298 if (result == -1 && (errno == EACCES || errno == EAGAIN)) 00299 errno = EBUSY; 00300 00301 return result; 00302 #endif /* ACE_WIN32 */ 00303 }
ACE_INLINE int ACE_OS::flock_wrlock | ( | ACE_OS::ace_flock_t * | lock, | |
short | whence, | |||
ACE_OFF_T | start, | |||
ACE_OFF_T | len | |||
) |
Definition at line 306 of file OS_NS_stdio.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fcntl(), ACE_OS::ace_flock_t::handle_, and ACE_OS::ace_flock_t::lock_.
Referenced by ACE_File_Lock::acquire_write().
00310 { 00311 ACE_OS_TRACE ("ACE_OS::flock_wrlock"); 00312 #if defined (ACE_LACKS_FILELOCKS) 00313 ACE_UNUSED_ARG (lock); 00314 ACE_UNUSED_ARG (whence); 00315 ACE_UNUSED_ARG (start); 00316 ACE_UNUSED_ARG (len); 00317 ACE_NOTSUP_RETURN (-1); 00318 #elif defined (ACE_WIN32) 00319 ACE_OS::flock_adjust_params (lock, whence, start, len); 00320 DWORD low_len = ACE_LOW_PART (len); 00321 DWORD high_len = ACE_HIGH_PART (len); 00322 ACE_WIN32CALL_RETURN ( 00323 ACE_ADAPT_RETVAL (::LockFileEx (lock->handle_, 00324 LOCKFILE_EXCLUSIVE_LOCK, 00325 0, 00326 low_len, 00327 high_len, 00328 &lock->overlapped_), 00329 ace_result_), int, -1); 00330 #else 00331 lock->lock_.l_whence = whence; 00332 lock->lock_.l_start = start; 00333 lock->lock_.l_len = len; 00334 lock->lock_.l_type = F_WRLCK; // set write lock 00335 // block, if no access 00336 ACE_OSCALL_RETURN (ACE_OS::fcntl (lock->handle_, F_SETLKW, 00337 reinterpret_cast<long> (&lock->lock_)), 00338 int, -1); 00339 #endif /* ACE_WIN32 */ 00340 }
ACE_INLINE void ACE_OS::clearerr | ( | FILE * | fp | ) |
Definition at line 344 of file OS_NS_stdio.inl.
References ace_clearerr_helper().
Referenced by ace_clearerr_helper(), and ACE_Svc_Conf_Lexer::input().
00345 { 00346 ace_clearerr_helper (fp); 00347 }
ACE_INLINE char* ACE_OS::cuserid | ( | char * | user, | |
size_t | maxlen | |||
) |
Definition at line 352 of file OS_NS_stdio.inl.
References ace_cuserid(), ACE_NOTSUP_RETURN, ACE_OS_TRACE, endpwent(), geteuid(), setpwent(), strcpy(), and strlen().
Referenced by ace_cuserid().
00353 { 00354 ACE_OS_TRACE ("ACE_OS::cuserid"); 00355 #if defined (ACE_VXWORKS) 00356 ACE_UNUSED_ARG (maxlen); 00357 if (user == 0) 00358 { 00359 // Require that the user field be non-null, i.e., don't 00360 // allocate or use static storage. 00361 ACE_NOTSUP_RETURN (0); 00362 } 00363 else 00364 { 00365 ::remCurIdGet (user, 0); 00366 return user; 00367 } 00368 #elif defined (__QNXNTO__) || defined (ACE_HAS_PHARLAP) || defined (ACE_HAS_WINCE) 00369 ACE_UNUSED_ARG (user); 00370 ACE_UNUSED_ARG (maxlen); 00371 ACE_NOTSUP_RETURN (0); 00372 #elif defined (ACE_WIN32) 00373 BOOL result = GetUserNameA (user, (u_long *) &maxlen); 00374 if (result == FALSE) 00375 ACE_FAIL_RETURN (0); 00376 else 00377 return user; 00378 #elif defined (ACE_HAS_ALT_CUSERID) 00379 # if defined (ACE_LACKS_PWD_FUNCTIONS) 00380 # error Cannot use alternate cuserid() without POSIX password functions! 00381 # endif /* ACE_LACKS_PWD_FUNCTIONS */ 00382 00383 // POSIX.1 dropped the cuserid() function. 00384 // GNU GLIBC and other platforms correctly deprecate the cuserid() 00385 // function. 00386 00387 if (maxlen == 0) 00388 { 00389 // It doesn't make sense to have a zero length user ID. 00390 errno = EINVAL; 00391 return 0; 00392 } 00393 00394 struct passwd *pw = 0; 00395 00396 // Make sure the file pointer is at the beginning of the password file 00397 ACE_OS::setpwent (); 00398 // Should use ACE_OS::setpwent() but I didn't want to move this 00399 // method after it. 00400 00401 // Use the effective user ID to determine the user name. 00402 pw = ::getpwuid (ACE_OS::geteuid ()); 00403 00404 // Make sure the password file is closed. 00405 ACE_OS::endpwent (); 00406 00407 if (pw == 0) 00408 { 00409 errno = ENOENT; 00410 return 0; 00411 } 00412 00413 size_t max_length = 0; 00414 char *userid = 0; 00415 00416 if (user == 0) 00417 { 00418 // Not reentrant/thread-safe, but nothing else can be done if a 00419 // zero pointer was passed in as the destination. 00420 00421 #if defined (_POSIX_SOURCE) && defined (L_cuserid) 00422 const size_t ACE_L_cuserid = L_cuserid; 00423 #else 00424 const size_t ACE_L_cuserid = 9; // 8 character user ID + NULL 00425 #endif /* _POSIX_SOURCE */ 00426 00427 static char tmp[ACE_L_cuserid] = { '\0' }; 00428 max_length = ACE_L_cuserid - 1; // Do not include NULL in length 00429 00430 userid = tmp; 00431 } 00432 else 00433 { 00434 max_length = maxlen; 00435 userid = user; 00436 } 00437 00438 // Extract the user name from the passwd structure. 00439 if (ACE_OS::strlen (pw->pw_name) <= max_length) 00440 { 00441 return ACE_OS::strcpy (userid, pw->pw_name); 00442 } 00443 else 00444 { 00445 errno = ENOSPC; // Buffer is not large enough. 00446 return 0; 00447 } 00448 #else 00449 // Hackish because of missing buffer size! 00450 ACE_UNUSED_ARG (maxlen); 00451 ACE_OSCALL_RETURN (::ace_cuserid(user), char*, 0); 00452 #endif /* ACE_VXWORKS */ 00453 }
ACE_INLINE int ACE_OS::fclose | ( | FILE * | fp | ) |
Definition at line 490 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fclose().
Referenced by access(), ACE::count_interfaces(), ACE_Registry_ImpExp::export_config(), ACE_Ini_ImpExp::export_config(), fclose(), ACE_Capabilities::getent(), ACE_Logging_Strategy::handle_timeout(), ACE_Registry_ImpExp::import_config(), ACE_Ini_ImpExp::import_config(), ACE_Logging_Strategy::init(), ACE_Service_Gestalt::init_i(), ACE_Log_Msg::msg_ostream(), ACE_Service_Config::open_i(), ACE_Service_Gestalt::process_file(), ACE_Log_Msg::~ACE_Log_Msg(), and ACE_Read_Buffer::~ACE_Read_Buffer().
00491 { 00492 ACE_OS_TRACE ("ACE_OS::fclose"); 00493 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fclose (fp), int, -1); 00494 }
ACE_INLINE FILE* ACE_OS::fdopen | ( | ACE_HANDLE | handle, | |
const ACE_TCHAR * | mode | |||
) |
Definition at line 497 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, ACE_TEXT_ALWAYS_WCHAR, and fdopen().
Referenced by fdopen().
00498 { 00499 ACE_OS_TRACE ("ACE_OS::fdopen"); 00500 #if defined (ACE_HAS_WINCE) 00501 ACE_OSCALL_RETURN (::_wfdopen (handle, ACE_TEXT_ALWAYS_WCHAR (mode)), 00502 FILE*, 00503 0); 00504 #elif defined (ACE_WIN32) 00505 // kernel file handle -> FILE* conversion... 00506 // Options: _O_APPEND, _O_RDONLY and _O_TEXT are lost 00507 00508 FILE * file = 0; 00509 00510 int const crt_handle = ::_open_osfhandle (intptr_t (handle), 0); 00511 00512 if (crt_handle != -1) 00513 { 00514 # if defined(ACE_HAS_NONCONST_FDOPEN) && !defined (ACE_USES_WCHAR) 00515 file = ::_fdopen (crt_handle, const_cast<ACE_TCHAR *> (mode)); 00516 # elif defined (ACE_HAS_NONCONST_FDOPEN) && defined (ACE_USES_WCHAR) 00517 file = ::_wfdopen (crt_handle, const_cast<ACE_TCHAR *> (mode)); 00518 # elif defined (ACE_USES_WCHAR) 00519 file = ::_wfdopen (crt_handle, mode); 00520 # else 00521 file = ::_fdopen (crt_handle, mode); 00522 # endif /* __BORLANDC__ */ 00523 00524 if (!file) 00525 { 00526 # if defined(__BORLANDC__) 00527 ::_rtl_close (crt_handle); 00528 # else 00529 ::_close (crt_handle); 00530 # endif /* defined(__BORLANDC__) */ 00531 } 00532 } 00533 00534 return file; 00535 #elif defined (ACE_LACKS_FDOPEN) 00536 ACE_UNUSED_ARG (handle); 00537 ACE_UNUSED_ARG (mode); 00538 ACE_NOTSUP_RETURN (0); 00539 #else 00540 ACE_OSCALL_RETURN 00541 (::fdopen (handle, ACE_TEXT_ALWAYS_CHAR (mode)), FILE *, 0); 00542 #endif /* ACE_HAS_WINCE */ 00543 }
ACE_INLINE int ACE_OS::fflush | ( | FILE * | fp | ) |
Definition at line 546 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fflush().
Referenced by fflush(), and ACE_Log_Record::print().
00547 { 00548 ACE_OS_TRACE ("ACE_OS::fflush"); 00549 #if defined (ACE_VXWORKS) 00550 if (fp == 0) 00551 { 00552 // Do not allow fflush(0) on VxWorks 00553 return 0; 00554 } 00555 #endif /* ACE_VXWORKS */ 00556 00557 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fflush (fp), int, -1); 00558 }
ACE_INLINE int ACE_OS::fgetc | ( | FILE * | fp | ) |
Definition at line 561 of file OS_NS_stdio.inl.
References ace_fgetc_helper().
Referenced by ace_fgetc_helper(), and ACE_Capabilities::getline().
00562 { 00563 return ace_fgetc_helper (fp); 00564 }
ACE_INLINE int ACE_OS::getc | ( | FILE * | fp | ) |
Definition at line 567 of file OS_NS_stdio.inl.
References ace_getc_helper().
Referenced by ace_getc_helper(), and ACE_Read_Buffer::rec_read().
00568 { 00569 return ace_getc_helper (fp); 00570 }
ACE_INLINE int ACE_OS::fgetpos | ( | FILE * | fp, | |
fpos_t * | pos | |||
) |
Definition at line 573 of file OS_NS_stdio.inl.
References fgetpos().
Referenced by fgetpos().
00574 { 00575 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgetpos (fp, pos), int, -1); 00576 }
ACE_INLINE char* ACE_OS::fgets | ( | char * | buf, | |
int | size, | |||
FILE * | fp | |||
) |
Definition at line 579 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fgets().
Referenced by fgets(), ACE_Registry_ImpExp::import_config(), and ACE_Ini_ImpExp::import_config().
00580 { 00581 ACE_OS_TRACE ("ACE_OS::fgets"); 00582 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fgets (buf, size, fp), char *, 0); 00583 }
ACE_INLINE FILE* ACE_OS::fopen | ( | const char * | filename, | |
const ACE_TCHAR * | mode | |||
) |
Definition at line 597 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, and fopen().
Referenced by access(), ACE::count_interfaces(), ACE_Registry_ImpExp::export_config(), ACE_Ini_ImpExp::export_config(), fopen(), ACE_Capabilities::getent(), ACE_Logging_Strategy::handle_timeout(), ACE_Registry_ImpExp::import_config(), ACE_Ini_ImpExp::import_config(), ACE_Logging_Strategy::init(), ACE_Service_Gestalt::init_i(), ACE::ldopen(), ACE_Service_Config::open_i(), and ACE_Service_Gestalt::process_file().
00598 { 00599 ACE_OS_TRACE ("ACE_OS::fopen"); 00600 ACE_OSCALL_RETURN 00601 (::fopen (filename, ACE_TEXT_ALWAYS_CHAR (mode)), FILE *, 0); 00602 }
ACE_INLINE int ACE_OS::ungetc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 624 of file OS_NS_stdio.inl.
References ace_ungetc_helper().
Referenced by ace_ungetc_helper(), and ACE_Read_Buffer::rec_read().
00625 { 00626 return ace_ungetc_helper (c, fp); 00627 }
ACE_INLINE int ACE_OS::fputc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 630 of file OS_NS_stdio.inl.
References ace_fputc_helper().
Referenced by ace_fputc_helper().
00631 { 00632 return ace_fputc_helper (c, fp); 00633 }
ACE_INLINE int ACE_OS::putc | ( | int | c, | |
FILE * | fp | |||
) |
Definition at line 636 of file OS_NS_stdio.inl.
References ace_putc_helper().
Referenced by ace_putc_helper().
00637 { 00638 return ace_putc_helper (c, fp); 00639 }
ACE_INLINE int ACE_OS::fputs | ( | const char * | s, | |
FILE * | stream | |||
) |
Definition at line 642 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fputs().
Referenced by ACE_Registry_ImpExp::export_section(), ACE_Ini_ImpExp::export_section(), and fputs().
00643 { 00644 ACE_OS_TRACE ("ACE_OS::fputs"); 00645 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fputs (s, stream), int, -1); 00646 }
ACE_INLINE size_t ACE_OS::fread | ( | void * | ptr, | |
size_t | size, | |||
size_t | nelems, | |||
FILE * | fp | |||
) |
Definition at line 658 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fread().
Referenced by fread(), and ACE_Svc_Conf_Lexer::input().
00659 { 00660 ACE_OS_TRACE ("ACE_OS::fread"); 00661 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fread (ptr, size, nelems, fp), 00662 size_t, 00663 0); 00664 }
ACE_INLINE FILE* ACE_OS::freopen | ( | const ACE_TCHAR * | filename, | |
const ACE_TCHAR * | mode, | |||
FILE * | stream | |||
) |
Definition at line 667 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, ACE_TEXT_ALWAYS_CHAR, ACE_TEXT_ALWAYS_WCHAR, and freopen().
Referenced by freopen().
00668 { 00669 ACE_OS_TRACE ("ACE_OS::freopen"); 00670 #if defined (ACE_WIN32) && (defined(ACE_USES_WCHAR) || defined(ACE_HAS_WINCE)) 00671 ACE_OSCALL_RETURN (::_wfreopen (ACE_TEXT_ALWAYS_WCHAR (filename), 00672 ACE_TEXT_ALWAYS_WCHAR (mode), 00673 stream), 00674 FILE *, 0); 00675 #else 00676 ACE_OSCALL_RETURN 00677 (ACE_STD_NAMESPACE::freopen (ACE_TEXT_ALWAYS_CHAR (filename), 00678 ACE_TEXT_ALWAYS_CHAR (mode), 00679 stream), 00680 FILE *, 0); 00681 #endif /* ACE_WIN32 && ACE_USES_WCHAR */ 00682 }
ACE_INLINE int ACE_OS::fseek | ( | FILE * | fp, | |
long | offset, | |||
int | whence | |||
) |
Definition at line 685 of file OS_NS_stdio.inl.
References fseek().
Referenced by fseek(), and rewind().
00686 { 00687 # if defined (ACE_WIN32) 00688 # if SEEK_SET != FILE_BEGIN || SEEK_CUR != FILE_CURRENT || SEEK_END != FILE_END 00689 //#error Windows NT is evil AND rude! 00690 switch (whence) 00691 { 00692 case SEEK_SET: 00693 whence = FILE_BEGIN; 00694 break; 00695 case SEEK_CUR: 00696 whence = FILE_CURRENT; 00697 break; 00698 case SEEK_END: 00699 whence = FILE_END; 00700 break; 00701 default: 00702 errno = EINVAL; 00703 return -1; // rather safe than sorry 00704 } 00705 # endif /* SEEK_SET != FILE_BEGIN || SEEK_CUR != FILE_CURRENT || SEEK_END != FILE_END */ 00706 # endif /* ACE_WIN32 */ 00707 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fseek (fp, offset, whence), int, -1); 00708 }
ACE_INLINE int ACE_OS::fsetpos | ( | FILE * | fp, | |
fpos_t * | pos | |||
) |
Definition at line 711 of file OS_NS_stdio.inl.
References fsetpos().
Referenced by fsetpos().
00712 { 00713 ACE_OSCALL_RETURN (::fsetpos (fp, pos), int, -1); 00714 }
ACE_INLINE long ACE_OS::ftell | ( | FILE * | fp | ) |
Definition at line 717 of file OS_NS_stdio.inl.
References ftell().
Referenced by ftell(), and ACE_Logging_Strategy::handle_timeout().
00718 { 00719 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::ftell (fp), long, -1); 00720 }
ACE_INLINE size_t ACE_OS::fwrite | ( | const void * | ptr, | |
size_t | size, | |||
size_t | nitems, | |||
FILE * | fp | |||
) |
Definition at line 723 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and fwrite().
Referenced by fwrite().
00724 { 00725 ACE_OS_TRACE ("ACE_OS::fwrite"); 00726 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::fwrite (ptr, size, nitems, fp), 00727 size_t, 00728 0); 00729 }
ACE_INLINE void ACE_OS::perror | ( | const char * | s | ) |
Definition at line 732 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and perror().
Referenced by perror(), and ACE_OS_Object_Manager::print_error_message().
00733 { 00734 ACE_OS_TRACE ("ACE_OS::perror"); 00735 #if defined (ACE_LACKS_PERROR) 00736 ACE_UNUSED_ARG (s); 00737 #else 00738 ::perror (s); 00739 #endif /* ACE_HAS_WINCE */ 00740 }
ACE_INLINE int ACE_OS::puts | ( | const char * | s | ) |
Definition at line 759 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, and puts().
Referenced by puts().
00760 { 00761 ACE_OS_TRACE ("ACE_OS::puts"); 00762 ACE_OSCALL_RETURN (::puts (s), int, -1); 00763 }
ACE_INLINE int ACE_OS::rename | ( | const char * | old_name, | |
const char * | new_name, | |||
int | flags | |||
) |
Definition at line 781 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_TEXT_CHAR_TO_TCHAR, and rename().
Referenced by ACE_Logging_Strategy::handle_timeout(), and rename().
00784 { 00785 # if defined (ACE_LACKS_RENAME) 00786 ACE_UNUSED_ARG (old_name); 00787 ACE_UNUSED_ARG (new_name); 00788 ACE_UNUSED_ARG (flags); 00789 ACE_NOTSUP_RETURN (-1); 00790 # elif defined (ACE_HAS_WINCE) 00791 // Win CE is always wide-char. 00792 ACE_UNUSED_ARG (flags); 00793 if (0 != MoveFile (ACE_TEXT_CHAR_TO_TCHAR (old_name), 00794 ACE_TEXT_CHAR_TO_TCHAR (new_name))) 00795 ACE_FAIL_RETURN (-1); 00796 return 0; 00797 # elif defined (ACE_WIN32) && !defined (ACE_LACKS_WIN32_MOVEFILEEX) 00798 // NT4 (and up) provides a way to rename/move a file with similar semantics 00799 // to what's usually done on UNIX - if there's an existing file with 00800 // <new_name> it is removed before the file is renamed/moved. The 00801 // MOVEFILE_COPY_ALLOWED is specified to allow such a rename across drives. 00802 if (flags == -1) 00803 flags = MOVEFILE_COPY_ALLOWED | MOVEFILE_REPLACE_EXISTING; 00804 if (::MoveFileExA (old_name, new_name, flags) == 0) 00805 ACE_FAIL_RETURN (-1); 00806 return 0; 00807 # else /* ACE_LACKS_RENAME */ 00808 ACE_UNUSED_ARG (flags); 00809 ACE_OSCALL_RETURN (::rename (old_name, new_name), int, -1); 00810 # endif /* ACE_LACKS_RENAME */ 00811 }
ACE_INLINE void ACE_OS::rewind | ( | FILE * | fp | ) |
Definition at line 851 of file OS_NS_stdio.inl.
References ACE_OS_TRACE, fseek(), and rewind().
Referenced by rewind().
00852 { 00853 #if !defined (ACE_HAS_WINCE) 00854 ACE_OS_TRACE ("ACE_OS::rewind"); 00855 ::rewind (fp); 00856 #else 00857 // This isn't perfect since it doesn't reset EOF, but it's probably 00858 // the closest we can get on WINCE. 00859 (void) fseek (fp, 0L, SEEK_SET); 00860 #endif /* ACE_HAS_WINCE */ 00861 }
ACE_INLINE char* ACE_OS::tempnam | ( | const char * | dir, | |
const char * | pfx | |||
) |
Definition at line 864 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and tempnam().
Referenced by tempnam().
00865 { 00866 ACE_OS_TRACE ("ACE_OS::tempnam"); 00867 #if defined (ACE_LACKS_TEMPNAM) 00868 ACE_UNUSED_ARG (dir); 00869 ACE_UNUSED_ARG (pfx); 00870 ACE_NOTSUP_RETURN (0); 00871 #elif defined (ACE_HAS_NONCONST_TEMPNAM) 00872 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::tempnam (const_cast <char *> (dir), const_cast<char *> (pfx)), char *, 0); 00873 #else /* ACE_LACKS_TEMPNAM */ 00874 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::tempnam (dir, pfx), char *, 0); 00875 #endif /* ACE_LACKS_TEMPNAM */ 00876 }
ACE_INLINE int ACE_OS::vasprintf | ( | char ** | bufp, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 916 of file OS_NS_stdio.inl.
References vasprintf(), and vasprintf_emulation().
Referenced by asprintf(), and vasprintf().
00917 { 00918 #if defined (ACE_HAS_VASPRINTF) 00919 return ::vasprintf (bufp, format, argptr); 00920 #else 00921 return ACE_OS::vasprintf_emulation (bufp, format, argptr); 00922 #endif /* ACE_HAS_VASPRINTF */ 00923 }
ACE_INLINE int ACE_OS::vprintf | ( | const char * | format, | |
va_list | argptr | |||
) |
Definition at line 938 of file OS_NS_stdio.inl.
References vprintf().
Referenced by printf(), and vprintf().
00939 { 00940 return ::vprintf (format, argptr); 00941 }
ACE_INLINE int ACE_OS::vfprintf | ( | FILE * | fp, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 958 of file OS_NS_stdio.inl.
References vfprintf().
Referenced by fprintf(), and vfprintf().
00959 { 00960 return ACE_STD_NAMESPACE::vfprintf (fp, format, argptr); 00961 }
ACE_INLINE int ACE_OS::vsprintf | ( | char * | buffer, | |
const char * | format, | |||
va_list | argptr | |||
) |
Definition at line 979 of file OS_NS_stdio.inl.
References vsprintf().
Referenced by ACE_Process_Options::command_line(), ACE_Process_Options::setenv(), sprintf(), and vsprintf().
00980 { 00981 return ::vsprintf (buffer, format, argptr); 00982 }
ACE_INLINE int ACE_OS::vsnprintf | ( | char * | buffer, | |
size_t | maxlen, | |||
const char * | format, | |||
va_list | ap | |||
) |
Definition at line 1019 of file OS_NS_stdio.inl.
References ACE_NOTSUP_RETURN, and vsnprintf().
Referenced by ACE_Process_Options::command_line(), ACE_Process_Options::setenv(), snprintf(), vasprintf_emulation(), and vsnprintf().
01020 { 01021 #if !defined (ACE_LACKS_VSNPRINTF) 01022 int result; 01023 # if 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 01024 // _vsnprintf_s() doesn't report the length needed when it truncates. This 01025 // info is needed and relied on by others things in ACE+TAO, so don't use 01026 // this. There's adequate protection via the maxlen. 01027 result = _vsnprintf_s (buffer, maxlen, _TRUNCATE, format, ap); 01028 # elif !defined (ACE_WIN32) 01029 result = ::vsnprintf (buffer, maxlen, format, ap); 01030 # else 01031 result = ::_vsnprintf (buffer, maxlen, format, ap); 01032 01033 // Win32 doesn't regard a full buffer with no 0-terminate as an overrun. 01034 if (result == static_cast<int> (maxlen)) 01035 buffer[maxlen-1] = '\0'; 01036 01037 // Win32 doesn't 0-terminate the string if it overruns maxlen. 01038 if (result == -1) 01039 buffer[maxlen-1] = '\0'; 01040 # endif 01041 // In out-of-range conditions, C99 defines vsnprintf() to return the number 01042 // of characters that would have been written if enough space was available. 01043 // Earlier variants of the vsnprintf() (e.g. UNIX98) defined it to return 01044 // -1. This method follows the C99 standard, but needs to guess at the 01045 // value; uses maxlen + 1. 01046 if (result == -1) 01047 { 01048 result = static_cast <int> (maxlen + 1); 01049 } 01050 01051 return result; 01052 #elif defined (ACE_HAS_TRIO) 01053 return trio_vsnprintf (buffer, maxlen, format, ap); 01054 #else 01055 ACE_UNUSED_ARG (buffer); 01056 ACE_UNUSED_ARG (maxlen); 01057 ACE_UNUSED_ARG (format); 01058 ACE_UNUSED_ARG (ap); 01059 ACE_NOTSUP_RETURN (-1); 01060 #endif /* ACE_LACKS_VSNPRINTF */ 01061 }
ACE_Export void * ACE_OS::calloc | ( | size_t | elements, | |
size_t | sizeof_elements | |||
) |
Definition at line 39 of file OS_NS_stdlib.cpp.
References ACE_CALLOC_FUNC, and ACE_MALLOC_FUNC.
00040 { 00041 #if !defined (ACE_HAS_WINCE) 00042 return ACE_CALLOC_FUNC (elements, sizeof_elements); 00043 #else 00044 // @@ This will probably not work since it doesn't consider 00045 // alignment properly. 00046 return ACE_MALLOC_FUNC (elements * sizeof_elements); 00047 #endif /* ACE_HAS_WINCE */ 00048 }
ACE_Export void ACE_OS::exit | ( | int | status = 0 |
) |
Definition at line 51 of file OS_NS_stdlib.cpp.
References ACE_OS_TRACE, and exit_hook_.
Referenced by _exit(), abort(), ACE::daemonize(), fork_exec(), ACE_Svc_Conf_Lexer::input(), and ACE_Process::spawn().
00052 { 00053 ACE_OS_TRACE ("ACE_OS::exit"); 00054 00055 #if defined (ACE_HAS_NONSTATIC_OBJECT_MANAGER) && !defined (ACE_HAS_WINCE) && !defined (ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER) 00056 // Shut down the ACE_Object_Manager, if it had registered its exit_hook. 00057 // With ACE_HAS_NONSTATIC_OBJECT_MANAGER, the ACE_Object_Manager is 00058 // instantiated on the main's stack. ::exit () doesn't destroy it. 00059 if (exit_hook_) 00060 (*exit_hook_) (); 00061 #endif /* ACE_HAS_NONSTATIC_OBJECT_MANAGER && !ACE_HAS_WINCE && !ACE_DOESNT_INSTANTIATE_NONSTATIC_OBJECT_MANAGER */ 00062 00063 #if !defined (ACE_HAS_WINCE) 00064 # if defined (ACE_WIN32) 00065 ::ExitProcess ((UINT) status); 00066 # else 00067 ::exit (status); 00068 # endif /* ACE_WIN32 */ 00069 #else 00070 // @@ This is not exactly the same as ExitProcess. But this is the 00071 // closest one I can get. 00072 ::TerminateProcess (::GetCurrentProcess (), status); 00073 #endif /* ACE_HAS_WINCE */ 00074 }
ACE_Export void ACE_OS::free | ( | void * | ptr | ) |
Definition at line 77 of file OS_NS_stdlib.cpp.
References ACE_FREE_FUNC, and ACE_MALLOC_T.
Referenced by ACE_ARGV_T< CHAR_TYPE >::add(), argv_to_string(), ACE_Dirent_Selector::close(), ACE::count_interfaces(), ACE_Name_Options::database(), event_destroy(), flock_destroy(), ACE::ldfind(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), ACE_Log_Msg::local_host(), ACE_Name_Options::nameserver_host(), ACE_Name_Options::namespace_dir(), ACE_Log_Msg::open(), ACE_Name_Binding::operator=(), ACE_Name_Options::process_name(), putenv(), ACE_Codeset_Registry::registry_to_locale(), ACE_Mutex::remove(), ACE_Auto_String_Free::reset(), scandir_emulation(), sema_destroy(), ACE_SPIPE_Addr::set(), ACE_INET_Addr::string_to_addr(), ACE_Log_Msg::sync(), ACE_ARGV_T< CHAR_TYPE >::~ACE_ARGV_T(), ACE_Argv_Type_Converter::~ACE_Argv_Type_Converter(), ACE_Configuration_Section_Key_Heap::~ACE_Configuration_Section_Key_Heap(), ACE_Hash_Map_Entry< EXT_ID, INT_ID >::~ACE_Hash_Map_Entry(), ACE_Log_Msg::~ACE_Log_Msg(), ACE_Malloc_FIFO_Iterator_T<, ACE_LOCK, ACE_CB >::~ACE_Malloc_FIFO_Iterator_T(), ACE_Malloc_LIFO_Iterator_T<, ACE_LOCK, ACE_CB >::~ACE_Malloc_LIFO_Iterator_T(), ACE_Name_Binding::~ACE_Name_Binding(), ACE_Name_Options::~ACE_Name_Options(), and ACE_Strategy_Acceptor< SVC_HANDLER, >::~ACE_Strategy_Acceptor().
00078 { 00079 ACE_FREE_FUNC (ACE_MALLOC_T (ptr)); 00080 }
ACE_Export ACE_TCHAR * ACE_OS::getenvstrings | ( | void | ) |
Definition at line 92 of file OS_NS_stdlib.cpp.
References ACE_NOTSUP_RETURN.
00093 { 00094 #if defined (ACE_LACKS_ENV) 00095 ACE_NOTSUP_RETURN (0); 00096 #elif defined (ACE_WIN32) 00097 # if defined (ACE_USES_WCHAR) 00098 return ::GetEnvironmentStringsW (); 00099 # else /* ACE_USES_WCHAR */ 00100 return ::GetEnvironmentStrings (); 00101 # endif /* ACE_USES_WCHAR */ 00102 #else /* ACE_WIN32 */ 00103 ACE_NOTSUP_RETURN (0); 00104 #endif /* ACE_WIN32 */ 00105 }
Definition at line 113 of file OS_NS_stdlib.cpp.
References ACE_DEFAULT_ARGV_BUFSIZ, ACE_NOTSUP_RETURN, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, ACE_TEXT_CHAR_TO_TCHAR, getenv(), malloc(), strchr(), strcpy(), strcspn(), strdup(), strecpy(), strlen(), and strncpy().
Referenced by argv_to_string(), ACE::strenvdup(), and string_to_argv().
00114 { 00115 #if defined (ACE_HAS_WINCE) 00116 // WinCE doesn't have environment variables so we just skip it. 00117 return ACE_OS::strdup (str); 00118 #elif defined (ACE_LACKS_ENV) 00119 ACE_UNUSED_ARG (str); 00120 ACE_NOTSUP_RETURN (0); 00121 #else 00122 const ACE_TCHAR * start = 0; 00123 if ((start = ACE_OS::strchr (str, ACE_TEXT ('$'))) != 0) 00124 { 00125 ACE_TCHAR buf[ACE_DEFAULT_ARGV_BUFSIZ]; 00126 size_t var_len = ACE_OS::strcspn (&start[1], 00127 ACE_TEXT ("$~!#%^&*()-+=\\|/?,.;:'\"`[]{} \t\n\r")); 00128 ACE_OS::strncpy (buf, &start[1], var_len); 00129 buf[var_len++] = ACE_TEXT ('\0'); 00130 # if defined (ACE_WIN32) 00131 // Always use the ACE_TCHAR for Windows. 00132 ACE_TCHAR *temp = ACE_OS::getenv (buf); 00133 # else 00134 // Use char * for environment on non-Windows. 00135 char *temp = ACE_OS::getenv (ACE_TEXT_ALWAYS_CHAR (buf)); 00136 # endif /* ACE_WIN32 */ 00137 size_t buf_len = ACE_OS::strlen (str) + 1; 00138 if (temp != 0) 00139 buf_len += ACE_OS::strlen (temp) - var_len; 00140 ACE_TCHAR * buf_p = buf; 00141 if (buf_len > ACE_DEFAULT_ARGV_BUFSIZ) 00142 { 00143 buf_p = 00144 (ACE_TCHAR *) ACE_OS::malloc (buf_len * sizeof (ACE_TCHAR)); 00145 if (buf_p == 0) 00146 { 00147 errno = ENOMEM; 00148 return 0; 00149 } 00150 } 00151 ACE_TCHAR * p = buf_p; 00152 size_t len = start - str; 00153 ACE_OS::strncpy (p, str, len); 00154 p += len; 00155 if (temp != 0) 00156 { 00157 # if defined (ACE_WIN32) 00158 p = ACE_OS::strecpy (p, temp) - 1; 00159 # else 00160 p = ACE_OS::strecpy (p, ACE_TEXT_CHAR_TO_TCHAR (temp)) - 1; 00161 # endif /* ACE_WIN32 */ 00162 } 00163 else 00164 { 00165 ACE_OS::strncpy (p, start, var_len); 00166 p += var_len; 00167 *p = ACE_TEXT ('\0'); 00168 } 00169 ACE_OS::strcpy (p, &start[var_len]); 00170 return (buf_p == buf) ? ACE_OS::strdup (buf) : buf_p; 00171 } 00172 else 00173 return ACE_OS::strdup (str); 00174 #endif /* ACE_HAS_WINCE */ 00175 }
ACE_Export char * ACE_OS::itoa_emulation | ( | int | value, | |
char * | string, | |||
int | radix | |||
) |
Emulated itoa - Converts an integer to a string.
Definition at line 179 of file OS_NS_stdlib.cpp.
Referenced by itoa().
00180 { 00181 char *e = string; 00182 char *b = string; 00183 00184 // Short circuit if 0 00185 00186 if (value == 0) 00187 { 00188 string[0] = '0'; 00189 string[1] = 0; 00190 return string; 00191 } 00192 00193 // If negative and base 10, print a - and then do the 00194 // number. 00195 00196 if (value < 0 && radix == 10) 00197 { 00198 string[0] = '-'; 00199 ++b; 00200 ++e; // Don't overwrite the negative sign. 00201 value = -value; // Drop negative sign so character selection is correct. 00202 } 00203 00204 // Convert to base <radix>, but in reverse order 00205 00206 while (value != 0) 00207 { 00208 int mod = value % radix; 00209 value = value / radix; 00210 00211 *e++ = (mod < 10) ? '0' + mod : 'a' + mod - 10; 00212 } 00213 00214 *e-- = 0; 00215 00216 // Now reverse the string to get the correct result 00217 00218 while (e > b) 00219 { 00220 char temp = *e; 00221 *e = *b; 00222 *b = temp; 00223 ++b; 00224 --e; 00225 } 00226 00227 return string; 00228 }
ACE_Export void * ACE_OS::malloc | ( | size_t | nbytes | ) |
Definition at line 284 of file OS_NS_stdlib.cpp.
References ACE_MALLOC_FUNC.
Referenced by ACE_Name_Options::ACE_Name_Options(), argv_to_string(), ACE::count_interfaces(), ACE::ldfind(), scandir_emulation(), strenvdup(), ACE::strndup(), and vasprintf_emulation().
00285 { 00286 return ACE_MALLOC_FUNC (nbytes); 00287 }
ACE_Export void * ACE_OS::realloc | ( | void * | ptr, | |
size_t | nbytes | |||
) |
Definition at line 340 of file OS_NS_stdlib.cpp.
References ACE_MALLOC_T, and ACE_REALLOC_FUNC.
Referenced by scandir_emulation().
00341 { 00342 return ACE_REALLOC_FUNC (ACE_MALLOC_T (ptr), nbytes); 00343 }
ACE_Export const char * ACE_OS::getprogname_emulation | ( | ) |
Definition at line 783 of file OS_NS_stdlib.cpp.
Referenced by getprogname().
00784 { 00785 return __progname; 00786 }
ACE_Export void ACE_OS::setprogname_emulation | ( | const char * | progname | ) |
Definition at line 791 of file OS_NS_stdlib.cpp.
References strrchr().
Referenced by setprogname().
00792 { 00793 const char *p = ACE_OS::strrchr (progname, '/'); 00794 if (p != 0) 00795 __progname = p + 1; 00796 else 00797 __progname = progname; 00798 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::_exit | ( | int | status = 0 |
) |
Definition at line 24 of file OS_NS_stdlib.inl.
References _exit(), ACE_OS_TRACE, and exit().
Referenced by _exit(), ACE::fork(), and ACE_Process::spawn().
00025 { 00026 ACE_OS_TRACE ("ACE_OS::_exit"); 00027 #if defined (ACE_VXWORKS) 00028 ::exit (status); 00029 #elif !defined (ACE_HAS_WINCE) 00030 ::_exit (status); 00031 #else 00032 ::TerminateProcess (::GetCurrentProcess (), status); 00033 #endif /* ACE_VXWORKS */ 00034 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::abort | ( | void | ) |
Definition at line 37 of file OS_NS_stdlib.inl.
References abort(), and exit().
Referenced by abort(), and ACE_Log_Msg::log().
00038 { 00039 #if !defined (ACE_HAS_WINCE) 00040 ::abort (); 00041 #else 00042 // @@ CE doesn't support abort? 00043 exit (1); 00044 #endif /* !ACE_HAS_WINCE */ 00045 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::atexit | ( | ACE_EXIT_HOOK | func | ) |
Definition at line 48 of file OS_NS_stdlib.inl.
References ACE_OS_Object_Manager::at_exit(), and ACE_OS_Object_Manager::instance().
00049 { 00050 return ACE_OS_Object_Manager::instance ()->at_exit (func); 00051 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::atoi | ( | const char * | s | ) |
Definition at line 54 of file OS_NS_stdlib.inl.
References atoi().
Referenced by atoi(), atop(), ACE_High_Res_Timer::get_env_global_scale_factor(), ACE_Service_Manager::init(), ACE_Name_Options::parse_args(), ACE_Logging_Strategy::parse_args(), ACE_Service_Config::parse_args_i(), and ACE_Registry_ImpExp::process_previous_line_format().
00055 { 00056 ACE_OSCALL_RETURN (::atoi (s), int, -1); 00057 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::atop | ( | const char * | s | ) |
Definition at line 76 of file OS_NS_stdlib.inl.
References ACE_TRACE, and atoi().
Referenced by ACE_Name_Options::parse_args().
00077 { 00078 ACE_TRACE ("ACE_OS::atop"); 00079 #if defined (ACE_WIN64) 00080 intptr_t ip = ::_atoi64 (s); 00081 #elif defined (ACE_OPENVMS) 00082 # if !defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64) 00083 int ip = ::atoi (s); 00084 # else 00085 intptr_t ip = ::atoi (s); 00086 # endif 00087 #else 00088 intptr_t ip = ::atoi (s); 00089 #endif /* ACE_WIN64 */ 00090 void * p = reinterpret_cast<void *> (ip); 00091 return p; 00092 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::bsearch | ( | const void * | key, | |
const void * | base, | |||
size_t | nel, | |||
size_t | size, | |||
ACE_COMPARE_FUNC | ||||
) |
Definition at line 115 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, and bsearch().
Referenced by bsearch().
00120 { 00121 #if !defined (ACE_LACKS_BSEARCH) 00122 return ::bsearch (key, base, nel, size, compar); 00123 #else 00124 ACE_UNUSED_ARG (key); 00125 ACE_UNUSED_ARG (base); 00126 ACE_UNUSED_ARG (nel); 00127 ACE_UNUSED_ARG (size); 00128 ACE_UNUSED_ARG (compar); 00129 ACE_NOTSUP_RETURN (0); 00130 #endif /* ACE_LACKS_BSEARCH */ 00131 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::getenv | ( | const char * | symbol | ) |
Definition at line 134 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getenv().
Referenced by ACE_Get_Opt::ACE_Get_Opt(), ACE_Log_Msg::ACE_Log_Msg(), ACE::debug(), ACE_Env_Value< T >::fetch_value(), ACE_High_Res_Timer::get_env_global_scale_factor(), ACE::get_temp_dir(), getenv(), ACE::ldfind(), and strenvdup().
00135 { 00136 ACE_OS_TRACE ("ACE_OS::getenv"); 00137 #if defined (ACE_LACKS_ENV) 00138 ACE_UNUSED_ARG (symbol); 00139 ACE_NOTSUP_RETURN (0); 00140 #else /* ACE_LACKS_ENV */ 00141 ACE_OSCALL_RETURN (::getenv (symbol), char *, 0); 00142 #endif /* ACE_LACKS_ENV */ 00143 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::itoa | ( | int | value, | |
char * | string, | |||
int | radix | |||
) |
Converts an integer to a string.
Definition at line 159 of file OS_NS_stdlib.inl.
References itoa(), and itoa_emulation().
Referenced by itoa().
00160 { 00161 #if !defined (ACE_HAS_ITOA) 00162 return ACE_OS::itoa_emulation (value, string, radix); 00163 #elif defined (ACE_ITOA_EQUIVALENT) 00164 return ACE_ITOA_EQUIVALENT (value, string, radix); 00165 #else /* !ACE_HAS_ITOA */ 00166 return ::itoa (value, string, radix); 00167 #endif /* !ACE_HAS_ITOA */ 00168 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE ACE_OS::mkstemp | ( | char * | s | ) |
Definition at line 183 of file OS_NS_stdlib.inl.
References ACE_TEXT_CHAR_TO_TCHAR, and mkstemp().
Referenced by ACE_FILE_Connector::connect(), and mkstemp().
00184 { 00185 #if !defined (ACE_LACKS_MKSTEMP) 00186 return ::mkstemp (s); 00187 #else 00188 return ACE_OS::mkstemp_emulation (ACE_TEXT_CHAR_TO_TCHAR (s)); 00189 #endif /* !ACE_LACKS_MKSTEMP */ 00190 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::mktemp | ( | char * | s | ) |
Definition at line 206 of file OS_NS_stdlib.inl.
References mktemp().
Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), mktemp(), and ACE_FILE_Addr::set().
00207 { 00208 # if defined (ACE_WIN32) 00209 return ::_mktemp (s); 00210 # else /* ACE_WIN32 */ 00211 return ::mktemp (s); 00212 # endif /* ACE_WIN32 */ 00213 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::putenv | ( | const char * | string | ) |
Definition at line 244 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, free(), putenv(), strchr(), and strdup().
Referenced by putenv(), and ACE_Process::spawn().
00245 { 00246 ACE_OS_TRACE ("ACE_OS::putenv"); 00247 #if defined (ACE_HAS_WINCE) 00248 // WinCE don't have the concept of environment variables. 00249 ACE_UNUSED_ARG (string); 00250 ACE_NOTSUP_RETURN (-1); 00251 #elif defined (ACE_LACKS_PUTENV) && defined (ACE_HAS_SETENV) 00252 int result = 0; 00253 char *sp = ACE_OS::strchr (const_cast <char *> (string), '='); 00254 if (sp) 00255 { 00256 char *stmp = ACE_OS::strdup (string); 00257 if (stmp) 00258 { 00259 stmp[sp - string] = '\0'; 00260 ACE_OSCALL (::setenv (stmp, sp+sizeof (char), 1), int, -1, result); 00261 ACE_OS::free (stmp); 00262 } 00263 else 00264 { 00265 errno = ENOMEM; 00266 result = -1; 00267 } 00268 } 00269 else 00270 ACE_OSCALL (::setenv (string, "", 1), int, -1, result); 00271 00272 return result; 00273 #elif defined (ACE_LACKS_ENV) || defined (ACE_LACKS_PUTENV) 00274 ACE_UNUSED_ARG (string); 00275 ACE_NOTSUP_RETURN (0); 00276 #else /* ! ACE_HAS_WINCE */ 00277 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::putenv (const_cast <char *> (string)), int, -1); 00278 #endif /* ACE_HAS_WINCE */ 00279 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::qsort | ( | void * | base, | |
size_t | nel, | |||
size_t | width, | |||
ACE_COMPARE_FUNC | ||||
) |
Definition at line 297 of file OS_NS_stdlib.inl.
References qsort().
Referenced by qsort(), and scandir_emulation().
00301 { 00302 #if !defined (ACE_LACKS_QSORT) 00303 ::qsort (base, nel, width, compar); 00304 #else 00305 ACE_UNUSED_ARG (base); 00306 ACE_UNUSED_ARG (nel); 00307 ACE_UNUSED_ARG (width); 00308 ACE_UNUSED_ARG (compar); 00309 #endif /* !ACE_LACKS_QSORT */ 00310 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::rand | ( | void | ) |
Definition at line 313 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, and rand().
Referenced by ACE_Utils::UUID_Generator::init(), rand(), and rand_r().
00314 { 00315 ACE_OS_TRACE ("ACE_OS::rand"); 00316 ACE_OSCALL_RETURN (::rand (), int, -1); 00317 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::rand_r | ( | ACE_RANDR_TYPE & | seed | ) |
Definition at line 322 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, rand(), and rand_r().
Referenced by rand_r().
00323 { 00324 ACE_OS_TRACE ("ACE_OS::rand_r"); 00325 # if defined (ACE_HAS_REENTRANT_FUNCTIONS) && \ 00326 !defined (ACE_LACKS_RAND_REENTRANT_FUNCTIONS) 00327 # if defined (DIGITAL_UNIX) 00328 ACE_OSCALL_RETURN (::_Prand_r (&seed), int, -1); 00329 # elif defined (ACE_HAS_BROKEN_RANDR) 00330 ACE_OSCALL_RETURN (::rand_r (seed), int, -1); 00331 # else 00332 ACE_OSCALL_RETURN (::rand_r (&seed), int, -1); 00333 # endif /* DIGITAL_UNIX */ 00334 # else 00335 ACE_UNUSED_ARG (seed); 00336 ACE_OSCALL_RETURN (::rand (), int, -1); 00337 # endif /* ACE_HAS_REENTRANT_FUNCTIONS */ 00338 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::realpath | ( | const char * | file_name, | |
char * | resolved_name | |||
) |
Definition at line 363 of file OS_NS_stdlib.inl.
References PATH_MAX, and realpath().
Referenced by realpath().
00365 { 00366 # if defined (ACE_WIN32) 00367 return ::_fullpath (resolved_name, file_name, PATH_MAX); 00368 # else /* ACE_WIN32 */ 00369 return ::realpath (file_name, resolved_name); 00370 # endif /* ! ACE_WIN32 */ 00371 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_EXIT_HOOK ACE_OS::set_exit_hook | ( | ACE_EXIT_HOOK | hook | ) |
For use by ACE_Object_Manager only, to register its exit hook..
Definition at line 397 of file OS_NS_stdlib.inl.
References ACE_EXIT_HOOK, and exit_hook_.
Referenced by ACE_OS_Object_Manager::init().
00398 { 00399 ACE_EXIT_HOOK old_hook = exit_hook_; 00400 exit_hook_ = exit_hook; 00401 return old_hook; 00402 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::srand | ( | u_int | seed | ) |
Definition at line 405 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, and srand().
Referenced by srand().
00406 { 00407 ACE_OS_TRACE ("ACE_OS::srand"); 00408 ::srand (seed); 00409 }
ACE_NAMESPACE_INLINE_FUNCTION double ACE_OS::strtod | ( | const char * | s, | |
char ** | endptr | |||
) |
Converts a string to a double value (char version).
Definition at line 413 of file OS_NS_stdlib.inl.
References strtod().
Referenced by ACE_Convert(), and strtod().
00414 { 00415 return ::strtod (s, endptr); 00416 }
ACE_NAMESPACE_INLINE_FUNCTION long ACE_OS::strtol | ( | const char * | s, | |
char ** | ptr, | |||
int | base | |||
) |
Converts a string to a long value (char version).
Definition at line 428 of file OS_NS_stdlib.inl.
References strtol().
Referenced by ACE_Convert(), get_port_number_from_name(), ACE_INET_Addr::string_to_addr(), and strtol().
00429 { 00430 #if defined (ACE_LACKS_STRTOL) 00431 return ACE_OS::strtol_emulation (s, ptr, base); 00432 #else /* ACE_LACKS_STRTOL */ 00433 return ::strtol (s, ptr, base); 00434 #endif /* ACE_LACKS_STRTOL */ 00435 }
ACE_NAMESPACE_INLINE_FUNCTION unsigned long ACE_OS::strtoul | ( | const char * | s, | |
char ** | ptr, | |||
int | base | |||
) |
Converts a string to an unsigned long value (char version).
Definition at line 446 of file OS_NS_stdlib.inl.
References strtoul().
Referenced by ACE_Convert(), ACE_Registry_ImpExp::import_config(), ACE_Logging_Strategy::parse_args(), and strtoul().
00447 { 00448 #if defined (ACE_LACKS_STRTOUL) 00449 return ACE_OS::strtoul_emulation (s, ptr, base); 00450 #else /* ACE_LACKS_STRTOUL */ 00451 return ::strtoul (s, ptr, base); 00452 #endif /* ACE_LACKS_STRTOUL */ 00453 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::system | ( | const ACE_TCHAR * | s | ) |
Definition at line 464 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_TEXT_ALWAYS_CHAR, and system().
Referenced by system().
00465 { 00466 // ACE_OS_TRACE ("ACE_OS::system"); 00467 #if defined (ACE_LACKS_SYSTEM) 00468 ACE_UNUSED_ARG (s); 00469 ACE_NOTSUP_RETURN (-1); 00470 #elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) 00471 ACE_OSCALL_RETURN (::_wsystem (s), int, -1); 00472 #elif defined (ACE_TANDEM_T1248_PTHREADS) 00473 ACE_OSCALL_RETURN (::spt_system (s), int, -1); 00474 #else 00475 ACE_OSCALL_RETURN (::system (ACE_TEXT_ALWAYS_CHAR (s)), int, -1); 00476 #endif /* ACE_LACKS_SYSTEM */ 00477 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::getprogname | ( | ) |
Get the name of the current program
Originally from NetBSD, now found in *BSD, Cygwin, Darwin, etc.
Definition at line 480 of file OS_NS_stdlib.inl.
References getprogname(), and getprogname_emulation().
Referenced by getprogname().
00481 { 00482 #if defined (ACE_HAS_GETPROGNAME) 00483 return ::getprogname (); 00484 #else 00485 return ACE_OS::getprogname_emulation (); 00486 #endif /* ACE_HAS_GETPROGNAME */ 00487 }
ACE_NAMESPACE_INLINE_FUNCTION void ACE_OS::setprogname | ( | const char * | name | ) |
Set the name of the current program
Originally from NetBSD, now found in *BSD, Cygwin, Darwin, etc.
Definition at line 490 of file OS_NS_stdlib.inl.
References setprogname(), and setprogname_emulation().
Referenced by setprogname().
00491 { 00492 #if defined (ACE_HAS_SETPROGNAME) 00493 ::setprogname (name); 00494 #else 00495 ACE_OS::setprogname_emulation (name); 00496 #endif /* ACE_HAS_SETPROGNAME */ 00497 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void ACE_OS::_exit | ( | int | status | ) |
Definition at line 24 of file OS_NS_stdlib.inl.
References _exit(), ACE_OS_TRACE, and exit().
Referenced by _exit(), ACE::fork(), and ACE_Process::spawn().
00025 { 00026 ACE_OS_TRACE ("ACE_OS::_exit"); 00027 #if defined (ACE_VXWORKS) 00028 ::exit (status); 00029 #elif !defined (ACE_HAS_WINCE) 00030 ::_exit (status); 00031 #else 00032 ::TerminateProcess (::GetCurrentProcess (), status); 00033 #endif /* ACE_VXWORKS */ 00034 }
ACE_INLINE void ACE_OS::abort | ( | void | ) |
Definition at line 37 of file OS_NS_stdlib.inl.
References abort(), and exit().
Referenced by abort(), and ACE_Log_Msg::log().
00038 { 00039 #if !defined (ACE_HAS_WINCE) 00040 ::abort (); 00041 #else 00042 // @@ CE doesn't support abort? 00043 exit (1); 00044 #endif /* !ACE_HAS_WINCE */ 00045 }
ACE_INLINE int ACE_OS::atexit | ( | ACE_EXIT_HOOK | func | ) |
Definition at line 48 of file OS_NS_stdlib.inl.
References ACE_OS_Object_Manager::at_exit(), and ACE_OS_Object_Manager::instance().
00049 { 00050 return ACE_OS_Object_Manager::instance ()->at_exit (func); 00051 }
ACE_INLINE int ACE_OS::atoi | ( | const char * | s | ) |
Definition at line 54 of file OS_NS_stdlib.inl.
References atoi().
Referenced by atoi(), atop(), ACE_High_Res_Timer::get_env_global_scale_factor(), ACE_Service_Manager::init(), ACE_Logging_Strategy::parse_args(), ACE_Name_Options::parse_args(), ACE_Service_Config::parse_args_i(), and ACE_Registry_ImpExp::process_previous_line_format().
00055 { 00056 ACE_OSCALL_RETURN (::atoi (s), int, -1); 00057 }
ACE_INLINE void* ACE_OS::atop | ( | const char * | s | ) |
Definition at line 76 of file OS_NS_stdlib.inl.
References ACE_TRACE, and atoi().
Referenced by ACE_Name_Options::parse_args().
00077 { 00078 ACE_TRACE ("ACE_OS::atop"); 00079 #if defined (ACE_WIN64) 00080 intptr_t ip = ::_atoi64 (s); 00081 #elif defined (ACE_OPENVMS) 00082 # if !defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64) 00083 int ip = ::atoi (s); 00084 # else 00085 intptr_t ip = ::atoi (s); 00086 # endif 00087 #else 00088 intptr_t ip = ::atoi (s); 00089 #endif /* ACE_WIN64 */ 00090 void * p = reinterpret_cast<void *> (ip); 00091 return p; 00092 }
ACE_INLINE void* ACE_OS::bsearch | ( | const void * | key, | |
const void * | base, | |||
size_t | nel, | |||
size_t | size, | |||
ACE_COMPARE_FUNC | compar | |||
) |
Definition at line 115 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, and bsearch().
Referenced by bsearch().
00120 { 00121 #if !defined (ACE_LACKS_BSEARCH) 00122 return ::bsearch (key, base, nel, size, compar); 00123 #else 00124 ACE_UNUSED_ARG (key); 00125 ACE_UNUSED_ARG (base); 00126 ACE_UNUSED_ARG (nel); 00127 ACE_UNUSED_ARG (size); 00128 ACE_UNUSED_ARG (compar); 00129 ACE_NOTSUP_RETURN (0); 00130 #endif /* ACE_LACKS_BSEARCH */ 00131 }
ACE_INLINE char* ACE_OS::getenv | ( | const char * | symbol | ) |
Definition at line 134 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getenv().
Referenced by ACE_Get_Opt::ACE_Get_Opt(), ACE_Log_Msg::ACE_Log_Msg(), ACE::debug(), ACE_Env_Value< T >::fetch_value(), ACE_High_Res_Timer::get_env_global_scale_factor(), ACE::get_temp_dir(), getenv(), ACE::ldfind(), and strenvdup().
00135 { 00136 ACE_OS_TRACE ("ACE_OS::getenv"); 00137 #if defined (ACE_LACKS_ENV) 00138 ACE_UNUSED_ARG (symbol); 00139 ACE_NOTSUP_RETURN (0); 00140 #else /* ACE_LACKS_ENV */ 00141 ACE_OSCALL_RETURN (::getenv (symbol), char *, 0); 00142 #endif /* ACE_LACKS_ENV */ 00143 }
ACE_INLINE char* ACE_OS::itoa | ( | int | value, | |
char * | string, | |||
int | radix | |||
) |
Converts an integer to a string.
Definition at line 159 of file OS_NS_stdlib.inl.
References itoa(), and itoa_emulation().
Referenced by itoa().
00160 { 00161 #if !defined (ACE_HAS_ITOA) 00162 return ACE_OS::itoa_emulation (value, string, radix); 00163 #elif defined (ACE_ITOA_EQUIVALENT) 00164 return ACE_ITOA_EQUIVALENT (value, string, radix); 00165 #else /* !ACE_HAS_ITOA */ 00166 return ::itoa (value, string, radix); 00167 #endif /* !ACE_HAS_ITOA */ 00168 }
ACE_INLINE ACE_HANDLE ACE_OS::mkstemp | ( | char * | s | ) |
Definition at line 183 of file OS_NS_stdlib.inl.
References ACE_TEXT_CHAR_TO_TCHAR, and mkstemp().
Referenced by ACE_FILE_Connector::connect(), and mkstemp().
00184 { 00185 #if !defined (ACE_LACKS_MKSTEMP) 00186 return ::mkstemp (s); 00187 #else 00188 return ACE_OS::mkstemp_emulation (ACE_TEXT_CHAR_TO_TCHAR (s)); 00189 #endif /* !ACE_LACKS_MKSTEMP */ 00190 }
ACE_INLINE char* ACE_OS::mktemp | ( | char * | s | ) |
Definition at line 206 of file OS_NS_stdlib.inl.
References mktemp().
Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), mktemp(), and ACE_FILE_Addr::set().
00207 { 00208 # if defined (ACE_WIN32) 00209 return ::_mktemp (s); 00210 # else /* ACE_WIN32 */ 00211 return ::mktemp (s); 00212 # endif /* ACE_WIN32 */ 00213 }
ACE_INLINE int ACE_OS::putenv | ( | const char * | string | ) |
Definition at line 244 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, free(), putenv(), strchr(), and strdup().
Referenced by putenv(), and ACE_Process::spawn().
00245 { 00246 ACE_OS_TRACE ("ACE_OS::putenv"); 00247 #if defined (ACE_HAS_WINCE) 00248 // WinCE don't have the concept of environment variables. 00249 ACE_UNUSED_ARG (string); 00250 ACE_NOTSUP_RETURN (-1); 00251 #elif defined (ACE_LACKS_PUTENV) && defined (ACE_HAS_SETENV) 00252 int result = 0; 00253 char *sp = ACE_OS::strchr (const_cast <char *> (string), '='); 00254 if (sp) 00255 { 00256 char *stmp = ACE_OS::strdup (string); 00257 if (stmp) 00258 { 00259 stmp[sp - string] = '\0'; 00260 ACE_OSCALL (::setenv (stmp, sp+sizeof (char), 1), int, -1, result); 00261 ACE_OS::free (stmp); 00262 } 00263 else 00264 { 00265 errno = ENOMEM; 00266 result = -1; 00267 } 00268 } 00269 else 00270 ACE_OSCALL (::setenv (string, "", 1), int, -1, result); 00271 00272 return result; 00273 #elif defined (ACE_LACKS_ENV) || defined (ACE_LACKS_PUTENV) 00274 ACE_UNUSED_ARG (string); 00275 ACE_NOTSUP_RETURN (0); 00276 #else /* ! ACE_HAS_WINCE */ 00277 ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::putenv (const_cast <char *> (string)), int, -1); 00278 #endif /* ACE_HAS_WINCE */ 00279 }
ACE_INLINE void ACE_OS::qsort | ( | void * | base, | |
size_t | nel, | |||
size_t | width, | |||
ACE_COMPARE_FUNC | compar | |||
) |
Definition at line 297 of file OS_NS_stdlib.inl.
References qsort().
Referenced by qsort(), and scandir_emulation().
00301 { 00302 #if !defined (ACE_LACKS_QSORT) 00303 ::qsort (base, nel, width, compar); 00304 #else 00305 ACE_UNUSED_ARG (base); 00306 ACE_UNUSED_ARG (nel); 00307 ACE_UNUSED_ARG (width); 00308 ACE_UNUSED_ARG (compar); 00309 #endif /* !ACE_LACKS_QSORT */ 00310 }
ACE_INLINE int ACE_OS::rand | ( | void | ) |
Definition at line 313 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, and rand().
Referenced by ACE_Utils::UUID_Generator::init(), rand(), and rand_r().
00314 { 00315 ACE_OS_TRACE ("ACE_OS::rand"); 00316 ACE_OSCALL_RETURN (::rand (), int, -1); 00317 }
ACE_INLINE int ACE_OS::rand_r | ( | ACE_RANDR_TYPE & | seed | ) |
Definition at line 322 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, rand(), and rand_r().
Referenced by rand_r().
00323 { 00324 ACE_OS_TRACE ("ACE_OS::rand_r"); 00325 # if defined (ACE_HAS_REENTRANT_FUNCTIONS) && \ 00326 !defined (ACE_LACKS_RAND_REENTRANT_FUNCTIONS) 00327 # if defined (DIGITAL_UNIX) 00328 ACE_OSCALL_RETURN (::_Prand_r (&seed), int, -1); 00329 # elif defined (ACE_HAS_BROKEN_RANDR) 00330 ACE_OSCALL_RETURN (::rand_r (seed), int, -1); 00331 # else 00332 ACE_OSCALL_RETURN (::rand_r (&seed), int, -1); 00333 # endif /* DIGITAL_UNIX */ 00334 # else 00335 ACE_UNUSED_ARG (seed); 00336 ACE_OSCALL_RETURN (::rand (), int, -1); 00337 # endif /* ACE_HAS_REENTRANT_FUNCTIONS */ 00338 }
ACE_INLINE char* ACE_OS::realpath | ( | const char * | file_name, | |
char * | resolved_name | |||
) |
Definition at line 363 of file OS_NS_stdlib.inl.
References PATH_MAX, and realpath().
Referenced by realpath().
00365 { 00366 # if defined (ACE_WIN32) 00367 return ::_fullpath (resolved_name, file_name, PATH_MAX); 00368 # else /* ACE_WIN32 */ 00369 return ::realpath (file_name, resolved_name); 00370 # endif /* ! ACE_WIN32 */ 00371 }
ACE_INLINE ACE_EXIT_HOOK ACE_OS::set_exit_hook | ( | ACE_EXIT_HOOK | exit_hook | ) |
For use by ACE_Object_Manager only, to register its exit hook..
Definition at line 397 of file OS_NS_stdlib.inl.
References ACE_EXIT_HOOK, and exit_hook_.
Referenced by ACE_OS_Object_Manager::init().
00398 { 00399 ACE_EXIT_HOOK old_hook = exit_hook_; 00400 exit_hook_ = exit_hook; 00401 return old_hook; 00402 }
ACE_INLINE void ACE_OS::srand | ( | u_int | seed | ) |
Definition at line 405 of file OS_NS_stdlib.inl.
References ACE_OS_TRACE, and srand().
Referenced by srand().
00406 { 00407 ACE_OS_TRACE ("ACE_OS::srand"); 00408 ::srand (seed); 00409 }
ACE_INLINE double ACE_OS::strtod | ( | const char * | s, | |
char ** | endptr | |||
) |
Converts a string to a double value (char version).
Definition at line 413 of file OS_NS_stdlib.inl.
References strtod().
Referenced by ACE_Convert(), and strtod().
00414 { 00415 return ::strtod (s, endptr); 00416 }
ACE_INLINE long ACE_OS::strtol | ( | const char * | s, | |
char ** | ptr, | |||
int | base | |||
) |
Converts a string to a long value (char version).
Definition at line 428 of file OS_NS_stdlib.inl.
References strtol().
Referenced by ACE_Convert(), get_port_number_from_name(), ACE_INET_Addr::string_to_addr(), and strtol().
00429 { 00430 #if defined (ACE_LACKS_STRTOL) 00431 return ACE_OS::strtol_emulation (s, ptr, base); 00432 #else /* ACE_LACKS_STRTOL */ 00433 return ::strtol (s, ptr, base); 00434 #endif /* ACE_LACKS_STRTOL */ 00435 }
ACE_INLINE unsigned long ACE_OS::strtoul | ( | const char * | s, | |
char ** | ptr, | |||
int | base | |||
) |
Converts a string to an unsigned long value (char version).
Definition at line 446 of file OS_NS_stdlib.inl.
References strtoul().
Referenced by ACE_Convert(), ACE_Registry_ImpExp::import_config(), ACE_Logging_Strategy::parse_args(), and strtoul().
00447 { 00448 #if defined (ACE_LACKS_STRTOUL) 00449 return ACE_OS::strtoul_emulation (s, ptr, base); 00450 #else /* ACE_LACKS_STRTOUL */ 00451 return ::strtoul (s, ptr, base); 00452 #endif /* ACE_LACKS_STRTOUL */ 00453 }
ACE_INLINE int ACE_OS::system | ( | const ACE_TCHAR * | s | ) |
Definition at line 464 of file OS_NS_stdlib.inl.
References ACE_NOTSUP_RETURN, ACE_TEXT_ALWAYS_CHAR, and system().
Referenced by system().
00465 { 00466 // ACE_OS_TRACE ("ACE_OS::system"); 00467 #if defined (ACE_LACKS_SYSTEM) 00468 ACE_UNUSED_ARG (s); 00469 ACE_NOTSUP_RETURN (-1); 00470 #elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR) 00471 ACE_OSCALL_RETURN (::_wsystem (s), int, -1); 00472 #elif defined (ACE_TANDEM_T1248_PTHREADS) 00473 ACE_OSCALL_RETURN (::spt_system (s), int, -1); 00474 #else 00475 ACE_OSCALL_RETURN (::system (ACE_TEXT_ALWAYS_CHAR (s)), int, -1); 00476 #endif /* ACE_LACKS_SYSTEM */ 00477 }
ACE_INLINE const char* ACE_OS::getprogname | ( | ) |
Get the name of the current program
Originally from NetBSD, now found in *BSD, Cygwin, Darwin, etc.
Definition at line 480 of file OS_NS_stdlib.inl.
References getprogname(), and getprogname_emulation().
Referenced by getprogname().
00481 { 00482 #if defined (ACE_HAS_GETPROGNAME) 00483 return ::getprogname (); 00484 #else 00485 return ACE_OS::getprogname_emulation (); 00486 #endif /* ACE_HAS_GETPROGNAME */ 00487 }
ACE_INLINE void ACE_OS::setprogname | ( | const char * | name | ) |
Set the name of the current program
Originally from NetBSD, now found in *BSD, Cygwin, Darwin, etc.
Definition at line 490 of file OS_NS_stdlib.inl.
References setprogname(), and setprogname_emulation().
Referenced by setprogname().
00491 { 00492 #if defined (ACE_HAS_SETPROGNAME) 00493 ::setprogname (name); 00494 #else 00495 ACE_OS::setprogname_emulation (name); 00496 #endif /* ACE_HAS_SETPROGNAME */ 00497 }
ACE_Export char * ACE_OS::strecpy | ( | char * | des, | |
const char * | src | |||
) |
Copies a string, but returns a pointer to the end of the copied region (char version).
Definition at line 73 of file OS_NS_string.cpp.
Referenced by argv_to_string(), ACE::execname(), and strenvdup().
00074 { 00075 register char *dscan = s; 00076 register const char *sscan = t; 00077 00078 while ((*dscan++ = *sscan++) != '\0') 00079 continue; 00080 00081 return dscan; 00082 }
ACE_Export char * ACE_OS::strerror | ( | int | errnum | ) |
Copies a string, but returns a pointer to the end of the copied region (char version).
Definition at line 99 of file OS_NS_string.cpp.
References ACE_TEXT_ALWAYS_CHAR, ACE::is_sock_error(), ACE::sock_error(), sprintf(), and strncpy().
Referenced by dlerror(), ACE_Log_Msg::log(), and ACE_Stats::print_summary().
00100 { 00101 static char ret_errortext[128]; 00102 00103 if (ACE::is_sock_error (errnum)) 00104 { 00105 const ACE_TCHAR *errortext = ACE::sock_error (errnum); 00106 ACE_OS::strncpy (ret_errortext, 00107 ACE_TEXT_ALWAYS_CHAR (errortext), 00108 sizeof (ret_errortext)); 00109 return ret_errortext; 00110 } 00111 #if defined (ACE_LACKS_STRERROR) 00112 errno = EINVAL; 00113 return ACE_OS::strerror_emulation (errnum); 00114 #else /* ACE_LACKS_STRERROR */ 00115 // Adapt to the various ways that strerror() indicates a bad errnum. 00116 // Most modern systems set errno to EINVAL. Some older platforms return 00117 // a pointer to a NULL string. This code makes the behavior more consistent 00118 // across platforms. On a bad errnum, we make a string with the error number 00119 // and set errno to EINVAL. 00120 ACE_Errno_Guard g (errno); 00121 errno = 0; 00122 char *errmsg = 0; 00123 00124 #if defined (ACE_HAS_TR24731_2005_CRT) 00125 errmsg = ret_errortext; 00126 ACE_SECURECRTCALL (strerror_s (ret_errortext, sizeof(ret_errortext), errnum), 00127 char *, 0, errmsg); 00128 return errmsg; 00129 #elif defined (ACE_WIN32) 00130 if (errnum < 0 || errnum >= _sys_nerr) 00131 errno = EINVAL; 00132 #endif /* ACE_WIN32 */ 00133 errmsg = ::strerror (errnum); 00134 00135 if (errno == EINVAL || errmsg == 0 || errmsg[0] == 0) 00136 { 00137 ACE_OS::sprintf (ret_errortext, "Unknown error %d", errnum); 00138 errmsg = ret_errortext; 00139 g = EINVAL; 00140 } 00141 return errmsg; 00142 #endif /* ACE_LACKS_STRERROR */ 00143 }
ACE_Export const char * ACE_OS::strnchr | ( | const char * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (const char version).
Definition at line 157 of file OS_NS_string.cpp.
Referenced by strnchr().
00158 { 00159 for (size_t i = 0; i < len; ++i) 00160 if (s[i] == c) 00161 return s + i; 00162 00163 return 0; 00164 }
ACE_Export const ACE_WCHAR_T * ACE_OS::strnchr | ( | const ACE_WCHAR_T * | s, | |
ACE_WCHAR_T | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (const ACE_WCHAR_T version).
Definition at line 167 of file OS_NS_string.cpp.
00168 { 00169 for (size_t i = 0; i < len; ++i) 00170 if (s[i] == c) 00171 return s + i; 00172 00173 return 0; 00174 }
ACE_Export const char * ACE_OS::strnstr | ( | const char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (const char version).
Definition at line 177 of file OS_NS_string.cpp.
References memcmp(), and strlen().
Referenced by strnstr().
00178 { 00179 // Substring length 00180 size_t const len1 = ACE_OS::strlen (s1); 00181 00182 // Check if the substring is longer than the string being searched. 00183 if (len2 > len1) 00184 return 0; 00185 00186 // Go upto <len> 00187 size_t const len = len1 - len2; 00188 00189 for (size_t i = 0; i <= len; i++) 00190 { 00191 if (ACE_OS::memcmp (s1 + i, s2, len2) == 0) 00192 // Found a match! Return the index. 00193 return s1 + i; 00194 } 00195 00196 return 0; 00197 }
ACE_Export const ACE_WCHAR_T * ACE_OS::strnstr | ( | const ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (const wchar_t version).
Definition at line 200 of file OS_NS_string.cpp.
References ACE_WCHAR_T, memcmp(), and strlen().
00201 { 00202 // Substring length 00203 const size_t len1 = ACE_OS::strlen (s1); 00204 00205 // Check if the substring is longer than the string being searched. 00206 if (len2 > len1) 00207 return 0; 00208 00209 // Go upto <len> 00210 const size_t len = len1 - len2; 00211 00212 for (size_t i = 0; i <= len; i++) 00213 { 00214 if (ACE_OS::memcmp (s1 + i, s2, len2 * sizeof (ACE_WCHAR_T)) == 0) 00215 // Found a match! Return the index. 00216 return s1 + i; 00217 } 00218 00219 return 0; 00220 }
ACE_Export char * ACE_OS::strsncpy | ( | char * | dst, | |
const char * | src, | |||
size_t | maxlen | |||
) |
This is a "safe" c string copy function (char version).
Unlike strncpy() this function will always add a terminating '' char if maxlen > 0. So the user doesn't has to provide an extra '' if the user wants a '' terminated dst. The function doesn't check for a 0 dst, because this will give problems anyway. When src is 0 an empty string is made. We do not "touch" * dst if maxlen is 0. Returns dst. Care should be taken when replacing strncpy() calls, because in some cases a strncpy() user is using the "not '\0' terminating" feature from strncpy(). This happens most when the call to strncpy() was optimized by using a maxlen which is 1 smaller than the size because there's always written a '' inside this last position. Very seldom it's possible that the '' padding feature from strncpy() is needed.
Definition at line 284 of file OS_NS_string.cpp.
References strncat().
Referenced by ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), ACE_System_Time::ACE_System_Time(), ACE_UNIX_Addr::addr_to_string(), ACE_SPIPE_Addr::addr_to_string(), ACE_FILE_Addr::addr_to_string(), ACE_DEV_Addr::addr_to_string(), asctime_r(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), ctime_r(), ACE::dirname(), event_init(), ACE_Log_Msg::file(), ACE_INET_Addr::get_host_addr(), hostname(), ACE_Thru_Task<>::info(), ACE_Stream_Tail<>::info(), ACE_Stream_Head<>::info(), ACE_Stream_Type::info(), ACE_Module_Type::info(), ACE_Service_Manager::info(), ACE_Naming_Context::info(), ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info(), ACE_Oneshot_Acceptor< SVC_HANDLER, >::info(), ACE_Strategy_Acceptor< SVC_HANDLER, >::info(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info(), ACE_Log_Msg::log(), ACE_Log_Msg::msg(), ACE_Module< ACE_SYNCH_USE >::name(), ACE_Mem_Map::open(), ACE_FIFO::open(), ACE_String_Base< CHAR >::rep(), ACE_Local_Name_Space<, ACE_LOCK >::resolve_i(), ACE_UNIX_Addr::set(), ACE_SPIPE_Addr::set(), ACE_FILE_Addr::set(), ACE_DEV_Addr::set(), ACE_UNIX_Addr::string_to_addr(), ACE::strndup(), ACE::strnnew(), ACE::timestamp(), ACE_Name_Request::type(), and unique_name().
00285 { 00286 register char *rdst = dst; 00287 register const char *rsrc = src; 00288 register size_t rmaxlen = maxlen; 00289 00290 if (rmaxlen > 0) 00291 { 00292 if (rdst!=rsrc) 00293 { 00294 *rdst = '\0'; 00295 if (rsrc != 0) 00296 strncat (rdst, rsrc, --rmaxlen); 00297 } 00298 else 00299 { 00300 rdst += (rmaxlen - 1); 00301 *rdst = '\0'; 00302 } 00303 } 00304 return dst; 00305 }
ACE_Export ACE_WCHAR_T * ACE_OS::strsncpy | ( | ACE_WCHAR_T * | dst, | |
const ACE_WCHAR_T * | src, | |||
size_t | maxlen | |||
) |
This is a "safe" c string copy function (wchar_t version).
Unlike strncpy() this function will always add a terminating '' char if maxlen > 0. So the user doesn't has to provide an extra '' if the user wants a '' terminated dst. The function doesn't check for a 0 dst, because this will give problems anyway. When src is 0 an empty string is made. We do not "touch" * dst if maxlen is 0. Returns dst. Care should be taken when replacing strncpy() calls, because in some cases a strncpy() user is using the "not '\0' terminating" feature from strncpy(). This happens most when the call to strncpy() was optimized by using a maxlen which is 1 smaller than the size because there's always written a '' inside this last position. Very seldom it's possible that the '' padding feature from strncpy() is needed.
Definition at line 308 of file OS_NS_string.cpp.
References ACE_TEXT_WIDE, ACE_WCHAR_T, and strncat().
00309 { 00310 register ACE_WCHAR_T *rdst = dst; 00311 register const ACE_WCHAR_T *rsrc = src; 00312 register size_t rmaxlen = maxlen; 00313 00314 if (rmaxlen > 0) 00315 { 00316 if (rdst!=rsrc) 00317 { 00318 *rdst = ACE_TEXT_WIDE ('\0'); 00319 if (rsrc != 0) 00320 strncat (rdst, rsrc, --rmaxlen); 00321 } 00322 else 00323 { 00324 rdst += (rmaxlen - 1); 00325 *rdst = ACE_TEXT_WIDE ('\0'); 00326 } 00327 } 00328 return dst; 00329 }
ACE_Export char * ACE_OS::strtok_r_emulation | ( | char * | s, | |
const char * | tokens, | |||
char ** | lasts | |||
) |
Emulated strtok_r.
Definition at line 334 of file OS_NS_string.cpp.
References strlen(), and strtok().
Referenced by strtok_r().
00335 { 00336 if (s == 0) 00337 s = *lasts; 00338 else 00339 *lasts = s; 00340 if (*s == 0) // We have reached the end 00341 return 0; 00342 size_t l_org = ACE_OS::strlen (s); 00343 s = ::strtok (s, tokens); 00344 if (s == 0) 00345 return 0; 00346 const size_t l_sub = ACE_OS::strlen (s); 00347 if (s + l_sub < *lasts + l_org) 00348 *lasts = s + l_sub + 1; 00349 else 00350 *lasts = s + l_sub; 00351 return s ; 00352 }
ACE_NAMESPACE_INLINE_FUNCTION const void* ACE_OS::memchr | ( | const void * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds characters in a buffer (const void version).
Definition at line 13 of file OS_NS_string.inl.
Referenced by memchr().
00014 { 00015 #if !defined (ACE_LACKS_MEMCHR) 00016 return ::memchr (s, c, len); 00017 #else /* ACE_LACKS_MEMCHR */ 00018 return ACE_OS::memchr_emulation (s, c, len); 00019 #endif /* !ACE_LACKS_MEMCHR */ 00020 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::memchr | ( | void * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds characters in a buffer (void version).
Definition at line 23 of file OS_NS_string.inl.
References memchr().
00024 { 00025 return const_cast<void *> (ACE_OS::memchr (static_cast<const void *> (s), 00026 c, 00027 len)); 00028 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::memcmp | ( | const void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Compares two buffers.
Definition at line 31 of file OS_NS_string.inl.
References memcmp().
Referenced by ACE_String_Base< CHAR >::compare(), ACE_INET_Addr::get_host_name_i(), memcmp(), ACE_CDR::LongDouble::operator!=(), ACE_INET_Addr::operator<(), ACE_String_Base< CHAR >::operator==(), ACE_NS_String::operator==(), ACE_INET_Addr::operator==(), ACE_CDR::LongDouble::operator==(), and strnstr().
00032 { 00033 return ::memcmp (t, s, len); 00034 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::memcpy | ( | void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Copies one buffer to another.
Definition at line 37 of file OS_NS_string.inl.
References memcpy().
Referenced by ACE_Handle_Set::ACE_Handle_Set(), ACE_Message_Block::ACE_Message_Block(), ACE_Name_Request::ACE_Name_Request(), ACE_NS_String::ACE_NS_String(), ACE_SString::ACE_SString(), ACE_Task_Base::activate(), argv_to_string(), ACE_CDR::LongDouble::assign(), ACE_Data_Block::clone(), ACE_InputCDR::clone_from(), ACE_Obstack_T< CHAR >::copy(), ACE_Message_Block::copy(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Active_Map_Manager_Key::decode(), ACE_Active_Map_Manager_Key::encode(), ACE::get_bcast_addr(), ACE_Configuration_Heap::get_binary_value(), ACE_INET_Addr::get_host_name_i(), ACE_INET_Addr::get_ip_address(), ACE::get_ip_interfaces(), gethostbyaddr_r(), gethostbyname_r(), gethrtime(), getmacaddress(), ACE_CDR::grow(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::grow_heap(), ACE_Registry_ImpExp::import_config(), inet_pton(), ACE_Utils::UUID_Generator::init(), ACE_Svc_Conf_Lexer::input(), ACE_Codeset_Registry::locale_to_registry_i(), lwp_getparams(), memcpy(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), ACE_Name_Request::name(), ACE_CDR::LongDouble::operator NativeImpl(), putmsg(), ACE_InputCDR::read_array(), ACE_SOCK_Dgram::recv(), ACE_Codeset_Registry::registry_to_locale_i(), ACE_Obstack_T< CHAR >::request(), scandir_emulation(), ACE_SOCK_Dgram::send(), ACE_SPIPE_Addr::set(), ACE_INET_Addr::set(), ACE_UNIX_Addr::set_addr(), ACE_SPIPE_Addr::set_addr(), ACE_INET_Addr::set_address(), ACE_Configuration_Heap::set_binary_value(), set_scheduling_params(), ACE_Process_Options::setenv_i(), ACE_SOCK_SEQPACK_Connector::shared_connect_start(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), ACE_Data_Block::size(), ACE_Name_Request::value(), and ACE_OutputCDR::write_array().
00038 { 00039 #if defined (ACE_HAS_MEMCPY_LOOP_UNROLL) 00040 return fast_memcpy (t, s, len); 00041 #else 00042 return ::memcpy (t, s, len); 00043 #endif /* ACE_HAS_MEMCPY_LOOP_UNROLL */ 00044 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::memmove | ( | void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Moves one buffer to another.
Definition at line 47 of file OS_NS_string.inl.
References memmove().
Referenced by ACE_Message_Block::crunch(), memmove(), and ACE_Svc_Conf_Lexer::yylex().
00048 { 00049 return ::memmove (t, s, len); 00050 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::memset | ( | void * | s, | |
int | c, | |||
size_t | len | |||
) |
Fills a buffer with a character value.
Definition at line 53 of file OS_NS_string.inl.
References memset().
Referenced by ACE_Data_Block::ACE_Data_Block(), ACE_DEV_Addr::ACE_DEV_Addr(), ACE_INET_Addr::ACE_INET_Addr(), ACE_Mem_Map::ACE_Mem_Map(), ACE_Process::ACE_Process(), ACE_Process_Options::ACE_Process_Options(), ACE_SPIPE_Addr::ACE_SPIPE_Addr(), ACE_Task_Base::ACE_Task_Base(), ACE_UNIX_Addr::ACE_UNIX_Addr(), ACE_CDR::LongDouble::assign(), ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::calloc(), ACE_Dynamic_Cached_Allocator< ACE_LOCK >::calloc(), ACE_Cached_Allocator< T, ACE_LOCK >::calloc(), ACE_Static_Allocator_Base::calloc(), ACE_New_Allocator::calloc(), cond_init(), condattr_init(), ACE::count_interfaces(), ACE_Thread::disablecancel(), fork_exec(), ACE::get_bcast_addr(), ACE::get_ip_interfaces(), ACE_SOCK_SEQPACK_Association::get_local_addrs(), ACE_SOCK_SEQPACK_Association::get_remote_addrs(), gethostbyaddr_r(), gethostbyname_r(), getmacaddress(), getpeername(), getservbyname_r(), getsockname(), ACE_Filecache_Object::init(), lwp_getparams(), memset(), mutex_init(), ACE_Sched_Params::priority_max(), ACE_Sched_Params::priority_min(), ACE_INET_Addr::reset(), scheduling_class(), ACE_UNIX_Addr::set(), ACE_SPIPE_Addr::set(), ACE_INET_Addr::set(), ACE_DEV_Addr::set(), ACE_INET_Addr::set_address(), ACE::set_handle_limit(), set_scheduling_params(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), ACE_SOCK_Acceptor::shared_open(), thr_create(), and thr_setprio().
00054 { 00055 #if defined (ACE_HAS_SLOW_MEMSET) 00056 // This section requires a high optimization level (-xO4 with SunCC) 00057 // in order to actually be inlined. 00058 char* ptr = static_cast<char*> (s); 00059 switch (len) 00060 { 00061 case 16: 00062 ptr[15] = c; 00063 case 15: 00064 ptr[14] = c; 00065 case 14: 00066 ptr[13] = c; 00067 case 13: 00068 ptr[12] = c; 00069 case 12: 00070 ptr[11] = c; 00071 case 11: 00072 ptr[10] = c; 00073 case 10: 00074 ptr[9] = c; 00075 case 9: 00076 ptr[8] = c; 00077 case 8: 00078 ptr[7] = c; 00079 case 7: 00080 ptr[6] = c; 00081 case 6: 00082 ptr[5] = c; 00083 case 5: 00084 ptr[4] = c; 00085 case 4: 00086 ptr[3] = c; 00087 case 3: 00088 ptr[2] = c; 00089 case 2: 00090 ptr[1] = c; 00091 case 1: 00092 ptr[0] = c; 00093 break; 00094 default: 00095 for (size_t i = 0; i < len; ++i) 00096 { 00097 ptr[i] = c; 00098 } 00099 } 00100 00101 return s; 00102 #else 00103 return ::memset (s, c, len); 00104 #endif /* ACE_HAS_SLOW_MEMSET */ 00105 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strcat | ( | char * | s, | |
const char * | t | |||
) |
Appends a string to another string (char version).
Definition at line 108 of file OS_NS_string.inl.
References strcat().
Referenced by ACE_MEM_Acceptor::accept(), ACE_ARGV_T< CHAR_TYPE >::ACE_ARGV_T(), ACE_Logging_Strategy::ACE_Logging_Strategy(), ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), ACE_Name_Options::ACE_Name_Options(), ACE_System_Time::ACE_System_Time(), ACE_Process_Options::command_line(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), event_init(), ACE_INET_Addr::get_host_addr(), ACE::ldfind(), ACE::ldname(), ACE_Service_Manager::list_services(), ACE_DLL_Handle::open(), sema_init(), ACE_SPIPE_Addr::set(), ACE_FILE_Addr::set(), strcat(), and uname().
00109 { 00110 return ::strcat (s, t); 00111 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::strchr | ( | const char * | s, | |
int | c | |||
) |
Finds the first occurance of a character in a string (const char version).
Definition at line 126 of file OS_NS_string.inl.
Referenced by ACE_ARGV_T< CHAR_TYPE >::add(), ACE_INET_Addr::addr_to_string(), argv_to_string(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_SString::find(), ACE::get_fqdn(), ACE_Service_Manager::handle_input(), ACE_Ini_ImpExp::import_config(), ACE_Registry_ImpExp::import_config(), ACE_Get_Opt::long_option(), ACE_Configuration_Heap::open_section(), ACE_Registry_ImpExp::process_previous_line_format(), putenv(), ACE_Svc_Conf_Lexer::scan(), ACE_SPIPE_Addr::set(), ACE_Get_Opt::short_option_i(), strchr(), strenvdup(), and ACE_INET_Addr::string_to_addr().
00127 { 00128 return const_cast <const char *> (::strchr (s, c)); 00129 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strchr | ( | char * | s, | |
int | c | |||
) |
Finds the first occurance of a character in a string (char version).
Definition at line 144 of file OS_NS_string.inl.
References strchr().
00145 { 00146 return ::strchr (s, c); 00147 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strcmp | ( | const char * | s, | |
const char * | t | |||
) |
Compares two strings (char version).
Definition at line 160 of file OS_NS_string.inl.
Referenced by ACE_Log_Msg::ACE_Log_Msg(), ACE_Service_Gestalt::add_processed_static_svc(), ACE_Malloc_FIFO_Iterator_T<, ACE_LOCK, ACE_CB >::advance(), ACE_Malloc_LIFO_Iterator_T<, ACE_LOCK, ACE_CB >::advance(), alphasort(), ACE_SString::compare(), ACE_SOCK_Dgram_Mcast::dump(), ACE_Stream<>::find(), ACE_Stream_Type::find(), ACE_DLL_Manager::find_dll(), ACE_Service_Repository::find_i(), ACE_Service_Gestalt::find_processed_static_svc(), ACE_Service_Gestalt::find_static_svc_descriptor(), inet_aton(), ACE_Stream<>::insert(), ACE_Capabilities::is_entry(), ACE::ldfind(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), ACE_Naming_Context::local(), ACE_Codeset_Registry::locale_to_registry_i(), open(), ACE_DLL_Handle::open(), ACE_Service_Config::open_i(), ACE_DLL::open_i(), ACE_Less_Than< char * >::operator()(), ACE_Less_Than< const char * >::operator()(), ACE_Equal_To< char * >::operator()(), ACE_Equal_To< const char * >::operator()(), ACE_SString::operator<(), ACE_SString::operator==(), ACE_SPIPE_Addr::operator==(), ACE_Static_Svc_Descriptor::operator==(), ACE_Name_Binding::operator==(), ACE_FILE_Addr::operator==(), ACE_DEV_Addr::operator==(), ACE_SString::operator>(), ACE_Name_Options::parse_args(), ACE_Get_Opt::permute(), ACE_Logging_Strategy::priorities(), ACE_Service_Manager::process_request(), ACE_Stream<>::remove(), ACE_Framework_Repository::remove_component(), ACE_Framework_Repository::remove_dll_components_i(), ACE_Stream<>::replace(), ACE_Svc_Conf_Lexer::scan(), ACE_INET_Addr::set(), ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::shared_find(), strcmp(), ACE_Logging_Strategy::tokenize(), and ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::unbind().
00161 { 00162 return ::strcmp (s, t); 00163 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strcmp | ( | const ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t | |||
) |
Compares two strings (wchar_t version).
Definition at line 166 of file OS_NS_string.inl.
References wcscmp_emulation().
00167 { 00168 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSCMP) 00169 return ACE_OS::wcscmp_emulation (s, t); 00170 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */ 00171 return ::wcscmp (s, t); 00172 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */ 00173 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strcpy | ( | char * | s, | |
const char * | t | |||
) |
Copies a string (char version).
Definition at line 176 of file OS_NS_string.inl.
References strcpy().
Referenced by ACE_ARGV_T< CHAR_TYPE >::ACE_ARGV_T(), ACE_Filecache_Object::ACE_Filecache_Object(), ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), ACE_Control_Block::ACE_Name_Node::ACE_Name_Node(), ACE_Name_Options::ACE_Name_Options(), ACE_SString::ACE_SString(), ACE_System_Time::ACE_System_Time(), ACE_Configuration_Heap::add_section(), ACE_SDM_helpers::addr_to_string(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), ctime_r(), cuserid(), dlsym(), ACE_SOCK_Dgram_Mcast::dump(), ACE::execname(), ACE_Log_Record::format_msg(), ACE::get_fqdn(), ACE_INET_Addr::get_host_name(), ACE_INET_Addr::get_host_name_i(), ACE::get_temp_dir(), gethostbyaddr_r(), gethostbyname_r(), getmacaddress(), inet_ntop(), ACE::ldfind(), ACE::ldname(), ACE_Service_Manager::list_services(), ACE_Log_Msg_UNIX_Syslog::log(), ACE_Log_Msg::log(), ACE_SOCK_Dgram::make_multicast_ifaddr(), ACE_Log_Record::msg_data(), ACE_Configuration_Heap::new_section(), ACE_DLL_Strategy< SVC_HANDLER >::open(), ACE_SOCK_Dgram_Mcast::open_i(), ACE_SString::operator=(), ACE_Sched_Params::priority_max(), ACE_Sched_Params::priority_min(), ACE_Process_Options::process_name(), ACE_Service_Gestalt::Processed_Static_Svc::Processed_Static_Svc(), ACE_InputCDR::read_string(), ACE_Remote_Name_Space::resolve(), scandir_emulation(), scheduling_class(), sema_init(), ACE_UNIX_Addr::set(), ACE_SPIPE_Addr::set(), ACE_FILE_Addr::set(), ACE_Configuration_Heap::set_binary_value(), ACE_Configuration_Heap::set_integer_value(), ACE_Configuration_Heap::set_string_value(), ACE_Local_Name_Space<, ACE_LOCK >::shared_bind_i(), strcpy(), strenvdup(), ACE::strnew(), uname(), and ACE_Process_Options::working_directory().
00177 { 00178 return ::strcpy (s, t); 00179 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strcspn | ( | const char * | s, | |
const char * | reject | |||
) |
Searches for the first substring without any of the specified characters and returns the size of the substring (char version).
Definition at line 194 of file OS_NS_string.inl.
References strcspn().
Referenced by strcspn(), strenvdup(), and ACE_Configuration::validate_name().
00195 { 00196 return ::strcspn (s, reject); 00197 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strdup | ( | const char * | s | ) |
Returns a malloced duplicated string (char version).
Definition at line 212 of file OS_NS_string.inl.
References strdup().
Referenced by ACE_Argv_Type_Converter::ACE_Argv_Type_Converter(), ACE_Configuration_Section_Key_Heap::ACE_Configuration_Section_Key_Heap(), ACE_Mutex::ACE_Mutex(), ACE_Name_Options::ACE_Name_Options(), ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor(), ACE_Name_Options::database(), event_init(), flock_init(), ACE_Thru_Task<>::info(), ACE_Stream_Tail<>::info(), ACE_Stream_Head<>::info(), ACE_Stream_Type::info(), ACE_Module_Type::info(), ACE_Service_Manager::info(), ACE_Naming_Context::info(), ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info(), ACE_Oneshot_Acceptor< SVC_HANDLER, >::info(), ACE_Strategy_Acceptor< SVC_HANDLER, >::info(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info(), ACE::ldfind(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), ACE_Log_Msg::local_host(), ACE_Name_Options::nameserver_host(), ACE_Name_Options::namespace_dir(), ACE_Log_Msg::open(), ACE_Strategy_Acceptor< SVC_HANDLER, >::open(), ACE_Name_Binding::operator=(), ACE_Name_Options::process_name(), putenv(), sema_init(), ACE_SPIPE_Addr::set(), strdup(), strenvdup(), ACE_INET_Addr::string_to_addr(), string_to_argv(), and ACE_Log_Msg::sync().
00213 { 00214 # if (defined (ACE_LACKS_STRDUP) && !defined(ACE_STRDUP_EQUIVALENT)) \ 00215 || defined (ACE_HAS_STRDUP_EMULATION) 00216 return ACE_OS::strdup_emulation (s); 00217 # elif defined (ACE_STRDUP_EQUIVALENT) 00218 return ACE_STRDUP_EQUIVALENT (s); 00219 # elif defined (ACE_HAS_NONCONST_STRDUP) 00220 return ::strdup (const_cast<char *> (s)); 00221 #else 00222 return ::strdup (s); 00223 # endif /* (ACE_LACKS_STRDUP && !ACE_STRDUP_EQUIVALENT) || ... */ 00224 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strlen | ( | const char * | s | ) |
Finds the length of a string (char version).
Definition at line 244 of file OS_NS_string.inl.
Referenced by ACE_MEM_Acceptor::accept(), ACE_ARGV_T< CHAR_TYPE >::ACE_ARGV_T(), ACE_NS_WString::ACE_NS_WString(), ACE_SString::ACE_SString(), ACE_ARGV_T< CHAR_TYPE >::add(), ACE_Configuration_Heap::add_section(), ACE_INET_Addr::addr_to_string(), argv_to_string(), ACE_Remote_Name_Space::bind(), ACE_Message_Block::copy(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), ACE_Arg_Shifter_T< CHAR_TYPE >::cur_arg_strncasecmp(), cuserid(), dlsym(), ACE::execname(), ACE::get_fqdn(), ACE_INET_Addr::get_host_addr(), ACE_INET_Addr::get_host_name_i(), ACE::get_temp_dir(), gethostbyaddr_r(), gethostbyname_r(), ACE_Logging_Strategy::handle_timeout(), ACE::hash_pjw(), ACE_Ini_ImpExp::import_config(), ACE_Registry_ImpExp::import_config(), inet_ntop(), ACE_Thru_Task<>::info(), ACE_Stream_Tail<>::info(), ACE_Stream_Head<>::info(), ACE_Stream_Type::info(), ACE_Module_Type::info(), ACE_Service_Manager::info(), ACE_Naming_Context::info(), ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info(), ACE_Oneshot_Acceptor< SVC_HANDLER, >::info(), ACE_Strategy_Acceptor< SVC_HANDLER, >::info(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info(), ACE_Svc_Conf_Lexer::input(), ACE::ldfind(), ACE::ldname(), ACE_Service_Manager::list_services(), ACE_Log_Msg::log(), ACE_Log_Msg::log_hexdump(), ACE_Get_Opt::long_option_i(), ACE_Log_Record::msg_data(), ACE_Log_Record::msg_data_len(), ACE_Configuration_Heap::open(), ACE_SOCK_Dgram_Mcast::open_i(), operator+(), ACE_String_Base< CHAR >::operator+=(), operator<<(), ACE_String_Base< CHAR >::operator==(), operator>>(), ACE_Log_Record::print(), ACE_High_Res_Timer::print_ave(), ACE_High_Res_Timer::print_total(), ACE_Service_Gestalt::Processed_Static_Svc::Processed_Static_Svc(), ACE_Remote_Name_Space::rebind(), ACE_SString::rep(), ACE_Local_Name_Space<, ACE_LOCK >::resolve_i(), ACE_Log_Record::round_up(), scandir_emulation(), ACE_UNIX_Addr::set(), ACE_String_Base< CHAR >::set(), ACE_SPIPE_Addr::set(), ACE_FILE_Addr::set(), ACE_DEV_Addr::set(), ACE_Configuration_Heap::set_binary_value(), ACE_Configuration_Heap::set_integer_value(), ACE_Configuration_Heap::set_string_value(), ACE_Process_Options::setenv(), ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::shared_bind(), ACE_Local_Name_Space<, ACE_LOCK >::shared_bind_i(), ACE_Process::spawn(), ACE_Ini_ImpExp::squish(), strenvdup(), strlen(), ACE::strnew(), strnstr(), ACE::strsplit_r(), strtok_r_emulation(), ACE_OutputCDR::write_string(), ACE_SizeCDR::write_string(), ACE_OutputCDR::write_wstring(), and ACE_SizeCDR::write_wstring().
00245 { 00246 return ::strlen (s); 00247 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strlen | ( | const ACE_WCHAR_T * | s | ) |
Finds the length of a string (ACE_WCHAR_T version).
Definition at line 250 of file OS_NS_string.inl.
References wcslen_emulation().
00251 { 00252 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSLEN) 00253 return ACE_OS::wcslen_emulation (s); 00254 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */ 00255 return ::wcslen (s); 00256 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */ 00257 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strncat | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Appends part of a string to another string (char version).
Definition at line 260 of file OS_NS_string.inl.
Referenced by ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), strncat(), and strsncpy().
00261 { 00262 #if 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 00263 strncat_s (s, len + 1, t, _TRUNCATE); 00264 return s; 00265 #else 00266 return ::strncat (s, t, len); 00267 #endif /* ACE_HAS_TR24731_2005_CRT */ 00268 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T* ACE_OS::strncat | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Appends part of a string to another string (wchar_t version).
Definition at line 271 of file OS_NS_string.inl.
References wcsncat_emulation().
00272 { 00273 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCAT) 00274 return ACE_OS::wcsncat_emulation (s, t, len); 00275 # elif 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 00276 wcsncat_s (s, len + 1, t, _TRUNCATE); 00277 return s; 00278 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */ 00279 return ::wcsncat (s, t, len); 00280 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */ 00281 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strnchr | ( | char * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (char version).
Definition at line 284 of file OS_NS_string.inl.
00285 { 00286 return const_cast<char *> (ACE_OS::strnchr (static_cast<const char *> (s), 00287 c, 00288 len)); 00289 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T* ACE_OS::strnchr | ( | ACE_WCHAR_T * | s, | |
ACE_WCHAR_T | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (ACE_WCHAR_T version).
Definition at line 292 of file OS_NS_string.inl.
References strnchr().
00293 { 00294 return 00295 const_cast<ACE_WCHAR_T *> (ACE_OS::strnchr ( 00296 const_cast<const ACE_WCHAR_T *> (s), 00297 c, 00298 len)); 00299 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strncmp | ( | const char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Compares two arrays (char version).
Definition at line 302 of file OS_NS_string.inl.
Referenced by ACE_Registry_ImpExp::import_config(), ACE_Get_Opt::long_option_i(), ACE_UNIX_Addr::operator==(), ACE_SPIPE_Addr::set(), and strncmp().
00303 { 00304 return ::strncmp (s, t, len); 00305 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strncmp | ( | const ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Compares two arrays (wchar_t version).
Definition at line 308 of file OS_NS_string.inl.
References wcsncmp_emulation().
00309 { 00310 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCMP) 00311 return ACE_OS::wcsncmp_emulation (s, t, len); 00312 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */ 00313 return ::wcsncmp (s, t, len); 00314 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */ 00315 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strncpy | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Copies an array (char version).
Definition at line 318 of file OS_NS_string.inl.
Referenced by dlerror(), event_init(), ACE_DLL_Handle::open(), ACE_Svc_Conf_Lexer::scan(), strenvdup(), strerror(), and strncpy().
00319 { 00320 return ::strncpy (s, t, len); 00321 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T* ACE_OS::strncpy | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Copies an array (ACE_WCHAR_T version).
Definition at line 324 of file OS_NS_string.inl.
References wcsncpy_emulation().
00325 { 00326 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCPY) 00327 return ACE_OS::wcsncpy_emulation (s, t, len); 00328 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */ 00329 return ::wcsncpy (s, t, len); 00330 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */ 00331 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strnlen | ( | const char * | s, | |
size_t | maxlen | |||
) |
Finds the length of a limited-length string (char version).
s | The character string to find the length of. | |
maxlen | The maximum number of characters that will be scanned for the terminating nul character. |
Definition at line 334 of file OS_NS_string.inl.
Referenced by strnlen().
00335 { 00336 #if defined (ACE_HAS_STRNLEN) 00337 return ::strnlen (s, maxlen); 00338 #else /* ACE_HAS_STRNLEN */ 00339 size_t i; 00340 for (i = 0; i < maxlen; ++i) 00341 if (s[i] == '\0') 00342 break; 00343 return i; 00344 #endif /* ACE_HAS_STRNLEN */ 00345 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strnlen | ( | const ACE_WCHAR_T * | s, | |
size_t | maxlen | |||
) |
Finds the length of a limited-length string (ACE_WCHAR_T version).
s | The character string to find the length of. | |
maxlen | The maximum number of characters that will be scanned for the terminating nul character. |
Definition at line 348 of file OS_NS_string.inl.
00349 { 00350 #if defined (ACE_HAS_WCHAR) && defined (ACE_HAS_WCSNLEN) 00351 return wcsnlen (s, maxlen); 00352 #else /* ACE_HAS_WCSNLEN */ 00353 size_t i; 00354 for (i = 0; i < maxlen; ++i) 00355 if (s[i] == '\0') 00356 break; 00357 return i; 00358 #endif /* ACE_HAS_WCSNLEN */ 00359 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strnstr | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (char version).
Definition at line 362 of file OS_NS_string.inl.
00363 { 00364 return 00365 const_cast <char *> (ACE_OS::strnstr (const_cast <const char *> (s), t, len)); 00366 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_WCHAR_T* ACE_OS::strnstr | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (wchar_t version).
Definition at line 369 of file OS_NS_string.inl.
References strnstr().
00370 { 00371 return 00372 const_cast<ACE_WCHAR_T *> (ACE_OS::strnstr ( 00373 static_cast<const ACE_WCHAR_T *> (s), 00374 t, 00375 len)); 00376 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::strpbrk | ( | const char * | s1, | |
const char * | s2 | |||
) |
Searches for characters in a string (const char version).
Definition at line 379 of file OS_NS_string.inl.
Referenced by ACE_Registry_ImpExp::process_previous_line_format(), and strpbrk().
00380 { 00381 return const_cast <const char *> (::strpbrk (s1, s2)); 00382 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strpbrk | ( | char * | s1, | |
const char * | s2 | |||
) |
Searches for characters in a string (char version).
Definition at line 397 of file OS_NS_string.inl.
References strpbrk().
00398 { 00399 return ::strpbrk (s1, s2); 00400 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::strrchr | ( | const char * | s, | |
int | c | |||
) |
Finds the last occurance of a character in a string (const char version).
Definition at line 412 of file OS_NS_string.inl.
Referenced by ACE_SDM_helpers::addr_to_string(), ACE::basename(), ACE::dirname(), ACE::execname(), ACE_Ini_ImpExp::import_config(), ACE_Registry_ImpExp::import_config(), ACE::ldfind(), sema_init(), setprogname_emulation(), ACE_INET_Addr::string_to_addr(), and strrchr().
00413 { 00414 #if defined (ACE_LACKS_STRRCHR) 00415 return ACE_OS::strrchr_emulation (s, c); 00416 #else /* ! ACE_LACKS_STRRCHR */ 00417 return (const char *) ::strrchr (s, c); 00418 #endif /* ! ACE_LACKS_STRRCHR */ 00419 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strrchr | ( | char * | s, | |
int | c | |||
) |
Finds the last occurance of a character in a string (char version).
Definition at line 434 of file OS_NS_string.inl.
References strrchr().
00435 { 00436 #if defined (ACE_LACKS_STRRCHR) 00437 return ACE_OS::strrchr_emulation (s, c); 00438 #else /* ! ACE_LACKS_STRRCHR */ 00439 return ::strrchr (s, c); 00440 #endif /* ! ACE_LACKS_STRRCHR */ 00441 }
ACE_NAMESPACE_INLINE_FUNCTION size_t ACE_OS::strspn | ( | const char * | s1, | |
const char * | s2 | |||
) |
Searches for the first substring containing only the specified characters and returns the size of the substring (char version).
Definition at line 453 of file OS_NS_string.inl.
References strspn().
Referenced by ACE_Arg_Shifter_T< CHAR_TYPE >::cur_arg_strncasecmp(), and strspn().
00454 { 00455 return ::strspn (s, t); 00456 }
ACE_NAMESPACE_INLINE_FUNCTION const char* ACE_OS::strstr | ( | const char * | s, | |
const char * | t | |||
) |
Finds the first occurance of a substring in a string (const char version).
Definition at line 471 of file OS_NS_string.inl.
Referenced by ACE_SString::find(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), ACE::strsplit_r(), and strstr().
00472 { 00473 return (const char *) ::strstr (s, t); 00474 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strstr | ( | char * | s, | |
const char * | t | |||
) |
Finds the first occurance of a substring in a string (char version).
Definition at line 491 of file OS_NS_string.inl.
References strstr().
00492 { 00493 return ::strstr (s, t); 00494 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strtok | ( | char * | s, | |
const char * | tokens | |||
) |
Finds the next token in a string (char version).
Definition at line 511 of file OS_NS_string.inl.
References strtok().
Referenced by strtok(), and strtok_r_emulation().
00512 { 00513 return ::strtok (s, tokens); 00514 }
ACE_NAMESPACE_INLINE_FUNCTION char* ACE_OS::strtok_r | ( | char * | s, | |
const char * | tokens, | |||
char ** | lasts | |||
) |
Finds the next token in a string (safe char version).
Definition at line 530 of file OS_NS_string.inl.
References strtok_r(), and strtok_r_emulation().
Referenced by ACE_Log_Msg_UNIX_Syslog::log(), ACE_Logging_Strategy::priorities(), strtok_r(), and ACE_Logging_Strategy::tokenize().
00531 { 00532 #if defined (ACE_HAS_TR24731_2005_CRT) 00533 return strtok_s (s, tokens, lasts); 00534 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (ACE_LACKS_STRTOK_R) 00535 return ::strtok_r (s, tokens, lasts); 00536 #else 00537 return ACE_OS::strtok_r_emulation (s, tokens, lasts); 00538 #endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */ 00539 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE const void* ACE_OS::memchr | ( | const void * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds characters in a buffer (const void version).
Definition at line 13 of file OS_NS_string.inl.
References memchr().
00014 { 00015 #if !defined (ACE_LACKS_MEMCHR) 00016 return ::memchr (s, c, len); 00017 #else /* ACE_LACKS_MEMCHR */ 00018 return ACE_OS::memchr_emulation (s, c, len); 00019 #endif /* !ACE_LACKS_MEMCHR */ 00020 }
ACE_INLINE void* ACE_OS::memchr | ( | void * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds characters in a buffer (void version).
Definition at line 23 of file OS_NS_string.inl.
References memchr().
00024 { 00025 return const_cast<void *> (ACE_OS::memchr (static_cast<const void *> (s), 00026 c, 00027 len)); 00028 }
ACE_INLINE int ACE_OS::memcmp | ( | const void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Compares two buffers.
Definition at line 31 of file OS_NS_string.inl.
References memcmp().
Referenced by ACE_String_Base< CHAR >::compare(), ACE_INET_Addr::get_host_name_i(), memcmp(), ACE_CDR::LongDouble::operator!=(), ACE_INET_Addr::operator<(), ACE_CDR::LongDouble::operator==(), ACE_INET_Addr::operator==(), ACE_NS_String::operator==(), ACE_String_Base< CHAR >::operator==(), and strnstr().
00032 { 00033 return ::memcmp (t, s, len); 00034 }
ACE_INLINE void* ACE_OS::memcpy | ( | void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Copies one buffer to another.
Definition at line 37 of file OS_NS_string.inl.
References memcpy().
Referenced by ACE_Handle_Set::ACE_Handle_Set(), ACE_Message_Block::ACE_Message_Block(), ACE_Name_Request::ACE_Name_Request(), ACE_NS_String::ACE_NS_String(), ACE_SString::ACE_SString(), ACE_Task_Base::activate(), argv_to_string(), ACE_CDR::LongDouble::assign(), ACE_Data_Block::clone(), ACE_InputCDR::clone_from(), ACE_Message_Block::copy(), ACE_Obstack_T< CHAR >::copy(), ACE_ARGV_T< CHAR_TYPE >::create_buf_from_queue(), ACE_Active_Map_Manager_Key::decode(), ACE_Active_Map_Manager_Key::encode(), ACE::get_bcast_addr(), ACE_Configuration_Heap::get_binary_value(), ACE_INET_Addr::get_host_name_i(), ACE_INET_Addr::get_ip_address(), ACE::get_ip_interfaces(), gethostbyaddr_r(), gethostbyname_r(), gethrtime(), getmacaddress(), ACE_CDR::grow(), ACE_Timer_Heap_T< TYPE, FUNCTOR, ACE_LOCK >::grow_heap(), ACE_Registry_ImpExp::import_config(), inet_pton(), ACE_Utils::UUID_Generator::init(), ACE_Svc_Conf_Lexer::input(), ACE_Codeset_Registry::locale_to_registry_i(), lwp_getparams(), memcpy(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), ACE_Name_Request::name(), ACE_CDR::LongDouble::operator NativeImpl(), putmsg(), ACE_InputCDR::read_array(), ACE_SOCK_Dgram::recv(), ACE_Codeset_Registry::registry_to_locale_i(), ACE_Obstack_T< CHAR >::request(), scandir_emulation(), ACE_SOCK_Dgram::send(), ACE_INET_Addr::set(), ACE_SPIPE_Addr::set(), ACE_SPIPE_Addr::set_addr(), ACE_UNIX_Addr::set_addr(), ACE_INET_Addr::set_address(), ACE_Configuration_Heap::set_binary_value(), set_scheduling_params(), ACE_Process_Options::setenv_i(), ACE_SOCK_SEQPACK_Connector::shared_connect_start(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), ACE_Data_Block::size(), ACE_Name_Request::value(), and ACE_OutputCDR::write_array().
00038 { 00039 #if defined (ACE_HAS_MEMCPY_LOOP_UNROLL) 00040 return fast_memcpy (t, s, len); 00041 #else 00042 return ::memcpy (t, s, len); 00043 #endif /* ACE_HAS_MEMCPY_LOOP_UNROLL */ 00044 }
ACE_INLINE void* ACE_OS::memmove | ( | void * | t, | |
const void * | s, | |||
size_t | len | |||
) |
Moves one buffer to another.
Definition at line 47 of file OS_NS_string.inl.
References memmove().
Referenced by ACE_Message_Block::crunch(), memmove(), and ACE_Svc_Conf_Lexer::yylex().
00048 { 00049 return ::memmove (t, s, len); 00050 }
ACE_INLINE void* ACE_OS::memset | ( | void * | s, | |
int | c, | |||
size_t | len | |||
) |
Fills a buffer with a character value.
Definition at line 53 of file OS_NS_string.inl.
References memset().
Referenced by ACE_Data_Block::ACE_Data_Block(), ACE_DEV_Addr::ACE_DEV_Addr(), ACE_INET_Addr::ACE_INET_Addr(), ACE_Mem_Map::ACE_Mem_Map(), ACE_Process::ACE_Process(), ACE_Process_Options::ACE_Process_Options(), ACE_SPIPE_Addr::ACE_SPIPE_Addr(), ACE_Task_Base::ACE_Task_Base(), ACE_UNIX_Addr::ACE_UNIX_Addr(), ACE_CDR::LongDouble::assign(), ACE_New_Allocator::calloc(), ACE_Static_Allocator_Base::calloc(), ACE_Cached_Allocator< T, ACE_LOCK >::calloc(), ACE_Dynamic_Cached_Allocator< ACE_LOCK >::calloc(), ACE_Malloc_T< ACE_MEM_POOL_2, ACE_LOCK, ACE_CB >::calloc(), cond_init(), condattr_init(), ACE::count_interfaces(), ACE_Thread::disablecancel(), fork_exec(), ACE::get_bcast_addr(), ACE::get_ip_interfaces(), ACE_SOCK_SEQPACK_Association::get_local_addrs(), ACE_SOCK_SEQPACK_Association::get_remote_addrs(), gethostbyaddr_r(), gethostbyname_r(), getmacaddress(), getpeername(), getservbyname_r(), getsockname(), ACE_Filecache_Object::init(), lwp_getparams(), memset(), mutex_init(), ACE_Sched_Params::priority_max(), ACE_Sched_Params::priority_min(), ACE_INET_Addr::reset(), scheduling_class(), ACE_DEV_Addr::set(), ACE_INET_Addr::set(), ACE_SPIPE_Addr::set(), ACE_UNIX_Addr::set(), ACE_INET_Addr::set_address(), ACE::set_handle_limit(), set_scheduling_params(), ACE_SOCK_Acceptor::shared_open(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), thr_create(), and thr_setprio().
00054 { 00055 #if defined (ACE_HAS_SLOW_MEMSET) 00056 // This section requires a high optimization level (-xO4 with SunCC) 00057 // in order to actually be inlined. 00058 char* ptr = static_cast<char*> (s); 00059 switch (len) 00060 { 00061 case 16: 00062 ptr[15] = c; 00063 case 15: 00064 ptr[14] = c; 00065 case 14: 00066 ptr[13] = c; 00067 case 13: 00068 ptr[12] = c; 00069 case 12: 00070 ptr[11] = c; 00071 case 11: 00072 ptr[10] = c; 00073 case 10: 00074 ptr[9] = c; 00075 case 9: 00076 ptr[8] = c; 00077 case 8: 00078 ptr[7] = c; 00079 case 7: 00080 ptr[6] = c; 00081 case 6: 00082 ptr[5] = c; 00083 case 5: 00084 ptr[4] = c; 00085 case 4: 00086 ptr[3] = c; 00087 case 3: 00088 ptr[2] = c; 00089 case 2: 00090 ptr[1] = c; 00091 case 1: 00092 ptr[0] = c; 00093 break; 00094 default: 00095 for (size_t i = 0; i < len; ++i) 00096 { 00097 ptr[i] = c; 00098 } 00099 } 00100 00101 return s; 00102 #else 00103 return ::memset (s, c, len); 00104 #endif /* ACE_HAS_SLOW_MEMSET */ 00105 }
ACE_INLINE char* ACE_OS::strcat | ( | char * | s, | |
const char * | t | |||
) |
Appends a string to another string (char version).
Definition at line 108 of file OS_NS_string.inl.
References strcat().
Referenced by ACE_MEM_Acceptor::accept(), ACE_ARGV_T< CHAR_TYPE >::ACE_ARGV_T(), ACE_Logging_Strategy::ACE_Logging_Strategy(), ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), ACE_Name_Options::ACE_Name_Options(), ACE_System_Time::ACE_System_Time(), ACE_Process_Options::command_line(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), event_init(), ACE_INET_Addr::get_host_addr(), ACE::ldfind(), ACE::ldname(), ACE_Service_Manager::list_services(), ACE_DLL_Handle::open(), sema_init(), ACE_FILE_Addr::set(), ACE_SPIPE_Addr::set(), strcat(), and uname().
00109 { 00110 return ::strcat (s, t); 00111 }
ACE_INLINE const char* ACE_OS::strchr | ( | const char * | s, | |
int | c | |||
) |
Finds the first occurance of a character in a string (const char version).
Definition at line 126 of file OS_NS_string.inl.
References strchr().
00127 { 00128 return const_cast <const char *> (::strchr (s, c)); 00129 }
ACE_INLINE char* ACE_OS::strchr | ( | char * | s, | |
int | c | |||
) |
Finds the first occurance of a character in a string (char version).
Definition at line 144 of file OS_NS_string.inl.
References strchr().
00145 { 00146 return ::strchr (s, c); 00147 }
ACE_INLINE int ACE_OS::strcmp | ( | const char * | s, | |
const char * | t | |||
) |
Compares two strings (char version).
Definition at line 160 of file OS_NS_string.inl.
References strcmp().
00161 { 00162 return ::strcmp (s, t); 00163 }
ACE_INLINE int ACE_OS::strcmp | ( | const ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t | |||
) |
Compares two strings (wchar_t version).
Definition at line 166 of file OS_NS_string.inl.
References wcscmp_emulation().
00167 { 00168 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSCMP) 00169 return ACE_OS::wcscmp_emulation (s, t); 00170 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */ 00171 return ::wcscmp (s, t); 00172 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSCMP */ 00173 }
ACE_INLINE char* ACE_OS::strcpy | ( | char * | s, | |
const char * | t | |||
) |
Copies a string (char version).
Definition at line 176 of file OS_NS_string.inl.
References strcpy().
Referenced by ACE_ARGV_T< CHAR_TYPE >::ACE_ARGV_T(), ACE_Filecache_Object::ACE_Filecache_Object(), ACE_MMAP_Memory_Pool::ACE_MMAP_Memory_Pool(), ACE_Control_Block::ACE_Name_Node::ACE_Name_Node(), ACE_Name_Options::ACE_Name_Options(), ACE_SString::ACE_SString(), ACE_System_Time::ACE_System_Time(), ACE_Configuration_Heap::add_section(), ACE_SDM_helpers::addr_to_string(), ACE_Local_Name_Space<, ACE_LOCK >::create_manager_i(), ctime_r(), cuserid(), dlsym(), ACE_SOCK_Dgram_Mcast::dump(), ACE::execname(), ACE_Log_Record::format_msg(), ACE::get_fqdn(), ACE_INET_Addr::get_host_name(), ACE_INET_Addr::get_host_name_i(), ACE::get_temp_dir(), gethostbyaddr_r(), gethostbyname_r(), getmacaddress(), inet_ntop(), ACE::ldfind(), ACE::ldname(), ACE_Service_Manager::list_services(), ACE_Log_Msg::log(), ACE_Log_Msg_UNIX_Syslog::log(), ACE_SOCK_Dgram::make_multicast_ifaddr(), ACE_Log_Record::msg_data(), ACE_Configuration_Heap::new_section(), ACE_DLL_Strategy< SVC_HANDLER >::open(), ACE_SOCK_Dgram_Mcast::open_i(), ACE_SString::operator=(), ACE_Sched_Params::priority_max(), ACE_Sched_Params::priority_min(), ACE_Process_Options::process_name(), ACE_Service_Gestalt::Processed_Static_Svc::Processed_Static_Svc(), ACE_InputCDR::read_string(), ACE_Remote_Name_Space::resolve(), scandir_emulation(), scheduling_class(), sema_init(), ACE_FILE_Addr::set(), ACE_SPIPE_Addr::set(), ACE_UNIX_Addr::set(), ACE_Configuration_Heap::set_binary_value(), ACE_Configuration_Heap::set_integer_value(), ACE_Configuration_Heap::set_string_value(), ACE_Local_Name_Space<, ACE_LOCK >::shared_bind_i(), strcpy(), strenvdup(), ACE::strnew(), uname(), and ACE_Process_Options::working_directory().
00177 { 00178 return ::strcpy (s, t); 00179 }
ACE_INLINE size_t ACE_OS::strcspn | ( | const char * | s, | |
const char * | reject | |||
) |
Searches for the first substring without any of the specified characters and returns the size of the substring (char version).
Definition at line 194 of file OS_NS_string.inl.
References strcspn().
Referenced by strcspn(), strenvdup(), and ACE_Configuration::validate_name().
00195 { 00196 return ::strcspn (s, reject); 00197 }
ACE_INLINE char* ACE_OS::strdup | ( | const char * | s | ) |
Returns a malloced duplicated string (char version).
Definition at line 212 of file OS_NS_string.inl.
References strdup().
Referenced by ACE_Argv_Type_Converter::ACE_Argv_Type_Converter(), ACE_Configuration_Section_Key_Heap::ACE_Configuration_Section_Key_Heap(), ACE_Mutex::ACE_Mutex(), ACE_Name_Options::ACE_Name_Options(), ACE_Strategy_Acceptor< SVC_HANDLER, >::ACE_Strategy_Acceptor(), ACE_Name_Options::database(), event_init(), flock_init(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::info(), ACE_Strategy_Acceptor< SVC_HANDLER, >::info(), ACE_Oneshot_Acceptor< SVC_HANDLER, >::info(), ACE_Connector< SVC_HANDLER, ACE_PEER_CONNECTOR_2 >::info(), ACE_Naming_Context::info(), ACE_Service_Manager::info(), ACE_Module_Type::info(), ACE_Stream_Type::info(), ACE_Stream_Head<>::info(), ACE_Stream_Tail<>::info(), ACE_Thru_Task<>::info(), ACE::ldfind(), ACE_Local_Name_Space<, ACE_LOCK >::list_type_entries_i(), ACE_Local_Name_Space<, ACE_LOCK >::list_types_i(), ACE_Log_Msg::local_host(), ACE_Name_Options::nameserver_host(), ACE_Name_Options::namespace_dir(), ACE_Strategy_Acceptor< SVC_HANDLER, >::open(), ACE_Log_Msg::open(), ACE_Name_Binding::operator=(), ACE_Name_Options::process_name(), putenv(), sema_init(), ACE_SPIPE_Addr::set(), strdup(), strenvdup(), ACE_INET_Addr::string_to_addr(), string_to_argv(), and ACE_Log_Msg::sync().
00213 { 00214 # if (defined (ACE_LACKS_STRDUP) && !defined(ACE_STRDUP_EQUIVALENT)) \ 00215 || defined (ACE_HAS_STRDUP_EMULATION) 00216 return ACE_OS::strdup_emulation (s); 00217 # elif defined (ACE_STRDUP_EQUIVALENT) 00218 return ACE_STRDUP_EQUIVALENT (s); 00219 # elif defined (ACE_HAS_NONCONST_STRDUP) 00220 return ::strdup (const_cast<char *> (s)); 00221 #else 00222 return ::strdup (s); 00223 # endif /* (ACE_LACKS_STRDUP && !ACE_STRDUP_EQUIVALENT) || ... */ 00224 }
ACE_INLINE size_t ACE_OS::strlen | ( | const char * | s | ) |
Finds the length of a string (char version).
Definition at line 244 of file OS_NS_string.inl.
References strlen().
00245 { 00246 return ::strlen (s); 00247 }
ACE_INLINE size_t ACE_OS::strlen | ( | const ACE_WCHAR_T * | s | ) |
Finds the length of a string (ACE_WCHAR_T version).
Definition at line 250 of file OS_NS_string.inl.
References wcslen_emulation().
00251 { 00252 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSLEN) 00253 return ACE_OS::wcslen_emulation (s); 00254 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */ 00255 return ::wcslen (s); 00256 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSLEN */ 00257 }
ACE_INLINE char* ACE_OS::strncat | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Appends part of a string to another string (char version).
Definition at line 260 of file OS_NS_string.inl.
References strncat().
00261 { 00262 #if 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 00263 strncat_s (s, len + 1, t, _TRUNCATE); 00264 return s; 00265 #else 00266 return ::strncat (s, t, len); 00267 #endif /* ACE_HAS_TR24731_2005_CRT */ 00268 }
ACE_INLINE ACE_WCHAR_T* ACE_OS::strncat | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Appends part of a string to another string (wchar_t version).
Definition at line 271 of file OS_NS_string.inl.
References wcsncat_emulation().
00272 { 00273 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCAT) 00274 return ACE_OS::wcsncat_emulation (s, t, len); 00275 # elif 0 /* defined (ACE_HAS_TR24731_2005_CRT) */ 00276 wcsncat_s (s, len + 1, t, _TRUNCATE); 00277 return s; 00278 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */ 00279 return ::wcsncat (s, t, len); 00280 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCAT */ 00281 }
ACE_INLINE char* ACE_OS::strnchr | ( | char * | s, | |
int | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (char version).
Definition at line 284 of file OS_NS_string.inl.
References strnchr().
00285 { 00286 return const_cast<char *> (ACE_OS::strnchr (static_cast<const char *> (s), 00287 c, 00288 len)); 00289 }
ACE_INLINE ACE_WCHAR_T* ACE_OS::strnchr | ( | ACE_WCHAR_T * | s, | |
ACE_WCHAR_T | c, | |||
size_t | len | |||
) |
Finds the first occurance of a character in an array (ACE_WCHAR_T version).
Definition at line 292 of file OS_NS_string.inl.
References strnchr().
00293 { 00294 return 00295 const_cast<ACE_WCHAR_T *> (ACE_OS::strnchr ( 00296 const_cast<const ACE_WCHAR_T *> (s), 00297 c, 00298 len)); 00299 }
ACE_INLINE int ACE_OS::strncmp | ( | const char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Compares two arrays (char version).
Definition at line 302 of file OS_NS_string.inl.
References strncmp().
00303 { 00304 return ::strncmp (s, t, len); 00305 }
ACE_INLINE int ACE_OS::strncmp | ( | const ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Compares two arrays (wchar_t version).
Definition at line 308 of file OS_NS_string.inl.
References wcsncmp_emulation().
00309 { 00310 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCMP) 00311 return ACE_OS::wcsncmp_emulation (s, t, len); 00312 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */ 00313 return ::wcsncmp (s, t, len); 00314 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCMP */ 00315 }
ACE_INLINE char* ACE_OS::strncpy | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Copies an array (char version).
Definition at line 318 of file OS_NS_string.inl.
References strncpy().
00319 { 00320 return ::strncpy (s, t, len); 00321 }
ACE_INLINE ACE_WCHAR_T* ACE_OS::strncpy | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Copies an array (ACE_WCHAR_T version).
Definition at line 324 of file OS_NS_string.inl.
References wcsncpy_emulation().
00325 { 00326 # if !defined (ACE_HAS_WCHAR) || defined (ACE_LACKS_WCSNCPY) 00327 return ACE_OS::wcsncpy_emulation (s, t, len); 00328 # else /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */ 00329 return ::wcsncpy (s, t, len); 00330 # endif /* !ACE_HAS_WCHAR || ACE_LACKS_WCSNCPY */ 00331 }
ACE_INLINE size_t ACE_OS::strnlen | ( | const char * | s, | |
size_t | maxlen | |||
) |
Finds the length of a limited-length string (char version).
s | The character string to find the length of. | |
maxlen | The maximum number of characters that will be scanned for the terminating nul character. |
Definition at line 334 of file OS_NS_string.inl.
References strnlen().
00335 { 00336 #if defined (ACE_HAS_STRNLEN) 00337 return ::strnlen (s, maxlen); 00338 #else /* ACE_HAS_STRNLEN */ 00339 size_t i; 00340 for (i = 0; i < maxlen; ++i) 00341 if (s[i] == '\0') 00342 break; 00343 return i; 00344 #endif /* ACE_HAS_STRNLEN */ 00345 }
ACE_INLINE size_t ACE_OS::strnlen | ( | const ACE_WCHAR_T * | s, | |
size_t | maxlen | |||
) |
Finds the length of a limited-length string (ACE_WCHAR_T version).
s | The character string to find the length of. | |
maxlen | The maximum number of characters that will be scanned for the terminating nul character. |
Definition at line 348 of file OS_NS_string.inl.
00349 { 00350 #if defined (ACE_HAS_WCHAR) && defined (ACE_HAS_WCSNLEN) 00351 return wcsnlen (s, maxlen); 00352 #else /* ACE_HAS_WCSNLEN */ 00353 size_t i; 00354 for (i = 0; i < maxlen; ++i) 00355 if (s[i] == '\0') 00356 break; 00357 return i; 00358 #endif /* ACE_HAS_WCSNLEN */ 00359 }
ACE_INLINE char* ACE_OS::strnstr | ( | char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (char version).
Definition at line 362 of file OS_NS_string.inl.
References strnstr().
00363 { 00364 return 00365 const_cast <char *> (ACE_OS::strnstr (const_cast <const char *> (s), t, len)); 00366 }
ACE_INLINE ACE_WCHAR_T* ACE_OS::strnstr | ( | ACE_WCHAR_T * | s, | |
const ACE_WCHAR_T * | t, | |||
size_t | len | |||
) |
Finds the first occurance of a substring in an array (wchar_t version).
Definition at line 369 of file OS_NS_string.inl.
References strnstr().
00370 { 00371 return 00372 const_cast<ACE_WCHAR_T *> (ACE_OS::strnstr ( 00373 static_cast<const ACE_WCHAR_T *> (s), 00374 t, 00375 len)); 00376 }
ACE_INLINE const char* ACE_OS::strpbrk | ( | const char * | s1, | |
const char * | s2 | |||
) |
Searches for characters in a string (const char version).
Definition at line 379 of file OS_NS_string.inl.
References strpbrk().
00380 { 00381 return const_cast <const char *> (::strpbrk (s1, s2)); 00382 }
ACE_INLINE char* ACE_OS::strpbrk | ( | char * | s1, | |
const char * | s2 | |||
) |
Searches for characters in a string (char version).
Definition at line 397 of file OS_NS_string.inl.
References strpbrk().
00398 { 00399 return ::strpbrk (s1, s2); 00400 }
ACE_INLINE const char* ACE_OS::strrchr | ( | const char * | s, | |
int | c | |||
) |
Finds the last occurance of a character in a string (const char version).
Definition at line 412 of file OS_NS_string.inl.
References strrchr().
00413 { 00414 #if defined (ACE_LACKS_STRRCHR) 00415 return ACE_OS::strrchr_emulation (s, c); 00416 #else /* ! ACE_LACKS_STRRCHR */ 00417 return (const char *) ::strrchr (s, c); 00418 #endif /* ! ACE_LACKS_STRRCHR */ 00419 }
ACE_INLINE char* ACE_OS::strrchr | ( | char * | s, | |
int | c | |||
) |
Finds the last occurance of a character in a string (char version).
Definition at line 434 of file OS_NS_string.inl.
References strrchr().
00435 { 00436 #if defined (ACE_LACKS_STRRCHR) 00437 return ACE_OS::strrchr_emulation (s, c); 00438 #else /* ! ACE_LACKS_STRRCHR */ 00439 return ::strrchr (s, c); 00440 #endif /* ! ACE_LACKS_STRRCHR */ 00441 }
ACE_INLINE size_t ACE_OS::strspn | ( | const char * | s1, | |
const char * | s2 | |||
) |
Searches for the first substring containing only the specified characters and returns the size of the substring (char version).
Definition at line 453 of file OS_NS_string.inl.
References strspn().
Referenced by ACE_Arg_Shifter_T< CHAR_TYPE >::cur_arg_strncasecmp(), and strspn().
00454 { 00455 return ::strspn (s, t); 00456 }
ACE_INLINE const char* ACE_OS::strstr | ( | const char * | s, | |
const char * | t | |||
) |
Finds the first occurance of a substring in a string (const char version).
Definition at line 471 of file OS_NS_string.inl.
References strstr().
00472 { 00473 return (const char *) ::strstr (s, t); 00474 }
ACE_INLINE char* ACE_OS::strstr | ( | char * | s, | |
const char * | t | |||
) |
Finds the first occurance of a substring in a string (char version).
Definition at line 491 of file OS_NS_string.inl.
References strstr().
00492 { 00493 return ::strstr (s, t); 00494 }
ACE_INLINE char* ACE_OS::strtok | ( | char * | s, | |
const char * | tokens | |||
) |
Finds the next token in a string (char version).
Definition at line 511 of file OS_NS_string.inl.
References strtok().
Referenced by strtok(), and strtok_r_emulation().
00512 { 00513 return ::strtok (s, tokens); 00514 }
ACE_INLINE char* ACE_OS::strtok_r | ( | char * | s, | |
const char * | tokens, | |||
char ** | lasts | |||
) |
Finds the next token in a string (safe char version).
Definition at line 530 of file OS_NS_string.inl.
References strtok_r(), and strtok_r_emulation().
Referenced by ACE_Log_Msg_UNIX_Syslog::log(), ACE_Logging_Strategy::priorities(), strtok_r(), and ACE_Logging_Strategy::tokenize().
00531 { 00532 #if defined (ACE_HAS_TR24731_2005_CRT) 00533 return strtok_s (s, tokens, lasts); 00534 #elif defined (ACE_HAS_REENTRANT_FUNCTIONS) && !defined (ACE_LACKS_STRTOK_R) 00535 return ::strtok_r (s, tokens, lasts); 00536 #else 00537 return ACE_OS::strtok_r_emulation (s, tokens, lasts); 00538 #endif /* (ACE_HAS_REENTRANT_FUNCTIONS) */ 00539 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strcasecmp | ( | const char * | s, | |
const char * | t | |||
) |
Compares two strings (case insensitive const char version).
Definition at line 12 of file OS_NS_strings.inl.
References strcasecmp().
Referenced by ACE_TTY_IO::control(), ACE::execname(), ACE::ldfind(), ACE_Configuration_ExtId::operator==(), ACE_Name_Options::parse_args(), and strcasecmp().
00013 { 00014 #if defined (ACE_LACKS_STRCASECMP) 00015 return ACE_OS::strcasecmp_emulation (s, t); 00016 #elif defined (ACE_STRCASECMP_EQUIVALENT) 00017 return ACE_STRCASECMP_EQUIVALENT (s, t); 00018 #else /* ACE_LACKS_STRCASECMP */ 00019 return ::strcasecmp (s, t); 00020 #endif /* ACE_LACKS_STRCASECMP */ 00021 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::strncasecmp | ( | const char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Compares two arrays (case insensitive const char version).
Definition at line 36 of file OS_NS_strings.inl.
References strncasecmp().
Referenced by ACE_Arg_Shifter_T< CHAR_TYPE >::cur_arg_strncasecmp(), and strncasecmp().
00037 { 00038 #if defined (ACE_LACKS_STRCASECMP) 00039 return ACE_OS::strncasecmp_emulation (s, t, len); 00040 #elif defined (ACE_STRNCASECMP_EQUIVALENT) 00041 return ACE_STRNCASECMP_EQUIVALENT (s, t, len); 00042 #else /* ACE_LACKS_STRCASECMP */ 00043 return ::strncasecmp (s, t, len); 00044 #endif /* ACE_LACKS_STRCASECMP */ 00045 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::strcasecmp | ( | const char * | s, | |
const char * | t | |||
) |
Compares two strings (case insensitive const char version).
Definition at line 12 of file OS_NS_strings.inl.
References strcasecmp().
Referenced by ACE_TTY_IO::control(), ACE::execname(), ACE::ldfind(), ACE_Configuration_ExtId::operator==(), ACE_Name_Options::parse_args(), and strcasecmp().
00013 { 00014 #if defined (ACE_LACKS_STRCASECMP) 00015 return ACE_OS::strcasecmp_emulation (s, t); 00016 #elif defined (ACE_STRCASECMP_EQUIVALENT) 00017 return ACE_STRCASECMP_EQUIVALENT (s, t); 00018 #else /* ACE_LACKS_STRCASECMP */ 00019 return ::strcasecmp (s, t); 00020 #endif /* ACE_LACKS_STRCASECMP */ 00021 }
ACE_INLINE int ACE_OS::strncasecmp | ( | const char * | s, | |
const char * | t, | |||
size_t | len | |||
) |
Compares two arrays (case insensitive const char version).
Definition at line 36 of file OS_NS_strings.inl.
References strncasecmp().
Referenced by ACE_Arg_Shifter_T< CHAR_TYPE >::cur_arg_strncasecmp(), and strncasecmp().
00037 { 00038 #if defined (ACE_LACKS_STRCASECMP) 00039 return ACE_OS::strncasecmp_emulation (s, t, len); 00040 #elif defined (ACE_STRNCASECMP_EQUIVALENT) 00041 return ACE_STRNCASECMP_EQUIVALENT (s, t, len); 00042 #else /* ACE_LACKS_STRCASECMP */ 00043 return ::strncasecmp (s, t, len); 00044 #endif /* ACE_LACKS_STRCASECMP */ 00045 }
ACE_Export int ACE_OS::ioctl | ( | ACE_HANDLE | socket, | |
unsigned long | io_control_code, | |||
void * | in_buffer_p, | |||
unsigned long | in_buffer, | |||
void * | out_buffer_p, | |||
unsigned long | out_buffer, | |||
unsigned long * | bytes_returned, | |||
ACE_OVERLAPPED * | overlapped, | |||
ACE_OVERLAPPED_COMPLETION_FUNC | func | |||
) |
QoS-enabled <ioctl>.
Definition at line 14 of file OS_NS_stropts.cpp.
References ACE_NOTSUP_RETURN, and ACE_SOCKCALL_RETURN.
Referenced by ACE_SPIPE_Acceptor::accept(), ACE::clr_flags(), ACE_IPC_SAP::control(), ACE_IO_SAP::control(), ACE::count_interfaces(), ACE_SPIPE_Acceptor::create_new_instance(), ACE_IPC_SAP::disable(), ACE_IPC_SAP::enable(), ACE::get_bcast_addr(), ACE::get_ip_interfaces(), getmacaddress(), ioctl(), ACE_SOCK_Dgram::make_multicast_ifaddr(), ACE_SOCK_Dgram_Bcast::mk_broadcast(), ACE_Pipe::open(), ACE_SOCK_Dgram::recv(), ACE_SPIPE_Stream::recv_handle(), ACE_SOCK_IO::recvv(), ACE_SPIPE_Stream::send_handle(), and ACE::set_flags().
00023 { 00024 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00025 ACE_SOCKCALL_RETURN (::WSAIoctl ((ACE_SOCKET) socket, 00026 io_control_code, 00027 in_buffer_p, 00028 in_buffer, 00029 out_buffer_p, 00030 out_buffer, 00031 bytes_returned, 00032 (WSAOVERLAPPED *) overlapped, 00033 func), 00034 int, 00035 SOCKET_ERROR); 00036 # else 00037 ACE_UNUSED_ARG (socket); 00038 ACE_UNUSED_ARG (io_control_code); 00039 ACE_UNUSED_ARG (in_buffer_p); 00040 ACE_UNUSED_ARG (in_buffer); 00041 ACE_UNUSED_ARG (out_buffer_p); 00042 ACE_UNUSED_ARG (out_buffer); 00043 ACE_UNUSED_ARG (bytes_returned); 00044 ACE_UNUSED_ARG (overlapped); 00045 ACE_UNUSED_ARG (func); 00046 ACE_NOTSUP_RETURN (-1); 00047 # endif /* ACE_HAS_WINSOCK2 */ 00048 }
ACE_Export int ACE_OS::ioctl | ( | ACE_HANDLE | socket, | |
unsigned long | io_control_code, | |||
ACE_QoS & | ace_qos, | |||
unsigned long * | bytes_returned, | |||
void * | buffer_p = 0 , |
|||
unsigned long | buffer = 0 , |
|||
ACE_OVERLAPPED * | overlapped = 0 , |
|||
ACE_OVERLAPPED_COMPLETION_FUNC | func = 0 | |||
) |
QoS-enabled <ioctl> when the I/O control code is either SIO_SET_QOS or SIO_GET_QOS.
Definition at line 52 of file OS_NS_stropts.cpp.
References ACE_NEW_RETURN, ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, ACE_QoS::provider_specific(), ACE_QoS::receiving_flowspec(), and ACE_QoS::sending_flowspec().
00060 { 00061 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00062 00063 QOS qos; 00064 unsigned long qos_len = sizeof (QOS); 00065 00066 if (io_control_code == SIO_SET_QOS) 00067 { 00068 qos.SendingFlowspec = *(ace_qos.sending_flowspec ()); 00069 qos.ReceivingFlowspec = *(ace_qos.receiving_flowspec ()); 00070 qos.ProviderSpecific = (WSABUF) ace_qos.provider_specific (); 00071 00072 qos_len += ace_qos.provider_specific ().iov_len; 00073 00074 ACE_SOCKCALL_RETURN (::WSAIoctl ((ACE_SOCKET) socket, 00075 io_control_code, 00076 &qos, 00077 qos_len, 00078 buffer_p, 00079 buffer, 00080 bytes_returned, 00081 (WSAOVERLAPPED *) overlapped, 00082 func), 00083 int, 00084 SOCKET_ERROR); 00085 } 00086 else 00087 { 00088 unsigned long dwBufferLen = 0; 00089 00090 // Query for the buffer size. 00091 int result = ::WSAIoctl ((ACE_SOCKET) socket, 00092 io_control_code, 00093 0, 00094 0, 00095 &dwBufferLen, 00096 sizeof (dwBufferLen), 00097 bytes_returned, 00098 0, 00099 0); 00100 00101 00102 if (result == SOCKET_ERROR) 00103 { 00104 unsigned long dwErr = ::WSAGetLastError (); 00105 00106 if (dwErr == WSAEWOULDBLOCK) 00107 { 00108 errno = dwErr; 00109 return -1; 00110 } 00111 else 00112 if (dwErr != WSAENOBUFS) 00113 { 00114 errno = dwErr; 00115 return -1; 00116 } 00117 } 00118 00119 char *qos_buf = 0; 00120 ACE_NEW_RETURN (qos_buf, 00121 char [dwBufferLen], 00122 -1); 00123 00124 QOS *qos = reinterpret_cast<QOS*> (qos_buf); 00125 00126 result = ::WSAIoctl ((ACE_SOCKET) socket, 00127 io_control_code, 00128 0, 00129 0, 00130 qos, 00131 dwBufferLen, 00132 bytes_returned, 00133 0, 00134 0); 00135 00136 if (result == SOCKET_ERROR) 00137 return result; 00138 00139 ACE_Flow_Spec sending_flowspec (qos->SendingFlowspec.TokenRate, 00140 qos->SendingFlowspec.TokenBucketSize, 00141 qos->SendingFlowspec.PeakBandwidth, 00142 qos->SendingFlowspec.Latency, 00143 qos->SendingFlowspec.DelayVariation, 00144 # if defined(ACE_HAS_WINSOCK2_GQOS) 00145 qos->SendingFlowspec.ServiceType, 00146 qos->SendingFlowspec.MaxSduSize, 00147 qos->SendingFlowspec.MinimumPolicedSize, 00148 # else /* ACE_HAS_WINSOCK2_GQOS */ 00149 0, 00150 0, 00151 0, 00152 # endif /* ACE_HAS_WINSOCK2_GQOS */ 00153 0, 00154 0); 00155 00156 ACE_Flow_Spec receiving_flowspec (qos->ReceivingFlowspec.TokenRate, 00157 qos->ReceivingFlowspec.TokenBucketSize, 00158 qos->ReceivingFlowspec.PeakBandwidth, 00159 qos->ReceivingFlowspec.Latency, 00160 qos->ReceivingFlowspec.DelayVariation, 00161 # if defined(ACE_HAS_WINSOCK2_GQOS) 00162 qos->ReceivingFlowspec.ServiceType, 00163 qos->ReceivingFlowspec.MaxSduSize, 00164 qos->ReceivingFlowspec.MinimumPolicedSize, 00165 # else /* ACE_HAS_WINSOCK2_GQOS */ 00166 0, 00167 0, 00168 0, 00169 # endif /* ACE_HAS_WINSOCK2_GQOS */ 00170 0, 00171 0); 00172 00173 ace_qos.sending_flowspec (&sending_flowspec); 00174 ace_qos.receiving_flowspec (&receiving_flowspec); 00175 ace_qos.provider_specific (*((struct iovec *) (&qos->ProviderSpecific))); 00176 00177 00178 return result; 00179 } 00180 00181 # else 00182 ACE_UNUSED_ARG (socket); 00183 ACE_UNUSED_ARG (io_control_code); 00184 ACE_UNUSED_ARG (ace_qos); 00185 ACE_UNUSED_ARG (bytes_returned); 00186 ACE_UNUSED_ARG (buffer_p); 00187 ACE_UNUSED_ARG (buffer); 00188 ACE_UNUSED_ARG (overlapped); 00189 ACE_UNUSED_ARG (func); 00190 ACE_NOTSUP_RETURN (-1); 00191 # endif /* ACE_HAS_WINSOCK2 */ 00192 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getmsg | ( | ACE_HANDLE | handle, | |
struct strbuf * | ctl, | |||
struct strbuf * | data, | |||
int * | flags | |||
) |
Definition at line 39 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getmsg().
Referenced by getmsg(), ACE_SPIPE_Stream::recv(), and ACE_FIFO_Recv_Msg::recv().
00043 { 00044 ACE_OS_TRACE ("ACE_OS::getmsg"); 00045 #if defined (ACE_HAS_STREAM_PIPES) 00046 ACE_OSCALL_RETURN (::getmsg (handle, ctl, data, flags), int, -1); 00047 #else 00048 ACE_UNUSED_ARG (handle); 00049 ACE_UNUSED_ARG (ctl); 00050 ACE_UNUSED_ARG (data); 00051 ACE_UNUSED_ARG (flags); 00052 00053 // I'm not sure how to implement this correctly. 00054 ACE_NOTSUP_RETURN (-1); 00055 #endif /* ACE_HAS_STREAM_PIPES */ 00056 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getpmsg | ( | ACE_HANDLE | handle, | |
struct strbuf * | ctl, | |||
struct strbuf * | data, | |||
int * | band, | |||
int * | flags | |||
) |
Definition at line 59 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getpmsg().
Referenced by getpmsg(), and ACE_SPIPE_Stream::recv().
00064 { 00065 ACE_OS_TRACE ("ACE_OS::getpmsg"); 00066 #if defined (ACE_HAS_STREAM_PIPES) 00067 ACE_OSCALL_RETURN (::getpmsg (handle, ctl, data, band, flags), int, -1); 00068 #else 00069 ACE_UNUSED_ARG (handle); 00070 ACE_UNUSED_ARG (ctl); 00071 ACE_UNUSED_ARG (data); 00072 ACE_UNUSED_ARG (band); 00073 ACE_UNUSED_ARG (flags); 00074 00075 // I'm not sure how to implement this correctly. 00076 ACE_NOTSUP_RETURN (-1); 00077 #endif /* ACE_HAS_STREAM_PIPES */ 00078 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fattach | ( | int | handle, | |
const char * | path | |||
) |
Definition at line 81 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fattach().
Referenced by ACE_SPIPE_Acceptor::create_new_instance(), and fattach().
00082 { 00083 ACE_OS_TRACE ("ACE_OS::fattach"); 00084 #if defined (ACE_HAS_STREAM_PIPES) 00085 ACE_OSCALL_RETURN (::fattach (handle, path), int, -1); 00086 #else 00087 ACE_UNUSED_ARG (handle); 00088 ACE_UNUSED_ARG (path); 00089 00090 ACE_NOTSUP_RETURN (-1); 00091 #endif /* ACE_HAS_STREAM_PIPES */ 00092 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::fdetach | ( | const char * | file | ) |
Definition at line 95 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fdetach().
Referenced by ACE_SPIPE_Acceptor::close(), and fdetach().
00096 { 00097 ACE_OS_TRACE ("ACE_OS::fdetach"); 00098 #if defined (ACE_HAS_STREAM_PIPES) 00099 ACE_OSCALL_RETURN (::fdetach (file), int, -1); 00100 #else 00101 ACE_UNUSED_ARG (file); 00102 00103 ACE_NOTSUP_RETURN (-1); 00104 #endif /* ACE_HAS_STREAM_PIPES */ 00105 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::ioctl | ( | ACE_HANDLE | handle, | |
ACE_IOCTL_TYPE_ARG2 | cmd, | |||
void * | = 0 | |||
) |
UNIX-style <ioctl>.
Definition at line 108 of file OS_NS_stropts.inl.
References ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and ioctl().
00111 { 00112 ACE_OS_TRACE ("ACE_OS::ioctl"); 00113 00114 #if defined (ACE_WIN32) 00115 ACE_SOCKET sock = (ACE_SOCKET) handle; 00116 ACE_SOCKCALL_RETURN (::ioctlsocket (sock, cmd, reinterpret_cast<unsigned long *> (val)), int, -1); 00117 #elif defined (ACE_HAS_IOCTL_INT_3_PARAM) 00118 ACE_OSCALL_RETURN (::ioctl (handle, cmd, reinterpret_cast<int> (val)), 00119 int, -1); 00120 #else 00121 ACE_OSCALL_RETURN (::ioctl (handle, cmd, val), int, -1); 00122 #endif /* ACE_WIN32 */ 00123 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::isastream | ( | ACE_HANDLE | handle | ) |
Definition at line 126 of file OS_NS_stropts.inl.
Referenced by isastream().
00127 { 00128 ACE_OS_TRACE ("ACE_OS::isastream"); 00129 #if defined (ACE_HAS_STREAM_PIPES) 00130 ACE_OSCALL_RETURN (::isastream (handle), int, -1); 00131 #else 00132 ACE_UNUSED_ARG (handle); 00133 00134 ACE_NOTSUP_RETURN (-1); 00135 #endif /* ACE_HAS_STREAM_PIPES */ 00136 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::putmsg | ( | ACE_HANDLE | handle, | |
const struct strbuf * | ctl, | |||
const struct strbuf * | data, | |||
int | flags | |||
) |
Definition at line 139 of file OS_NS_stropts.inl.
References ACE_NEW_RETURN, ACE_OS_TRACE, strbuf::buf, memcpy(), putmsg(), and write().
Referenced by putmsg(), putpmsg(), ACE_SPIPE_Stream::send(), and ACE_FIFO_Send_Msg::send().
00141 { 00142 ACE_OS_TRACE ("ACE_OS::putmsg"); 00143 #if defined (ACE_HAS_STREAM_PIPES) 00144 ACE_OSCALL_RETURN (::putmsg (handle, 00145 (ACE_STRBUF_TYPE) ctl, 00146 (ACE_STRBUF_TYPE) data, 00147 flags), int, -1); 00148 #else 00149 ACE_UNUSED_ARG (flags); 00150 ssize_t result; 00151 if (ctl == 0 && data == 0) 00152 { 00153 errno = EINVAL; 00154 return 0; 00155 } 00156 // Handle the two easy cases. 00157 else if (ctl != 0) 00158 { 00159 result = ACE_OS::write (handle, ctl->buf, ctl->len); 00160 return static_cast<int> (result); 00161 } 00162 else if (data != 0) 00163 { 00164 result = ACE_OS::write (handle, data->buf, data->len); 00165 return static_cast<int> (result); 00166 } 00167 else 00168 { 00169 // This is the hard case. 00170 char *buf; 00171 ACE_NEW_RETURN (buf, char [ctl->len + data->len], -1); 00172 ACE_OS::memcpy (buf, ctl->buf, ctl->len); 00173 ACE_OS::memcpy (buf + ctl->len, data->buf, data->len); 00174 result = ACE_OS::write (handle, buf, ctl->len + data->len); 00175 delete [] buf; 00176 return static_cast<int> (result); 00177 } 00178 #endif /* ACE_HAS_STREAM_PIPES */ 00179 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::putpmsg | ( | ACE_HANDLE | handle, | |
const struct strbuf * | ctl, | |||
const struct strbuf * | data, | |||
int | band, | |||
int | flags | |||
) |
Definition at line 182 of file OS_NS_stropts.inl.
References ACE_OS_TRACE, putmsg(), and putpmsg().
Referenced by putpmsg(), and ACE_SPIPE_Stream::send().
00187 { 00188 ACE_OS_TRACE ("ACE_OS::putpmsg"); 00189 #if defined (ACE_HAS_STREAM_PIPES) 00190 ACE_OSCALL_RETURN (::putpmsg (handle, 00191 (ACE_STRBUF_TYPE) ctl, 00192 (ACE_STRBUF_TYPE) data, 00193 band, flags), int, -1); 00194 #else 00195 ACE_UNUSED_ARG (flags); 00196 ACE_UNUSED_ARG (band); 00197 return ACE_OS::putmsg (handle, ctl, data, flags); 00198 #endif /* ACE_HAS_STREAM_PIPES */ 00199 }
ACE_INLINE int ACE_OS::getmsg | ( | ACE_HANDLE | handle, | |
struct strbuf * | ctl, | |||
struct strbuf * | data, | |||
int * | flags | |||
) |
Definition at line 39 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getmsg().
Referenced by getmsg(), ACE_FIFO_Recv_Msg::recv(), and ACE_SPIPE_Stream::recv().
00043 { 00044 ACE_OS_TRACE ("ACE_OS::getmsg"); 00045 #if defined (ACE_HAS_STREAM_PIPES) 00046 ACE_OSCALL_RETURN (::getmsg (handle, ctl, data, flags), int, -1); 00047 #else 00048 ACE_UNUSED_ARG (handle); 00049 ACE_UNUSED_ARG (ctl); 00050 ACE_UNUSED_ARG (data); 00051 ACE_UNUSED_ARG (flags); 00052 00053 // I'm not sure how to implement this correctly. 00054 ACE_NOTSUP_RETURN (-1); 00055 #endif /* ACE_HAS_STREAM_PIPES */ 00056 }
ACE_INLINE int ACE_OS::getpmsg | ( | ACE_HANDLE | handle, | |
struct strbuf * | ctl, | |||
struct strbuf * | data, | |||
int * | band, | |||
int * | flags | |||
) |
Definition at line 59 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getpmsg().
Referenced by getpmsg(), and ACE_SPIPE_Stream::recv().
00064 { 00065 ACE_OS_TRACE ("ACE_OS::getpmsg"); 00066 #if defined (ACE_HAS_STREAM_PIPES) 00067 ACE_OSCALL_RETURN (::getpmsg (handle, ctl, data, band, flags), int, -1); 00068 #else 00069 ACE_UNUSED_ARG (handle); 00070 ACE_UNUSED_ARG (ctl); 00071 ACE_UNUSED_ARG (data); 00072 ACE_UNUSED_ARG (band); 00073 ACE_UNUSED_ARG (flags); 00074 00075 // I'm not sure how to implement this correctly. 00076 ACE_NOTSUP_RETURN (-1); 00077 #endif /* ACE_HAS_STREAM_PIPES */ 00078 }
ACE_INLINE int ACE_OS::fattach | ( | int | handle, | |
const char * | path | |||
) |
Definition at line 81 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fattach().
Referenced by ACE_SPIPE_Acceptor::create_new_instance(), and fattach().
00082 { 00083 ACE_OS_TRACE ("ACE_OS::fattach"); 00084 #if defined (ACE_HAS_STREAM_PIPES) 00085 ACE_OSCALL_RETURN (::fattach (handle, path), int, -1); 00086 #else 00087 ACE_UNUSED_ARG (handle); 00088 ACE_UNUSED_ARG (path); 00089 00090 ACE_NOTSUP_RETURN (-1); 00091 #endif /* ACE_HAS_STREAM_PIPES */ 00092 }
ACE_INLINE int ACE_OS::fdetach | ( | const char * | file | ) |
Definition at line 95 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and fdetach().
Referenced by ACE_SPIPE_Acceptor::close(), and fdetach().
00096 { 00097 ACE_OS_TRACE ("ACE_OS::fdetach"); 00098 #if defined (ACE_HAS_STREAM_PIPES) 00099 ACE_OSCALL_RETURN (::fdetach (file), int, -1); 00100 #else 00101 ACE_UNUSED_ARG (file); 00102 00103 ACE_NOTSUP_RETURN (-1); 00104 #endif /* ACE_HAS_STREAM_PIPES */ 00105 }
ACE_INLINE int ACE_OS::ioctl | ( | ACE_HANDLE | handle, | |
ACE_IOCTL_TYPE_ARG2 | cmd, | |||
void * | val | |||
) |
UNIX-style <ioctl>.
Definition at line 108 of file OS_NS_stropts.inl.
References ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and ioctl().
00111 { 00112 ACE_OS_TRACE ("ACE_OS::ioctl"); 00113 00114 #if defined (ACE_WIN32) 00115 ACE_SOCKET sock = (ACE_SOCKET) handle; 00116 ACE_SOCKCALL_RETURN (::ioctlsocket (sock, cmd, reinterpret_cast<unsigned long *> (val)), int, -1); 00117 #elif defined (ACE_HAS_IOCTL_INT_3_PARAM) 00118 ACE_OSCALL_RETURN (::ioctl (handle, cmd, reinterpret_cast<int> (val)), 00119 int, -1); 00120 #else 00121 ACE_OSCALL_RETURN (::ioctl (handle, cmd, val), int, -1); 00122 #endif /* ACE_WIN32 */ 00123 }
ACE_INLINE int ACE_OS::isastream | ( | ACE_HANDLE | handle | ) |
Definition at line 126 of file OS_NS_stropts.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and isastream().
00127 { 00128 ACE_OS_TRACE ("ACE_OS::isastream"); 00129 #if defined (ACE_HAS_STREAM_PIPES) 00130 ACE_OSCALL_RETURN (::isastream (handle), int, -1); 00131 #else 00132 ACE_UNUSED_ARG (handle); 00133 00134 ACE_NOTSUP_RETURN (-1); 00135 #endif /* ACE_HAS_STREAM_PIPES */ 00136 }
ACE_INLINE int ACE_OS::putmsg | ( | ACE_HANDLE | handle, | |
const struct strbuf * | ctl, | |||
const struct strbuf * | data, | |||
int | flags | |||
) |
Definition at line 139 of file OS_NS_stropts.inl.
References ACE_NEW_RETURN, ACE_OS_TRACE, strbuf::buf, memcpy(), putmsg(), and write().
Referenced by putmsg(), putpmsg(), ACE_FIFO_Send_Msg::send(), and ACE_SPIPE_Stream::send().
00141 { 00142 ACE_OS_TRACE ("ACE_OS::putmsg"); 00143 #if defined (ACE_HAS_STREAM_PIPES) 00144 ACE_OSCALL_RETURN (::putmsg (handle, 00145 (ACE_STRBUF_TYPE) ctl, 00146 (ACE_STRBUF_TYPE) data, 00147 flags), int, -1); 00148 #else 00149 ACE_UNUSED_ARG (flags); 00150 ssize_t result; 00151 if (ctl == 0 && data == 0) 00152 { 00153 errno = EINVAL; 00154 return 0; 00155 } 00156 // Handle the two easy cases. 00157 else if (ctl != 0) 00158 { 00159 result = ACE_OS::write (handle, ctl->buf, ctl->len); 00160 return static_cast<int> (result); 00161 } 00162 else if (data != 0) 00163 { 00164 result = ACE_OS::write (handle, data->buf, data->len); 00165 return static_cast<int> (result); 00166 } 00167 else 00168 { 00169 // This is the hard case. 00170 char *buf; 00171 ACE_NEW_RETURN (buf, char [ctl->len + data->len], -1); 00172 ACE_OS::memcpy (buf, ctl->buf, ctl->len); 00173 ACE_OS::memcpy (buf + ctl->len, data->buf, data->len); 00174 result = ACE_OS::write (handle, buf, ctl->len + data->len); 00175 delete [] buf; 00176 return static_cast<int> (result); 00177 } 00178 #endif /* ACE_HAS_STREAM_PIPES */ 00179 }
ACE_INLINE int ACE_OS::putpmsg | ( | ACE_HANDLE | handle, | |
const struct strbuf * | ctl, | |||
const struct strbuf * | data, | |||
int | band, | |||
int | flags | |||
) |
Definition at line 182 of file OS_NS_stropts.inl.
References ACE_OS_TRACE, putmsg(), and putpmsg().
Referenced by putpmsg(), and ACE_SPIPE_Stream::send().
00187 { 00188 ACE_OS_TRACE ("ACE_OS::putpmsg"); 00189 #if defined (ACE_HAS_STREAM_PIPES) 00190 ACE_OSCALL_RETURN (::putpmsg (handle, 00191 (ACE_STRBUF_TYPE) ctl, 00192 (ACE_STRBUF_TYPE) data, 00193 band, flags), int, -1); 00194 #else 00195 ACE_UNUSED_ARG (flags); 00196 ACE_UNUSED_ARG (band); 00197 return ACE_OS::putmsg (handle, ctl, data, flags); 00198 #endif /* ACE_HAS_STREAM_PIPES */ 00199 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::madvise | ( | caddr_t | addr, | |
size_t | len, | |||
int | map_advice | |||
) |
Definition at line 21 of file OS_NS_sys_mman.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and madvise().
Referenced by ACE_Mem_Map::advise(), and madvise().
00022 { 00023 ACE_OS_TRACE ("ACE_OS::madvise"); 00024 #if !defined (ACE_LACKS_MADVISE) 00025 ACE_OSCALL_RETURN (::madvise (addr, len, map_advice), int, -1); 00026 #else 00027 ACE_UNUSED_ARG (addr); 00028 ACE_UNUSED_ARG (len); 00029 ACE_UNUSED_ARG (map_advice); 00030 ACE_NOTSUP_RETURN (-1); 00031 #endif /* ACE_WIN32 */ 00032 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::mmap | ( | void * | addr, | |
size_t | len, | |||
int | prot, | |||
int | flags, | |||
ACE_HANDLE | handle, | |||
ACE_OFF_T | off = 0 , |
|||
ACE_HANDLE * | file_mapping = 0 , |
|||
LPSECURITY_ATTRIBUTES | sa = 0 , |
|||
const ACE_TCHAR * | file_mapping_name = 0 | |||
) |
Definition at line 35 of file OS_NS_sys_mman.inl.
References ACE_BIT_ENABLED, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fsync(), LPSECURITY_ATTRIBUTES, MAP_FAILED, and mmap().
Referenced by ACE_Mutex::ACE_Mutex(), event_init(), ACE_Mem_Map::map_it(), mmap(), sema_init(), and sendfile_emulation().
00044 { 00045 ACE_OS_TRACE ("ACE_OS::mmap"); 00046 #if !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) 00047 ACE_UNUSED_ARG (file_mapping_name); 00048 #endif /* !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) */ 00049 00050 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00051 00052 # if defined(ACE_HAS_WINCE) 00053 ACE_UNUSED_ARG (addr); 00054 if (ACE_BIT_ENABLED (flags, MAP_FIXED)) // not supported 00055 { 00056 errno = EINVAL; 00057 return MAP_FAILED; 00058 } 00059 # else 00060 if (!ACE_BIT_ENABLED (flags, MAP_FIXED)) 00061 addr = 0; 00062 else if (addr == 0) // can not map to address 0 00063 { 00064 errno = EINVAL; 00065 return MAP_FAILED; 00066 } 00067 # endif 00068 00069 int nt_flags = 0; 00070 ACE_HANDLE local_handle = ACE_INVALID_HANDLE; 00071 00072 // Ensure that file_mapping is non-zero. 00073 if (file_mapping == 0) 00074 file_mapping = &local_handle; 00075 00076 if (ACE_BIT_ENABLED (flags, MAP_PRIVATE)) 00077 { 00078 # if !defined(ACE_HAS_WINCE) 00079 prot = PAGE_WRITECOPY; 00080 # endif // ACE_HAS_WINCE 00081 nt_flags = FILE_MAP_COPY; 00082 } 00083 else if (ACE_BIT_ENABLED (flags, MAP_SHARED)) 00084 { 00085 if (ACE_BIT_ENABLED (prot, PAGE_READONLY)) 00086 nt_flags = FILE_MAP_READ; 00087 if (ACE_BIT_ENABLED (prot, PAGE_READWRITE)) 00088 nt_flags = FILE_MAP_WRITE; 00089 } 00090 00091 // Only create a new handle if we didn't have a valid one passed in. 00092 if (*file_mapping == ACE_INVALID_HANDLE) 00093 { 00094 SECURITY_ATTRIBUTES sa_buffer; 00095 SECURITY_DESCRIPTOR sd_buffer; 00096 const LPSECURITY_ATTRIBUTES attr = 00097 ACE_OS::default_win32_security_attributes_r (sa, 00098 &sa_buffer, 00099 &sd_buffer); 00100 00101 *file_mapping = ACE_TEXT_CreateFileMapping (file_handle, 00102 attr, 00103 prot, 00104 0, 00105 0, 00106 file_mapping_name); 00107 } 00108 00109 if (*file_mapping == 0) 00110 ACE_FAIL_RETURN (MAP_FAILED); 00111 00112 # if defined (ACE_OS_EXTRA_MMAP_FLAGS) 00113 nt_flags |= ACE_OS_EXTRA_MMAP_FLAGS; 00114 # endif /* ACE_OS_EXTRA_MMAP_FLAGS */ 00115 00116 DWORD low_off = ACE_LOW_PART (off); 00117 DWORD high_off = ACE_HIGH_PART (off); 00118 00119 # if !defined (ACE_HAS_WINCE) 00120 void *addr_mapping = ::MapViewOfFileEx (*file_mapping, 00121 nt_flags, 00122 high_off, 00123 low_off, 00124 len, 00125 addr); 00126 # else 00127 void *addr_mapping = ::MapViewOfFile (*file_mapping, 00128 nt_flags, 00129 high_off, 00130 low_off, 00131 len); 00132 # endif /* ! ACE_HAS_WINCE */ 00133 00134 // Only close this down if we used the temporary. 00135 if (file_mapping == &local_handle) 00136 ::CloseHandle (*file_mapping); 00137 00138 if (addr_mapping == 0) 00139 ACE_FAIL_RETURN (MAP_FAILED); 00140 else 00141 return addr_mapping; 00142 #elif !defined (ACE_LACKS_MMAP) 00143 ACE_UNUSED_ARG (sa); 00144 00145 # if defined (ACE_OS_EXTRA_MMAP_FLAGS) 00146 flags |= ACE_OS_EXTRA_MMAP_FLAGS; 00147 # endif /* ACE_OS_EXTRA_MMAP_FLAGS */ 00148 ACE_UNUSED_ARG (file_mapping); 00149 # if defined (ACE_OPENVMS) 00150 //FUZZ: disable check_for_lack_ACE_OS 00151 ::fsync(file_handle); 00152 //FUZZ: enable check_for_lack_ACE_OS 00153 # endif 00154 //FUZZ: disable check_for_lack_ACE_OS 00155 ACE_OSCALL_RETURN ((void *) ::mmap ((ACE_MMAP_TYPE) addr, 00156 len, 00157 prot, 00158 flags, 00159 file_handle, 00160 off), 00161 void *, MAP_FAILED); 00162 //FUZZ: enable check_for_lack_ACE_OS 00163 #else 00164 ACE_UNUSED_ARG (addr); 00165 ACE_UNUSED_ARG (len); 00166 ACE_UNUSED_ARG (prot); 00167 ACE_UNUSED_ARG (flags); 00168 ACE_UNUSED_ARG (file_handle); 00169 ACE_UNUSED_ARG (off); 00170 ACE_UNUSED_ARG (file_mapping); 00171 ACE_UNUSED_ARG (sa); 00172 ACE_NOTSUP_RETURN (MAP_FAILED); 00173 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00174 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::mprotect | ( | void * | addr, | |
size_t | len, | |||
int | prot | |||
) |
Definition at line 182 of file OS_NS_sys_mman.inl.
References ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and mprotect().
Referenced by mprotect(), ACE_MMAP_Memory_Pool::protect(), and ACE_Mem_Map::protect().
00183 { 00184 ACE_OS_TRACE ("ACE_OS::mprotect"); 00185 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00186 DWORD dummy; // Sigh! 00187 return ::VirtualProtect(addr, len, prot, &dummy) ? 0 : -1; 00188 #elif !defined (ACE_LACKS_MPROTECT) 00189 ACE_OSCALL_RETURN (::mprotect ((ACE_MMAP_TYPE) addr, len, prot), int, -1); 00190 #else 00191 ACE_UNUSED_ARG (addr); 00192 ACE_UNUSED_ARG (len); 00193 ACE_UNUSED_ARG (prot); 00194 ACE_NOTSUP_RETURN (-1); 00195 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00196 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::msync | ( | void * | addr, | |
size_t | len, | |||
int | sync | |||
) |
Definition at line 199 of file OS_NS_sys_mman.inl.
References ACE_ADAPT_RETVAL, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msync().
Referenced by msync(), ACE_MMAP_Memory_Pool::sync(), and ACE_Mem_Map::sync().
00200 { 00201 ACE_OS_TRACE ("ACE_OS::msync"); 00202 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00203 ACE_UNUSED_ARG (sync); 00204 00205 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::FlushViewOfFile (addr, len), ace_result_), int, -1); 00206 #elif !defined (ACE_LACKS_MSYNC) 00207 # if !defined (ACE_HAS_BROKEN_NETBSD_MSYNC) 00208 ACE_OSCALL_RETURN (::msync ((ACE_MMAP_TYPE) addr, len, sync), int, -1); 00209 # else 00210 ACE_OSCALL_RETURN (::msync ((ACE_MMAP_TYPE) addr, len), int, -1); 00211 ACE_UNUSED_ARG (sync); 00212 # endif /* ACE_HAS_BROKEN_NETBSD_MSYNC */ 00213 #else 00214 ACE_UNUSED_ARG (addr); 00215 ACE_UNUSED_ARG (len); 00216 ACE_UNUSED_ARG (sync); 00217 ACE_NOTSUP_RETURN (-1); 00218 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00219 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::munmap | ( | void * | addr, | |
size_t | len | |||
) |
Definition at line 222 of file OS_NS_sys_mman.inl.
References ACE_ADAPT_RETVAL, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and munmap().
Referenced by event_destroy(), munmap(), ACE_Mutex::remove(), sendfile_emulation(), and ACE_Mem_Map::unmap().
00223 { 00224 ACE_OS_TRACE ("ACE_OS::munmap"); 00225 #if defined (ACE_WIN32) 00226 ACE_UNUSED_ARG (len); 00227 00228 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::UnmapViewOfFile (addr), ace_result_), int, -1); 00229 #elif !defined (ACE_LACKS_MMAP) 00230 ACE_OSCALL_RETURN (::munmap ((ACE_MMAP_TYPE) addr, len), int, -1); 00231 #else 00232 ACE_UNUSED_ARG (addr); 00233 ACE_UNUSED_ARG (len); 00234 ACE_NOTSUP_RETURN (-1); 00235 #endif /* ACE_WIN32 */ 00236 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE ACE_OS::shm_open | ( | const ACE_TCHAR * | filename, | |
int | mode, | |||
mode_t | perms = 0 , |
|||
LPSECURITY_ATTRIBUTES | sa = 0 | |||
) |
Definition at line 239 of file OS_NS_sys_mman.inl.
References ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, MAXPATHLEN, open(), shm_open(), and sprintf().
Referenced by ACE_Mutex::ACE_Mutex(), event_init(), ACE_Mem_Map::open(), sema_init(), and shm_open().
00243 { 00244 ACE_OS_TRACE ("ACE_OS::shm_open"); 00245 #if defined (ACE_HAS_SHM_OPEN) 00246 ACE_UNUSED_ARG (sa); 00247 #if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) 00248 // With VxWorks the file should just start with / and no other 00249 // slashes, so replace all other / by _ 00250 ACE_TCHAR buf [MAXPATHLEN + 1]; 00251 ACE_OS::sprintf (buf, 00252 ACE_TEXT ("%s"), 00253 filename); 00254 for (size_t i = 1; i < MAXPATHLEN + 1; i++) 00255 { 00256 if (buf[i] == '/') 00257 { 00258 buf[i] = '_'; 00259 } 00260 } 00261 filename = buf; 00262 #endif 00263 ACE_OSCALL_RETURN (::shm_open (ACE_TEXT_ALWAYS_CHAR(filename), mode, perms), ACE_HANDLE, ACE_INVALID_HANDLE); 00264 #elif defined (ACE_OPENVMS) 00265 //FUZZ: disable check_for_lack_ACE_OS 00266 ACE_OSCALL_RETURN (::open (filename, mode, perms, ACE_TEXT("shr=get,put,upd")), ACE_HANDLE, ACE_INVALID_HANDLE); 00267 //FUZZ: enable check_for_lack_ACE_OS 00268 #else /* ! ACE_HAS_SHM_OPEN */ 00269 // Just use ::open. 00270 return ACE_OS::open (filename, mode, perms, sa); 00271 #endif /* ACE_HAS_SHM_OPEN */ 00272 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::shm_unlink | ( | const ACE_TCHAR * | path | ) |
Definition at line 275 of file OS_NS_sys_mman.inl.
References ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, MAXPATHLEN, shm_unlink(), sprintf(), and unlink().
Referenced by event_destroy(), event_init(), ACE_Mutex::remove(), ACE_Mem_Map::remove(), sema_destroy(), and shm_unlink().
00276 { 00277 ACE_OS_TRACE ("ACE_OS::shm_unlink"); 00278 #if defined (ACE_HAS_SHM_OPEN) 00279 #if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) 00280 // With VxWorks the file should just start with / and no other 00281 // slashes, so replace all other / by _ 00282 ACE_TCHAR buf [MAXPATHLEN + 1]; 00283 ACE_OS::sprintf (buf, 00284 ACE_TEXT ("%s"), 00285 path); 00286 for (size_t i = 1; i < MAXPATHLEN + 1; i++) 00287 { 00288 if (buf[i] == '/') 00289 { 00290 buf[i] = '_'; 00291 } 00292 } 00293 path = buf; 00294 #endif 00295 ACE_OSCALL_RETURN (::shm_unlink (ACE_TEXT_ALWAYS_CHAR(path)), int, -1); 00296 #else /* ! ACE_HAS_SHM_OPEN */ 00297 // Just use ::unlink. 00298 return ACE_OS::unlink (path); 00299 #endif /* ACE_HAS_SHM_OPEN */ 00300 }
ACE_INLINE int ACE_OS::madvise | ( | caddr_t | addr, | |
size_t | len, | |||
int | map_advice | |||
) |
Definition at line 21 of file OS_NS_sys_mman.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and madvise().
Referenced by ACE_Mem_Map::advise(), and madvise().
00022 { 00023 ACE_OS_TRACE ("ACE_OS::madvise"); 00024 #if !defined (ACE_LACKS_MADVISE) 00025 ACE_OSCALL_RETURN (::madvise (addr, len, map_advice), int, -1); 00026 #else 00027 ACE_UNUSED_ARG (addr); 00028 ACE_UNUSED_ARG (len); 00029 ACE_UNUSED_ARG (map_advice); 00030 ACE_NOTSUP_RETURN (-1); 00031 #endif /* ACE_WIN32 */ 00032 }
ACE_INLINE void* ACE_OS::mmap | ( | void * | addr, | |
size_t | len, | |||
int | prot, | |||
int | flags, | |||
ACE_HANDLE | file_handle, | |||
ACE_OFF_T | off, | |||
ACE_HANDLE * | file_mapping, | |||
LPSECURITY_ATTRIBUTES | sa, | |||
const ACE_TCHAR * | file_mapping_name | |||
) |
Definition at line 35 of file OS_NS_sys_mman.inl.
References ACE_BIT_ENABLED, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, fsync(), LPSECURITY_ATTRIBUTES, MAP_FAILED, and mmap().
Referenced by ACE_Mutex::ACE_Mutex(), event_init(), ACE_Mem_Map::map_it(), mmap(), sema_init(), and sendfile_emulation().
00044 { 00045 ACE_OS_TRACE ("ACE_OS::mmap"); 00046 #if !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) 00047 ACE_UNUSED_ARG (file_mapping_name); 00048 #endif /* !defined (ACE_WIN32) || defined (ACE_HAS_PHARLAP) */ 00049 00050 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00051 00052 # if defined(ACE_HAS_WINCE) 00053 ACE_UNUSED_ARG (addr); 00054 if (ACE_BIT_ENABLED (flags, MAP_FIXED)) // not supported 00055 { 00056 errno = EINVAL; 00057 return MAP_FAILED; 00058 } 00059 # else 00060 if (!ACE_BIT_ENABLED (flags, MAP_FIXED)) 00061 addr = 0; 00062 else if (addr == 0) // can not map to address 0 00063 { 00064 errno = EINVAL; 00065 return MAP_FAILED; 00066 } 00067 # endif 00068 00069 int nt_flags = 0; 00070 ACE_HANDLE local_handle = ACE_INVALID_HANDLE; 00071 00072 // Ensure that file_mapping is non-zero. 00073 if (file_mapping == 0) 00074 file_mapping = &local_handle; 00075 00076 if (ACE_BIT_ENABLED (flags, MAP_PRIVATE)) 00077 { 00078 # if !defined(ACE_HAS_WINCE) 00079 prot = PAGE_WRITECOPY; 00080 # endif // ACE_HAS_WINCE 00081 nt_flags = FILE_MAP_COPY; 00082 } 00083 else if (ACE_BIT_ENABLED (flags, MAP_SHARED)) 00084 { 00085 if (ACE_BIT_ENABLED (prot, PAGE_READONLY)) 00086 nt_flags = FILE_MAP_READ; 00087 if (ACE_BIT_ENABLED (prot, PAGE_READWRITE)) 00088 nt_flags = FILE_MAP_WRITE; 00089 } 00090 00091 // Only create a new handle if we didn't have a valid one passed in. 00092 if (*file_mapping == ACE_INVALID_HANDLE) 00093 { 00094 SECURITY_ATTRIBUTES sa_buffer; 00095 SECURITY_DESCRIPTOR sd_buffer; 00096 const LPSECURITY_ATTRIBUTES attr = 00097 ACE_OS::default_win32_security_attributes_r (sa, 00098 &sa_buffer, 00099 &sd_buffer); 00100 00101 *file_mapping = ACE_TEXT_CreateFileMapping (file_handle, 00102 attr, 00103 prot, 00104 0, 00105 0, 00106 file_mapping_name); 00107 } 00108 00109 if (*file_mapping == 0) 00110 ACE_FAIL_RETURN (MAP_FAILED); 00111 00112 # if defined (ACE_OS_EXTRA_MMAP_FLAGS) 00113 nt_flags |= ACE_OS_EXTRA_MMAP_FLAGS; 00114 # endif /* ACE_OS_EXTRA_MMAP_FLAGS */ 00115 00116 DWORD low_off = ACE_LOW_PART (off); 00117 DWORD high_off = ACE_HIGH_PART (off); 00118 00119 # if !defined (ACE_HAS_WINCE) 00120 void *addr_mapping = ::MapViewOfFileEx (*file_mapping, 00121 nt_flags, 00122 high_off, 00123 low_off, 00124 len, 00125 addr); 00126 # else 00127 void *addr_mapping = ::MapViewOfFile (*file_mapping, 00128 nt_flags, 00129 high_off, 00130 low_off, 00131 len); 00132 # endif /* ! ACE_HAS_WINCE */ 00133 00134 // Only close this down if we used the temporary. 00135 if (file_mapping == &local_handle) 00136 ::CloseHandle (*file_mapping); 00137 00138 if (addr_mapping == 0) 00139 ACE_FAIL_RETURN (MAP_FAILED); 00140 else 00141 return addr_mapping; 00142 #elif !defined (ACE_LACKS_MMAP) 00143 ACE_UNUSED_ARG (sa); 00144 00145 # if defined (ACE_OS_EXTRA_MMAP_FLAGS) 00146 flags |= ACE_OS_EXTRA_MMAP_FLAGS; 00147 # endif /* ACE_OS_EXTRA_MMAP_FLAGS */ 00148 ACE_UNUSED_ARG (file_mapping); 00149 # if defined (ACE_OPENVMS) 00150 //FUZZ: disable check_for_lack_ACE_OS 00151 ::fsync(file_handle); 00152 //FUZZ: enable check_for_lack_ACE_OS 00153 # endif 00154 //FUZZ: disable check_for_lack_ACE_OS 00155 ACE_OSCALL_RETURN ((void *) ::mmap ((ACE_MMAP_TYPE) addr, 00156 len, 00157 prot, 00158 flags, 00159 file_handle, 00160 off), 00161 void *, MAP_FAILED); 00162 //FUZZ: enable check_for_lack_ACE_OS 00163 #else 00164 ACE_UNUSED_ARG (addr); 00165 ACE_UNUSED_ARG (len); 00166 ACE_UNUSED_ARG (prot); 00167 ACE_UNUSED_ARG (flags); 00168 ACE_UNUSED_ARG (file_handle); 00169 ACE_UNUSED_ARG (off); 00170 ACE_UNUSED_ARG (file_mapping); 00171 ACE_UNUSED_ARG (sa); 00172 ACE_NOTSUP_RETURN (MAP_FAILED); 00173 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00174 }
ACE_INLINE int ACE_OS::mprotect | ( | void * | addr, | |
size_t | len, | |||
int | prot | |||
) |
Definition at line 182 of file OS_NS_sys_mman.inl.
References ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and mprotect().
Referenced by mprotect(), ACE_Mem_Map::protect(), and ACE_MMAP_Memory_Pool::protect().
00183 { 00184 ACE_OS_TRACE ("ACE_OS::mprotect"); 00185 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00186 DWORD dummy; // Sigh! 00187 return ::VirtualProtect(addr, len, prot, &dummy) ? 0 : -1; 00188 #elif !defined (ACE_LACKS_MPROTECT) 00189 ACE_OSCALL_RETURN (::mprotect ((ACE_MMAP_TYPE) addr, len, prot), int, -1); 00190 #else 00191 ACE_UNUSED_ARG (addr); 00192 ACE_UNUSED_ARG (len); 00193 ACE_UNUSED_ARG (prot); 00194 ACE_NOTSUP_RETURN (-1); 00195 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00196 }
ACE_INLINE int ACE_OS::msync | ( | void * | addr, | |
size_t | len, | |||
int | sync | |||
) |
Definition at line 199 of file OS_NS_sys_mman.inl.
References ACE_ADAPT_RETVAL, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msync().
Referenced by msync(), ACE_Mem_Map::sync(), and ACE_MMAP_Memory_Pool::sync().
00200 { 00201 ACE_OS_TRACE ("ACE_OS::msync"); 00202 #if defined (ACE_WIN32) && !defined (ACE_HAS_PHARLAP) 00203 ACE_UNUSED_ARG (sync); 00204 00205 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::FlushViewOfFile (addr, len), ace_result_), int, -1); 00206 #elif !defined (ACE_LACKS_MSYNC) 00207 # if !defined (ACE_HAS_BROKEN_NETBSD_MSYNC) 00208 ACE_OSCALL_RETURN (::msync ((ACE_MMAP_TYPE) addr, len, sync), int, -1); 00209 # else 00210 ACE_OSCALL_RETURN (::msync ((ACE_MMAP_TYPE) addr, len), int, -1); 00211 ACE_UNUSED_ARG (sync); 00212 # endif /* ACE_HAS_BROKEN_NETBSD_MSYNC */ 00213 #else 00214 ACE_UNUSED_ARG (addr); 00215 ACE_UNUSED_ARG (len); 00216 ACE_UNUSED_ARG (sync); 00217 ACE_NOTSUP_RETURN (-1); 00218 #endif /* ACE_WIN32 && !ACE_HAS_PHARLAP */ 00219 }
ACE_INLINE int ACE_OS::munmap | ( | void * | addr, | |
size_t | len | |||
) |
Definition at line 222 of file OS_NS_sys_mman.inl.
References ACE_ADAPT_RETVAL, ACE_MMAP_TYPE, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and munmap().
Referenced by event_destroy(), munmap(), ACE_Mutex::remove(), sendfile_emulation(), and ACE_Mem_Map::unmap().
00223 { 00224 ACE_OS_TRACE ("ACE_OS::munmap"); 00225 #if defined (ACE_WIN32) 00226 ACE_UNUSED_ARG (len); 00227 00228 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::UnmapViewOfFile (addr), ace_result_), int, -1); 00229 #elif !defined (ACE_LACKS_MMAP) 00230 ACE_OSCALL_RETURN (::munmap ((ACE_MMAP_TYPE) addr, len), int, -1); 00231 #else 00232 ACE_UNUSED_ARG (addr); 00233 ACE_UNUSED_ARG (len); 00234 ACE_NOTSUP_RETURN (-1); 00235 #endif /* ACE_WIN32 */ 00236 }
ACE_INLINE ACE_HANDLE ACE_OS::shm_open | ( | const ACE_TCHAR * | filename, | |
int | mode, | |||
mode_t | perms, | |||
LPSECURITY_ATTRIBUTES | sa | |||
) |
Definition at line 239 of file OS_NS_sys_mman.inl.
References ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, MAXPATHLEN, open(), shm_open(), and sprintf().
Referenced by ACE_Mutex::ACE_Mutex(), event_init(), ACE_Mem_Map::open(), sema_init(), and shm_open().
00243 { 00244 ACE_OS_TRACE ("ACE_OS::shm_open"); 00245 #if defined (ACE_HAS_SHM_OPEN) 00246 ACE_UNUSED_ARG (sa); 00247 #if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) 00248 // With VxWorks the file should just start with / and no other 00249 // slashes, so replace all other / by _ 00250 ACE_TCHAR buf [MAXPATHLEN + 1]; 00251 ACE_OS::sprintf (buf, 00252 ACE_TEXT ("%s"), 00253 filename); 00254 for (size_t i = 1; i < MAXPATHLEN + 1; i++) 00255 { 00256 if (buf[i] == '/') 00257 { 00258 buf[i] = '_'; 00259 } 00260 } 00261 filename = buf; 00262 #endif 00263 ACE_OSCALL_RETURN (::shm_open (ACE_TEXT_ALWAYS_CHAR(filename), mode, perms), ACE_HANDLE, ACE_INVALID_HANDLE); 00264 #elif defined (ACE_OPENVMS) 00265 //FUZZ: disable check_for_lack_ACE_OS 00266 ACE_OSCALL_RETURN (::open (filename, mode, perms, ACE_TEXT("shr=get,put,upd")), ACE_HANDLE, ACE_INVALID_HANDLE); 00267 //FUZZ: enable check_for_lack_ACE_OS 00268 #else /* ! ACE_HAS_SHM_OPEN */ 00269 // Just use ::open. 00270 return ACE_OS::open (filename, mode, perms, sa); 00271 #endif /* ACE_HAS_SHM_OPEN */ 00272 }
ACE_INLINE int ACE_OS::shm_unlink | ( | const ACE_TCHAR * | path | ) |
Definition at line 275 of file OS_NS_sys_mman.inl.
References ACE_OS_TRACE, ACE_TEXT, ACE_TEXT_ALWAYS_CHAR, MAXPATHLEN, shm_unlink(), sprintf(), and unlink().
Referenced by event_destroy(), event_init(), ACE_Mem_Map::remove(), ACE_Mutex::remove(), sema_destroy(), and shm_unlink().
00276 { 00277 ACE_OS_TRACE ("ACE_OS::shm_unlink"); 00278 #if defined (ACE_HAS_SHM_OPEN) 00279 #if defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x650) 00280 // With VxWorks the file should just start with / and no other 00281 // slashes, so replace all other / by _ 00282 ACE_TCHAR buf [MAXPATHLEN + 1]; 00283 ACE_OS::sprintf (buf, 00284 ACE_TEXT ("%s"), 00285 path); 00286 for (size_t i = 1; i < MAXPATHLEN + 1; i++) 00287 { 00288 if (buf[i] == '/') 00289 { 00290 buf[i] = '_'; 00291 } 00292 } 00293 path = buf; 00294 #endif 00295 ACE_OSCALL_RETURN (::shm_unlink (ACE_TEXT_ALWAYS_CHAR(path)), int, -1); 00296 #else /* ! ACE_HAS_SHM_OPEN */ 00297 // Just use ::unlink. 00298 return ACE_OS::unlink (path); 00299 #endif /* ACE_HAS_SHM_OPEN */ 00300 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::msgctl | ( | int | msqid, | |
int | cmd, | |||
struct msqid_ds * | ||||
) |
Definition at line 10 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgctl().
Referenced by ACE_SV_Message_Queue::control(), and msgctl().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::msgctl"); 00013 #if defined (ACE_HAS_SYSV_IPC) 00014 ACE_OSCALL_RETURN (::msgctl (msqid, cmd, val), int, -1); 00015 #else 00016 ACE_UNUSED_ARG (msqid); 00017 ACE_UNUSED_ARG (cmd); 00018 ACE_UNUSED_ARG (val); 00019 00020 ACE_NOTSUP_RETURN (-1); 00021 #endif /* ACE_HAS_SYSV_IPC */ 00022 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::msgget | ( | key_t | key, | |
int | msgflg | |||
) |
Definition at line 25 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgget().
Referenced by msgget(), and ACE_SV_Message_Queue::open().
00026 { 00027 ACE_OS_TRACE ("ACE_OS::msgget"); 00028 #if defined (ACE_HAS_SYSV_IPC) 00029 ACE_OSCALL_RETURN (::msgget (key, msgflg), int, -1); 00030 #else 00031 ACE_UNUSED_ARG (key); 00032 ACE_UNUSED_ARG (msgflg); 00033 00034 ACE_NOTSUP_RETURN (-1); 00035 #endif /* ACE_HAS_SYSV_IPC */ 00036 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::msgrcv | ( | int | int_id, | |
void * | buf, | |||
size_t | len, | |||
long | type, | |||
int | flags | |||
) |
Definition at line 39 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgrcv().
Referenced by msgrcv(), and ACE_SV_Message_Queue::recv().
00041 { 00042 ACE_OS_TRACE ("ACE_OS::msgrcv"); 00043 #if defined (ACE_HAS_SYSV_IPC) 00044 ACE_OSCALL_RETURN (::msgrcv (int_id, buf, len, type, flags), 00045 int, -1); 00046 #else 00047 ACE_UNUSED_ARG (int_id); 00048 ACE_UNUSED_ARG (buf); 00049 ACE_UNUSED_ARG (len); 00050 ACE_UNUSED_ARG (type); 00051 ACE_UNUSED_ARG (flags); 00052 00053 ACE_NOTSUP_RETURN (-1); 00054 #endif /* ACE_HAS_SYSV_IPC */ 00055 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::msgsnd | ( | int | int_id, | |
const void * | buf, | |||
size_t | len, | |||
int | flags | |||
) |
Definition at line 58 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgsnd().
Referenced by msgsnd(), and ACE_SV_Message_Queue::send().
00059 { 00060 ACE_OS_TRACE ("ACE_OS::msgsnd"); 00061 #if defined (ACE_HAS_SYSV_IPC) 00062 # if defined (ACE_HAS_NONCONST_MSGSND) 00063 ACE_OSCALL_RETURN (::msgsnd (int_id, 00064 const_cast<void *> (buf), len, flags), int, -1); 00065 # else 00066 ACE_OSCALL_RETURN (::msgsnd (int_id, buf, len, flags), int, -1); 00067 # endif /* ACE_HAS_NONCONST_MSGSND */ 00068 #else 00069 ACE_UNUSED_ARG (int_id); 00070 ACE_UNUSED_ARG (buf); 00071 ACE_UNUSED_ARG (len); 00072 ACE_UNUSED_ARG (flags); 00073 00074 ACE_NOTSUP_RETURN (-1); 00075 #endif /* ACE_HAS_SYSV_IPC */ 00076 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::msgctl | ( | int | msqid, | |
int | cmd, | |||
struct msqid_ds * | val | |||
) |
Definition at line 10 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgctl().
Referenced by ACE_SV_Message_Queue::control(), and msgctl().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::msgctl"); 00013 #if defined (ACE_HAS_SYSV_IPC) 00014 ACE_OSCALL_RETURN (::msgctl (msqid, cmd, val), int, -1); 00015 #else 00016 ACE_UNUSED_ARG (msqid); 00017 ACE_UNUSED_ARG (cmd); 00018 ACE_UNUSED_ARG (val); 00019 00020 ACE_NOTSUP_RETURN (-1); 00021 #endif /* ACE_HAS_SYSV_IPC */ 00022 }
ACE_INLINE int ACE_OS::msgget | ( | key_t | key, | |
int | msgflg | |||
) |
Definition at line 25 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgget().
Referenced by msgget(), and ACE_SV_Message_Queue::open().
00026 { 00027 ACE_OS_TRACE ("ACE_OS::msgget"); 00028 #if defined (ACE_HAS_SYSV_IPC) 00029 ACE_OSCALL_RETURN (::msgget (key, msgflg), int, -1); 00030 #else 00031 ACE_UNUSED_ARG (key); 00032 ACE_UNUSED_ARG (msgflg); 00033 00034 ACE_NOTSUP_RETURN (-1); 00035 #endif /* ACE_HAS_SYSV_IPC */ 00036 }
ACE_INLINE ssize_t ACE_OS::msgrcv | ( | int | int_id, | |
void * | buf, | |||
size_t | len, | |||
long | type, | |||
int | flags | |||
) |
Definition at line 39 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgrcv().
Referenced by msgrcv(), and ACE_SV_Message_Queue::recv().
00041 { 00042 ACE_OS_TRACE ("ACE_OS::msgrcv"); 00043 #if defined (ACE_HAS_SYSV_IPC) 00044 ACE_OSCALL_RETURN (::msgrcv (int_id, buf, len, type, flags), 00045 int, -1); 00046 #else 00047 ACE_UNUSED_ARG (int_id); 00048 ACE_UNUSED_ARG (buf); 00049 ACE_UNUSED_ARG (len); 00050 ACE_UNUSED_ARG (type); 00051 ACE_UNUSED_ARG (flags); 00052 00053 ACE_NOTSUP_RETURN (-1); 00054 #endif /* ACE_HAS_SYSV_IPC */ 00055 }
ACE_INLINE int ACE_OS::msgsnd | ( | int | int_id, | |
const void * | buf, | |||
size_t | len, | |||
int | flags | |||
) |
Definition at line 58 of file OS_NS_sys_msg.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and msgsnd().
Referenced by msgsnd(), and ACE_SV_Message_Queue::send().
00059 { 00060 ACE_OS_TRACE ("ACE_OS::msgsnd"); 00061 #if defined (ACE_HAS_SYSV_IPC) 00062 # if defined (ACE_HAS_NONCONST_MSGSND) 00063 ACE_OSCALL_RETURN (::msgsnd (int_id, 00064 const_cast<void *> (buf), len, flags), int, -1); 00065 # else 00066 ACE_OSCALL_RETURN (::msgsnd (int_id, buf, len, flags), int, -1); 00067 # endif /* ACE_HAS_NONCONST_MSGSND */ 00068 #else 00069 ACE_UNUSED_ARG (int_id); 00070 ACE_UNUSED_ARG (buf); 00071 ACE_UNUSED_ARG (len); 00072 ACE_UNUSED_ARG (flags); 00073 00074 ACE_NOTSUP_RETURN (-1); 00075 #endif /* ACE_HAS_SYSV_IPC */ 00076 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getrlimit | ( | int | resource, | |
struct rlimit * | rl | |||
) |
Definition at line 11 of file OS_NS_sys_resource.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getrlimit().
Referenced by getrlimit(), ACE::max_handles(), and ACE::set_handle_limit().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::getrlimit"); 00014 00015 #if defined (ACE_LACKS_RLIMIT) 00016 ACE_UNUSED_ARG (resource); 00017 ACE_UNUSED_ARG (rl); 00018 00019 ACE_NOTSUP_RETURN (-1); 00020 #else 00021 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) 00022 ACE_OSCALL_RETURN (::getrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl), int, -1); 00023 # else 00024 ACE_OSCALL_RETURN (::getrlimit (resource, rl), int, -1); 00025 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00026 #endif /* ACE_LACKS_RLIMIT */ 00027 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getrusage | ( | int | who, | |
struct rusage * | rusage | |||
) |
Definition at line 30 of file OS_NS_sys_resource.inl.
Referenced by getrusage().
00031 { 00032 ACE_OS_TRACE ("ACE_OS::getrusage"); 00033 00034 #if defined (ACE_HAS_GETRUSAGE) 00035 # if defined (ACE_WIN32) 00036 ACE_UNUSED_ARG (who); 00037 00038 # if defined (ACE_LACKS_GETPROCESSTIMES) 00039 ACE_UNUSED_ARG (ru); 00040 ACE_NOTSUP_RETURN (-1); 00041 # else 00042 FILETIME dummy_1; 00043 FILETIME dummy_2; 00044 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::GetProcessTimes (::GetCurrentProcess(), 00045 &dummy_1, // start 00046 &dummy_2, // exited 00047 &ru->ru_stime, 00048 &ru->ru_utime), 00049 ace_result_), 00050 int, -1); 00051 # endif /* ACE_LACKS_WIN32_GETPROCESSTIMES */ 00052 # else 00053 # if defined (ACE_HAS_RUSAGE_WHO_ENUM) 00054 ACE_OSCALL_RETURN (::getrusage ((ACE_HAS_RUSAGE_WHO_ENUM) who, ru), int, -1); 00055 # else 00056 ACE_OSCALL_RETURN (::getrusage (who, ru), int, -1); 00057 # endif /* ACE_HAS_RUSAGE_WHO_ENUM */ 00058 # endif /* ACE_WIN32 */ 00059 #else 00060 ACE_UNUSED_ARG (who); 00061 ACE_UNUSED_ARG (ru); 00062 ACE_NOTSUP_RETURN (-1); 00063 #endif /* ACE_HAS_GETRUSAGE */ 00064 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::setrlimit | ( | int | resource, | |
const struct rlimit * | rl | |||
) |
Definition at line 67 of file OS_NS_sys_resource.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and setrlimit().
Referenced by ACE::set_handle_limit(), and setrlimit().
00068 { 00069 ACE_OS_TRACE ("ACE_OS::setrlimit"); 00070 00071 #if defined (ACE_LACKS_RLIMIT) 00072 ACE_UNUSED_ARG (resource); 00073 ACE_UNUSED_ARG (rl); 00074 00075 ACE_NOTSUP_RETURN (-1); 00076 #else 00077 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) 00078 # if defined (ACE_HAS_NONCONST_SETRLIMIT) 00079 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, 00080 const_cast<struct rlimit *>(rl) 00081 ), int, -1); 00082 # else 00083 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, 00084 rl 00085 ), int, -1); 00086 # endif /* ACE_HAS_NONCONST_SETRLIMIT */ 00087 # else /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00088 # if defined (ACE_HAS_NONCONST_SETRLIMIT) 00089 ACE_OSCALL_RETURN (::setrlimit (resource, const_cast<struct rlimit *>(rl) 00090 ), int, -1); 00091 # else 00092 ACE_OSCALL_RETURN (::setrlimit (resource, rl), int, -1); 00093 # endif /* ACE_HAS_NONCONST_SETRLIMIT */ 00094 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00095 #endif /* ACE_LACKS_RLIMIT */ 00096 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::getrlimit | ( | int | resource, | |
struct rlimit * | rl | |||
) |
Definition at line 11 of file OS_NS_sys_resource.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getrlimit().
Referenced by getrlimit(), ACE::max_handles(), and ACE::set_handle_limit().
00012 { 00013 ACE_OS_TRACE ("ACE_OS::getrlimit"); 00014 00015 #if defined (ACE_LACKS_RLIMIT) 00016 ACE_UNUSED_ARG (resource); 00017 ACE_UNUSED_ARG (rl); 00018 00019 ACE_NOTSUP_RETURN (-1); 00020 #else 00021 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) 00022 ACE_OSCALL_RETURN (::getrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, rl), int, -1); 00023 # else 00024 ACE_OSCALL_RETURN (::getrlimit (resource, rl), int, -1); 00025 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00026 #endif /* ACE_LACKS_RLIMIT */ 00027 }
ACE_INLINE int ACE_OS::getrusage | ( | int | who, | |
struct rusage * | ru | |||
) |
Definition at line 30 of file OS_NS_sys_resource.inl.
References ACE_ADAPT_RETVAL, ACE_NOTSUP_RETURN, ACE_OS_TRACE, and getrusage().
00031 { 00032 ACE_OS_TRACE ("ACE_OS::getrusage"); 00033 00034 #if defined (ACE_HAS_GETRUSAGE) 00035 # if defined (ACE_WIN32) 00036 ACE_UNUSED_ARG (who); 00037 00038 # if defined (ACE_LACKS_GETPROCESSTIMES) 00039 ACE_UNUSED_ARG (ru); 00040 ACE_NOTSUP_RETURN (-1); 00041 # else 00042 FILETIME dummy_1; 00043 FILETIME dummy_2; 00044 ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::GetProcessTimes (::GetCurrentProcess(), 00045 &dummy_1, // start 00046 &dummy_2, // exited 00047 &ru->ru_stime, 00048 &ru->ru_utime), 00049 ace_result_), 00050 int, -1); 00051 # endif /* ACE_LACKS_WIN32_GETPROCESSTIMES */ 00052 # else 00053 # if defined (ACE_HAS_RUSAGE_WHO_ENUM) 00054 ACE_OSCALL_RETURN (::getrusage ((ACE_HAS_RUSAGE_WHO_ENUM) who, ru), int, -1); 00055 # else 00056 ACE_OSCALL_RETURN (::getrusage (who, ru), int, -1); 00057 # endif /* ACE_HAS_RUSAGE_WHO_ENUM */ 00058 # endif /* ACE_WIN32 */ 00059 #else 00060 ACE_UNUSED_ARG (who); 00061 ACE_UNUSED_ARG (ru); 00062 ACE_NOTSUP_RETURN (-1); 00063 #endif /* ACE_HAS_GETRUSAGE */ 00064 }
ACE_INLINE int ACE_OS::setrlimit | ( | int | resource, | |
const struct rlimit * | rl | |||
) |
Definition at line 67 of file OS_NS_sys_resource.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and setrlimit().
Referenced by ACE::set_handle_limit(), and setrlimit().
00068 { 00069 ACE_OS_TRACE ("ACE_OS::setrlimit"); 00070 00071 #if defined (ACE_LACKS_RLIMIT) 00072 ACE_UNUSED_ARG (resource); 00073 ACE_UNUSED_ARG (rl); 00074 00075 ACE_NOTSUP_RETURN (-1); 00076 #else 00077 # if defined (ACE_HAS_RLIMIT_RESOURCE_ENUM) 00078 # if defined (ACE_HAS_NONCONST_SETRLIMIT) 00079 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, 00080 const_cast<struct rlimit *>(rl) 00081 ), int, -1); 00082 # else 00083 ACE_OSCALL_RETURN (::setrlimit ((ACE_HAS_RLIMIT_RESOURCE_ENUM) resource, 00084 rl 00085 ), int, -1); 00086 # endif /* ACE_HAS_NONCONST_SETRLIMIT */ 00087 # else /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00088 # if defined (ACE_HAS_NONCONST_SETRLIMIT) 00089 ACE_OSCALL_RETURN (::setrlimit (resource, const_cast<struct rlimit *>(rl) 00090 ), int, -1); 00091 # else 00092 ACE_OSCALL_RETURN (::setrlimit (resource, rl), int, -1); 00093 # endif /* ACE_HAS_NONCONST_SETRLIMIT */ 00094 # endif /* ACE_HAS_RLIMIT_RESOURCE_ENUM */ 00095 #endif /* ACE_LACKS_RLIMIT */ 00096 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::select | ( | int | width, | |
fd_set * | rfds, | |||
fd_set * | wfds = 0 , |
|||
fd_set * | efds = 0 , |
|||
const ACE_Time_Value * | tv = 0 | |||
) |
Definition at line 14 of file OS_NS_sys_select.inl.
Referenced by ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >::check_handles(), ACE_Acceptor< SVC_HANDLER, ACE_PEER_ACCEPTOR_2 >::handle_input(), ACE::handle_ready(), ACE::handle_timed_accept(), ACE::handle_timed_complete(), ACE_SOCK_Dgram::recv(), ACE_SOCK_Dgram_SC< STREAM >::recv(), ACE_SOCK_IO::recvv(), select(), ACE::select(), sema_wait(), ACE_SOCK_Dgram::send(), sleep(), ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >::wait_for_multiple_events(), and ACE_Select_Reactor_T< ACE_SELECT_REACTOR_TOKEN >::work_pending().
00017 { 00018 ACE_OS_TRACE ("ACE_OS::select"); 00019 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL) 00020 // We must defend against non-conformity! 00021 timeval copy; 00022 timeval *timep = 0; 00023 00024 if (timeout != 0) 00025 { 00026 copy = *timeout; 00027 timep = © 00028 } 00029 else 00030 timep = 0; 00031 #else 00032 const timeval *timep = (timeout == 0 ? (const timeval *)0 : *timeout); 00033 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */ 00034 #if defined (ACE_LACKS_SELECT) 00035 ACE_UNUSED_ARG (width); 00036 ACE_UNUSED_ARG (rfds); 00037 ACE_UNUSED_ARG (wfds); 00038 ACE_UNUSED_ARG (efds); 00039 ACE_UNUSED_ARG (timeout); 00040 ACE_NOTSUP_RETURN (-1); 00041 #elif defined(ACE_TANDEM_T1248_PTHREADS) 00042 ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, timep), 00043 int, -1); 00044 #else 00045 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timep), 00046 int, -1); 00047 #endif 00048 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::select | ( | int | width, | |
fd_set * | rfds, | |||
fd_set * | wfds, | |||
fd_set * | efds, | |||
const ACE_Time_Value & | tv | |||
) |
Definition at line 51 of file OS_NS_sys_select.inl.
References ___ACE_TIMEOUT, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and select().
00054 { 00055 ACE_OS_TRACE ("ACE_OS::select"); 00056 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL) 00057 # define ___ACE_TIMEOUT © 00058 timeval copy = timeout; 00059 #else 00060 # define ___ACE_TIMEOUT timep 00061 const timeval *timep = timeout; 00062 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */ 00063 #if defined (ACE_LACKS_SELECT) 00064 ACE_UNUSED_ARG (width); 00065 ACE_UNUSED_ARG (rfds); 00066 ACE_UNUSED_ARG (wfds); 00067 ACE_UNUSED_ARG (efds); 00068 ACE_UNUSED_ARG (timeout); 00069 ACE_NOTSUP_RETURN (-1); 00070 #elif defined(ACE_TANDEM_T1248_PTHREADS) 00071 ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, ___ACE_TIMEOUT), 00072 int, -1); 00073 #else 00074 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, ___ACE_TIMEOUT), 00075 int, -1); 00076 #endif 00077 #undef ___ACE_TIMEOUT 00078 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_OS::select | ( | int | width, | |
fd_set * | rfds, | |||
fd_set * | wfds, | |||
fd_set * | efds, | |||
const ACE_Time_Value * | timeout | |||
) |
Definition at line 14 of file OS_NS_sys_select.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and select().
00017 { 00018 ACE_OS_TRACE ("ACE_OS::select"); 00019 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL) 00020 // We must defend against non-conformity! 00021 timeval copy; 00022 timeval *timep = 0; 00023 00024 if (timeout != 0) 00025 { 00026 copy = *timeout; 00027 timep = © 00028 } 00029 else 00030 timep = 0; 00031 #else 00032 const timeval *timep = (timeout == 0 ? (const timeval *)0 : *timeout); 00033 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */ 00034 #if defined (ACE_LACKS_SELECT) 00035 ACE_UNUSED_ARG (width); 00036 ACE_UNUSED_ARG (rfds); 00037 ACE_UNUSED_ARG (wfds); 00038 ACE_UNUSED_ARG (efds); 00039 ACE_UNUSED_ARG (timeout); 00040 ACE_NOTSUP_RETURN (-1); 00041 #elif defined(ACE_TANDEM_T1248_PTHREADS) 00042 ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, timep), 00043 int, -1); 00044 #else 00045 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, timep), 00046 int, -1); 00047 #endif 00048 }
ACE_INLINE int ACE_OS::select | ( | int | width, | |
fd_set * | rfds, | |||
fd_set * | wfds, | |||
fd_set * | efds, | |||
const ACE_Time_Value & | timeout | |||
) |
Definition at line 51 of file OS_NS_sys_select.inl.
References ___ACE_TIMEOUT, ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and select().
00054 { 00055 ACE_OS_TRACE ("ACE_OS::select"); 00056 #if defined (ACE_HAS_NONCONST_SELECT_TIMEVAL) 00057 # define ___ACE_TIMEOUT © 00058 timeval copy = timeout; 00059 #else 00060 # define ___ACE_TIMEOUT timep 00061 const timeval *timep = timeout; 00062 #endif /* ACE_HAS_NONCONST_SELECT_TIMEVAL */ 00063 #if defined (ACE_LACKS_SELECT) 00064 ACE_UNUSED_ARG (width); 00065 ACE_UNUSED_ARG (rfds); 00066 ACE_UNUSED_ARG (wfds); 00067 ACE_UNUSED_ARG (efds); 00068 ACE_UNUSED_ARG (timeout); 00069 ACE_NOTSUP_RETURN (-1); 00070 #elif defined(ACE_TANDEM_T1248_PTHREADS) 00071 ACE_SOCKCALL_RETURN (::spt_select (width, rfds, wfds, efds, ___ACE_TIMEOUT), 00072 int, -1); 00073 #else 00074 ACE_SOCKCALL_RETURN (::select (width, rfds, wfds, efds, ___ACE_TIMEOUT), 00075 int, -1); 00076 #endif 00077 #undef ___ACE_TIMEOUT 00078 }
ACE_Export ssize_t ACE_OS::sendfile_emulation | ( | ACE_HANDLE | out_fd, | |
ACE_HANDLE | in_fd, | |||
off_t * | offset, | |||
size_t | count | |||
) |
Definition at line 20 of file OS_NS_sys_sendfile.cpp.
References MAP_FAILED, mmap(), munmap(), send(), and write().
Referenced by sendfile().
00024 { 00025 // @@ Is it possible to inline a call to ::TransmitFile() on 00026 // MS Windows instead of emulating here? 00027 00028 // @@ We may want set up a signal lease (or oplock) if supported by 00029 // the platform so that we don't get a bus error if the mmap()ed 00030 // file is truncated. 00031 void * const buf = 00032 ACE_OS::mmap (0, count, PROT_READ, MAP_SHARED, in_fd, *offset); 00033 00034 if (buf == MAP_FAILED) 00035 return -1; 00036 00037 #if defined (ACE_WIN32) || defined (HPUX) 00038 ssize_t const r = 00039 ACE_OS::send (out_fd, static_cast<const char *> (buf), count); 00040 #else 00041 ssize_t const r = ACE_OS::write (out_fd, buf, count); 00042 #endif /* ACE_WIN32 */ 00043 00044 (void) ACE_OS::munmap (buf, count); 00045 00046 if (r > 0) 00047 *offset += static_cast<off_t> (r); 00048 00049 return r; 00050 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::sendfile | ( | ACE_HANDLE | out_fd, | |
ACE_HANDLE | in_fd, | |||
off_t * | offset, | |||
size_t | count | |||
) |
Finds the length of a string (char version).
Definition at line 12 of file OS_NS_sys_sendfile.inl.
References sendfile(), and sendfile_emulation().
Referenced by sendfile().
00016 { 00017 #ifdef ACE_HAS_SENDFILE 00018 return ::sendfile (out_fd, in_fd, offset, count); 00019 #else 00020 return ACE_OS::sendfile_emulation (out_fd, in_fd, offset, count); 00021 #endif /* ACE_HAS_SENDFILE */ 00022 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE ssize_t ACE_OS::sendfile | ( | ACE_HANDLE | out_fd, | |
ACE_HANDLE | in_fd, | |||
off_t * | offset, | |||
size_t | count | |||
) |
Finds the length of a string (char version).
Definition at line 12 of file OS_NS_sys_sendfile.inl.
References sendfile(), and sendfile_emulation().
Referenced by sendfile().
00016 { 00017 #ifdef ACE_HAS_SENDFILE 00018 return ::sendfile (out_fd, in_fd, offset, count); 00019 #else 00020 return ACE_OS::sendfile_emulation (out_fd, in_fd, offset, count); 00021 #endif /* ACE_HAS_SENDFILE */ 00022 }
ACE_NAMESPACE_INLINE_FUNCTION void* ACE_OS::shmat | ( | int | int_id, | |
const void * | shmaddr, | |||
int | shmflg | |||
) |
Definition at line 10 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmat().
Referenced by ACE_SV_Shared_Memory::attach(), ACE_Shared_Memory_Pool::commit_backing_store_name(), ACE_Shared_Memory_Pool::handle_signal(), ACE_Shared_Memory_Pool::init_acquire(), and shmat().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::shmat"); 00013 #if defined (ACE_HAS_SYSV_IPC) 00014 # if defined (ACE_HAS_CHARPTR_SHMAT) 00015 ACE_OSCALL_RETURN (::shmat (int_id, static_cast <char*> (const_cast <void *>(shmaddr)), shmflg), void *, (void *) -1); 00016 # else 00017 ACE_OSCALL_RETURN (::shmat (int_id, shmaddr, shmflg), void *, (void *) -1); 00018 # endif /* ACE_HAS_CHARPTR_SHMAT */ 00019 #else 00020 ACE_UNUSED_ARG (int_id); 00021 ACE_UNUSED_ARG (shmaddr); 00022 ACE_UNUSED_ARG (shmflg); 00023 00024 ACE_NOTSUP_RETURN ((void *) -1); 00025 #endif /* ACE_HAS_SYSV_IPC */ 00026 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::shmctl | ( | int | int_id, | |
int | cmd, | |||
struct shmid_ds * | buf | |||
) |
Definition at line 29 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmctl().
Referenced by ACE_SV_Shared_Memory::control(), ACE_Shared_Memory_Pool::find_seg(), ACE_Shared_Memory_Pool::in_use(), ACE_Shared_Memory_Pool::release(), ACE_SV_Shared_Memory::remove(), and shmctl().
00030 { 00031 ACE_OS_TRACE ("ACE_OS::shmctl"); 00032 #if defined (ACE_HAS_SYSV_IPC) 00033 ACE_OSCALL_RETURN (::shmctl (int_id, cmd, buf), int, -1); 00034 #else 00035 ACE_UNUSED_ARG (buf); 00036 ACE_UNUSED_ARG (cmd); 00037 ACE_UNUSED_ARG (int_id); 00038 00039 ACE_NOTSUP_RETURN (-1); 00040 #endif /* ACE_HAS_SYSV_IPC */ 00041 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::shmdt | ( | const void * | shmaddr | ) |
Definition at line 44 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmdt().
Referenced by ACE_SV_Shared_Memory::detach(), and shmdt().
00045 { 00046 ACE_OS_TRACE ("ACE_OS::shmdt"); 00047 #if defined (ACE_HAS_SYSV_IPC) 00048 # if defined (ACE_HAS_CHARPTR_SHMDT) 00049 ACE_OSCALL_RETURN (::shmdt ( 00050 static_cast <char*> (const_cast <void *>(shmaddr))), int, -1); 00051 # else 00052 ACE_OSCALL_RETURN (::shmdt (shmaddr), int, -1); 00053 # endif /* ACE_HAS_CHARPTR_SHMDT */ 00054 #else 00055 ACE_UNUSED_ARG (shmaddr); 00056 00057 ACE_NOTSUP_RETURN (-1); 00058 #endif /* ACE_HAS_SYSV_IPC */ 00059 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::shmget | ( | key_t | key, | |
size_t | size, | |||
int | flags | |||
) |
Definition at line 62 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmget().
Referenced by ACE_Shared_Memory_Pool::commit_backing_store_name(), ACE_Shared_Memory_Pool::init_acquire(), ACE_SV_Shared_Memory::open(), and shmget().
00063 { 00064 ACE_OS_TRACE ("ACE_OS::shmget"); 00065 #if defined (ACE_HAS_SYSV_IPC) 00066 ACE_OSCALL_RETURN (::shmget (key, size, flags), int, -1); 00067 #else 00068 ACE_UNUSED_ARG (flags); 00069 ACE_UNUSED_ARG (size); 00070 ACE_UNUSED_ARG (key); 00071 00072 ACE_NOTSUP_RETURN (-1); 00073 #endif /* ACE_HAS_SYSV_IPC */ 00074 }
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE void* ACE_OS::shmat | ( | int | int_id, | |
const void * | shmaddr, | |||
int | shmflg | |||
) |
Definition at line 10 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmat().
Referenced by ACE_SV_Shared_Memory::attach(), ACE_Shared_Memory_Pool::commit_backing_store_name(), ACE_Shared_Memory_Pool::handle_signal(), ACE_Shared_Memory_Pool::init_acquire(), and shmat().
00011 { 00012 ACE_OS_TRACE ("ACE_OS::shmat"); 00013 #if defined (ACE_HAS_SYSV_IPC) 00014 # if defined (ACE_HAS_CHARPTR_SHMAT) 00015 ACE_OSCALL_RETURN (::shmat (int_id, static_cast <char*> (const_cast <void *>(shmaddr)), shmflg), void *, (void *) -1); 00016 # else 00017 ACE_OSCALL_RETURN (::shmat (int_id, shmaddr, shmflg), void *, (void *) -1); 00018 # endif /* ACE_HAS_CHARPTR_SHMAT */ 00019 #else 00020 ACE_UNUSED_ARG (int_id); 00021 ACE_UNUSED_ARG (shmaddr); 00022 ACE_UNUSED_ARG (shmflg); 00023 00024 ACE_NOTSUP_RETURN ((void *) -1); 00025 #endif /* ACE_HAS_SYSV_IPC */ 00026 }
ACE_INLINE int ACE_OS::shmctl | ( | int | int_id, | |
int | cmd, | |||
struct shmid_ds * | buf | |||
) |
Definition at line 29 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmctl().
Referenced by ACE_SV_Shared_Memory::control(), ACE_Shared_Memory_Pool::find_seg(), ACE_Shared_Memory_Pool::in_use(), ACE_Shared_Memory_Pool::release(), ACE_SV_Shared_Memory::remove(), and shmctl().
00030 { 00031 ACE_OS_TRACE ("ACE_OS::shmctl"); 00032 #if defined (ACE_HAS_SYSV_IPC) 00033 ACE_OSCALL_RETURN (::shmctl (int_id, cmd, buf), int, -1); 00034 #else 00035 ACE_UNUSED_ARG (buf); 00036 ACE_UNUSED_ARG (cmd); 00037 ACE_UNUSED_ARG (int_id); 00038 00039 ACE_NOTSUP_RETURN (-1); 00040 #endif /* ACE_HAS_SYSV_IPC */ 00041 }
ACE_INLINE int ACE_OS::shmdt | ( | const void * | shmaddr | ) |
Definition at line 44 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmdt().
Referenced by ACE_SV_Shared_Memory::detach(), and shmdt().
00045 { 00046 ACE_OS_TRACE ("ACE_OS::shmdt"); 00047 #if defined (ACE_HAS_SYSV_IPC) 00048 # if defined (ACE_HAS_CHARPTR_SHMDT) 00049 ACE_OSCALL_RETURN (::shmdt ( 00050 static_cast <char*> (const_cast <void *>(shmaddr))), int, -1); 00051 # else 00052 ACE_OSCALL_RETURN (::shmdt (shmaddr), int, -1); 00053 # endif /* ACE_HAS_CHARPTR_SHMDT */ 00054 #else 00055 ACE_UNUSED_ARG (shmaddr); 00056 00057 ACE_NOTSUP_RETURN (-1); 00058 #endif /* ACE_HAS_SYSV_IPC */ 00059 }
ACE_INLINE int ACE_OS::shmget | ( | key_t | key, | |
size_t | size, | |||
int | flags | |||
) |
Definition at line 62 of file OS_NS_sys_shm.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and shmget().
Referenced by ACE_Shared_Memory_Pool::commit_backing_store_name(), ACE_Shared_Memory_Pool::init_acquire(), ACE_SV_Shared_Memory::open(), and shmget().
00063 { 00064 ACE_OS_TRACE ("ACE_OS::shmget"); 00065 #if defined (ACE_HAS_SYSV_IPC) 00066 ACE_OSCALL_RETURN (::shmget (key, size, flags), int, -1); 00067 #else 00068 ACE_UNUSED_ARG (flags); 00069 ACE_UNUSED_ARG (size); 00070 ACE_UNUSED_ARG (key); 00071 00072 ACE_NOTSUP_RETURN (-1); 00073 #endif /* ACE_HAS_SYSV_IPC */ 00074 }
ACE_Export ACE_HANDLE ACE_OS::accept | ( | ACE_HANDLE | handle, | |
struct sockaddr * | addr, | |||
int * | addrlen, | |||
const ACE_Accept_QoS_Params & | qos_params | |||
) |
QoS-enabled <accept>, which passes qos_params to <accept>. If the OS platform doesn't support QoS-enabled <accept> then the qos_params are ignored and the BSD-style <accept> is called.
Definition at line 19 of file OS_NS_sys_socket.cpp.
References ACE_SOCKCALL_RETURN, ACE_Accept_QoS_Params::callback_data(), and ACE_Accept_QoS_Params::qos_condition_callback().
Referenced by ACE_SOCK_SEQPACK_Acceptor::accept(), ACE_SOCK_Acceptor::accept(), accept(), ACE_MEM_Acceptor::accept(), and ACE_LSOCK_Acceptor::accept().
00023 { 00024 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00025 ACE_SOCKCALL_RETURN (::WSAAccept ((ACE_SOCKET) handle, 00026 addr, 00027 (ACE_SOCKET_LEN *) addrlen, 00028 (LPCONDITIONPROC) qos_params.qos_condition_callback (), 00029 qos_params.callback_data ()), 00030 ACE_HANDLE, 00031 ACE_INVALID_HANDLE); 00032 # else 00033 ACE_UNUSED_ARG (qos_params); 00034 return ACE_OS::accept (handle, 00035 addr, 00036 addrlen); 00037 # endif /* ACE_HAS_WINSOCK2 */ 00038 }
ACE_Export int ACE_OS::connect | ( | ACE_HANDLE | handle, | |
const sockaddr * | addr, | |||
int | addrlen, | |||
const ACE_QoS_Params & | qos_params | |||
) |
QoS-enabled <connect>, which passes qos_params to <connect>. If the OS platform doesn't support QoS-enabled <connect> then the qos_params are ignored and the BSD-style <connect> is called.
Definition at line 41 of file OS_NS_sys_socket.cpp.
References ACE_OS_TRACE, ACE_SOCKCALL_RETURN, ACE_QoS_Params::callee_data(), ACE_QoS_Params::caller_data(), ACE_QoS_Params::group_socket_qos(), and ACE_QoS_Params::socket_qos().
Referenced by ACE_SOCK_SEQPACK_Connector::connect(), ACE_SOCK_Connector::connect(), connect(), and ACE_SOCK_CODgram::open().
00045 { 00046 ACE_OS_TRACE ("ACE_OS::connect"); 00047 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00048 ACE_SOCKCALL_RETURN (::WSAConnect ((ACE_SOCKET) handle, 00049 (const sockaddr *) addr, 00050 (ACE_SOCKET_LEN) addrlen, 00051 (WSABUF *) qos_params.caller_data (), 00052 (WSABUF *) qos_params.callee_data (), 00053 (QOS *) qos_params.socket_qos (), 00054 (QOS *) qos_params.group_socket_qos ()), 00055 int, -1); 00056 # else 00057 ACE_UNUSED_ARG (qos_params); 00058 return ACE_OS::connect (handle, 00059 const_cast <sockaddr *> (addr), 00060 addrlen); 00061 # endif /* ACE_HAS_WINSOCK2 */ 00062 }
ACE_Export ACE_HANDLE ACE_OS::join_leaf | ( | ACE_HANDLE | socket, | |
const sockaddr * | name, | |||
int | namelen, | |||
const ACE_QoS_Params & | qos_params | |||
) |
Joins a leaf node into a QoS-enabled multi-point session.
Definition at line 65 of file OS_NS_sys_socket.cpp.
References ACE_NOTSUP_RETURN, ACE_SOCKCALL_RETURN, ACE_QoS_Params::callee_data(), ACE_QoS_Params::caller_data(), ACE_QoS_Params::flags(), ACE_QoS_Params::group_socket_qos(), ACE_QoS::provider_specific(), ACE_QoS::receiving_flowspec(), ACE_QoS::sending_flowspec(), and ACE_QoS_Params::socket_qos().
00069 { 00070 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00071 00072 QOS qos; 00073 // Construct the WinSock2 QOS structure. 00074 00075 qos.SendingFlowspec = *(qos_params.socket_qos ()->sending_flowspec ()); 00076 qos.ReceivingFlowspec = *(qos_params.socket_qos ()->receiving_flowspec ()); 00077 qos.ProviderSpecific = (WSABUF) qos_params.socket_qos ()->provider_specific (); 00078 00079 ACE_SOCKCALL_RETURN (::WSAJoinLeaf ((ACE_SOCKET) socket, 00080 name, 00081 namelen, 00082 (WSABUF *) qos_params.caller_data (), 00083 (WSABUF *) qos_params.callee_data (), 00084 &qos, 00085 (QOS *) qos_params.group_socket_qos (), 00086 qos_params.flags ()), 00087 ACE_HANDLE, 00088 ACE_INVALID_HANDLE); 00089 00090 # else 00091 ACE_UNUSED_ARG (socket); 00092 ACE_UNUSED_ARG (name); 00093 ACE_UNUSED_ARG (namelen); 00094 ACE_UNUSED_ARG (qos_params); 00095 ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); 00096 # endif /* ACE_HAS_WINSOCK2 */ 00097 }
ACE_Export int ACE_OS::socket_init | ( | int | version_high = 1 , |
|
int | version_low = 1 | |||
) |
Initialize WinSock before first use (e.g., when a DLL is first loaded or the first use of a socket() call.
Definition at line 101 of file OS_NS_sys_socket.cpp.
References ACE_TEXT, fprintf(), and sprintf().
Referenced by ACE_OS_Object_Manager::init().
00102 { 00103 # if defined (ACE_WIN32) && !defined(ACE_DONT_INIT_WINSOCK) 00104 if (ACE_OS::socket_initialized_ == 0) 00105 { 00106 WORD version_requested = MAKEWORD (version_high, version_low); 00107 WSADATA wsa_data; 00108 int error = WSAStartup (version_requested, &wsa_data); 00109 00110 if (error != 0) 00111 # if defined (ACE_HAS_WINCE) 00112 { 00113 ACE_TCHAR fmt[] = ACE_TEXT ("%s failed, WSAGetLastError returned %d"); 00114 ACE_TCHAR buf[80]; // @@ Eliminate magic number. 00115 ACE_OS::sprintf (buf, fmt, ACE_TEXT ("WSAStartup"), error); 00116 ::MessageBox (0, buf, ACE_TEXT ("WSAStartup failed!"), MB_OK); 00117 } 00118 # else 00119 ACE_OS::fprintf (stderr, 00120 "ACE_OS::socket_init; WSAStartup failed, " 00121 "WSAGetLastError returned %d\n", 00122 error); 00123 # endif /* ACE_HAS_WINCE */ 00124 00125 ACE_OS::socket_initialized_ = 1; 00126 } 00127 # else 00128 ACE_UNUSED_ARG (version_high); 00129 ACE_UNUSED_ARG (version_low); 00130 # endif /* ACE_WIN32 */ 00131 return 0; 00132 }
ACE_Export int ACE_OS::socket_fini | ( | void | ) |
Finalize WinSock after last use (e.g., when a DLL is unloaded).
Definition at line 135 of file OS_NS_sys_socket.cpp.
References ACE_TEXT, fprintf(), and sprintf().
Referenced by ACE_OS_Object_Manager::fini().
00136 { 00137 # if defined (ACE_WIN32) 00138 if (ACE_OS::socket_initialized_ != 0) 00139 { 00140 if (WSACleanup () != 0) 00141 { 00142 int error = ::WSAGetLastError (); 00143 # if defined (ACE_HAS_WINCE) 00144 ACE_TCHAR fmt[] = ACE_TEXT ("%s failed, WSAGetLastError returned %d"); 00145 ACE_TCHAR buf[80]; // @@ Eliminate magic number. 00146 ACE_OS::sprintf (buf, fmt, ACE_TEXT ("WSACleanup"), error); 00147 ::MessageBox (0, buf , ACE_TEXT ("WSACleanup failed!"), MB_OK); 00148 # else 00149 ACE_OS::fprintf (stderr, 00150 "ACE_OS::socket_fini; WSACleanup failed, " 00151 "WSAGetLastError returned %d\n", 00152 error); 00153 # endif /* ACE_HAS_WINCE */ 00154 } 00155 ACE_OS::socket_initialized_ = 0; 00156 } 00157 # endif /* ACE_WIN32 */ 00158 return 0; 00159 }
ACE_NAMESPACE_INLINE_FUNCTION ACE_HANDLE ACE_OS::accept | ( | ACE_HANDLE | handle, | |
struct sockaddr * | addr, | |||
int * | addrlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 29 of file OS_NS_sys_socket.inl.
References accept(), ACE_NOTSUP_RETURN, ACE_OS_TRACE, and ACE_SOCKCALL_RETURN.
00032 { 00033 ACE_OS_TRACE ("ACE_OS::accept"); 00034 // On a non-blocking socket with no connections to accept, this 00035 // system call will return EWOULDBLOCK or EAGAIN, depending on the 00036 // platform. UNIX 98 allows either errno, and they may be the same 00037 // numeric value. So to make life easier for upper ACE layers as 00038 // well as application programmers, always change EAGAIN to 00039 // EWOULDBLOCK. Rather than hack the ACE_OSCALL_RETURN macro, it's 00040 // handled explicitly here. If the ACE_OSCALL macro ever changes, 00041 // this function needs to be reviewed. On Win32, the regular macros 00042 // can be used, as this is not an issue. 00043 00044 #if defined (ACE_LACKS_ACCEPT) 00045 ACE_UNUSED_ARG (handle); 00046 ACE_UNUSED_ARG (addr); 00047 ACE_UNUSED_ARG (addrlen); 00048 ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE); 00049 #elif defined (ACE_WIN32) 00050 ACE_SOCKCALL_RETURN (::accept ((ACE_SOCKET) handle, 00051 addr, 00052 (ACE_SOCKET_LEN *) addrlen), 00053 ACE_HANDLE, 00054 ACE_INVALID_HANDLE); 00055 #else 00056 # if defined (ACE_HAS_BROKEN_ACCEPT_ADDR) 00057 // Apparently some platforms like VxWorks can't correctly deal with 00058 // a NULL addr. 00059 00060 sockaddr_in fake_addr; 00061 int fake_addrlen; 00062 00063 if (addrlen == 0) 00064 addrlen = &fake_addrlen; 00065 00066 if (addr == 0) 00067 { 00068 addr = (sockaddr *) &fake_addr; 00069 *addrlen = sizeof fake_addr; 00070 } 00071 # endif /* ACE_HAS_BROKEN_ACCEPT_ADDR */ 00072 ACE_HANDLE ace_result = ::accept ((ACE_SOCKET) handle, 00073 addr, 00074 (ACE_SOCKET_LEN *) addrlen); 00075 00076 # if !(defined (EAGAIN) && defined (EWOULDBLOCK) && EAGAIN == EWOULDBLOCK) 00077 // Optimize this code out if we can detect that EAGAIN == 00078 // EWOULDBLOCK at compile time. If we cannot detect equality at 00079 // compile-time (e.g. if EAGAIN or EWOULDBLOCK are not preprocessor 00080 // macros) perform the check at run-time. The goal is to avoid two 00081 // TSS accesses in the _REENTRANT case when EAGAIN == EWOULDBLOCK. 00082 if (ace_result == ACE_INVALID_HANDLE 00083 # if !defined (EAGAIN) || !defined (EWOULDBLOCK) 00084 && EAGAIN != EWOULDBLOCK 00085 # endif /* !EAGAIN || !EWOULDBLOCK */ 00086 && errno == EAGAIN) 00087 { 00088 errno = EWOULDBLOCK; 00089 } 00090 # endif /* EAGAIN != EWOULDBLOCK*/ 00091 00092 return ace_result; 00093 00094 #endif /* defined (ACE_WIN32) */ 00095 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::bind | ( | ACE_HANDLE | s, | |
struct sockaddr * | name, | |||
int | namelen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 98 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL, ACE_SOCKCALL_RETURN, bind(), and getsockname().
Referenced by bind(), ACE_Hash_Cache_Map_Manager< KEY, VALUE, HASH_KEY, COMPARE_KEYS, CACHING_STRATEGY, ATTRIBUTES >::bind(), ACE::bind_port(), ACE_SOCK_CODgram::open(), ACE_SOCK_SEQPACK_Connector::shared_connect_start(), ACE_SOCK_Connector::shared_connect_start(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), ACE_SOCK_Dgram::shared_open(), and ACE_SOCK_Acceptor::shared_open().
00099 { 00100 ACE_OS_TRACE ("ACE_OS::bind"); 00101 #if defined (ACE_LACKS_BIND) 00102 ACE_UNUSED_ARG (handle); 00103 ACE_UNUSED_ARG (addr); 00104 ACE_UNUSED_ARG (addrlen); 00105 ACE_NOTSUP_RETURN (-1); 00106 #elif defined (ACE_VXWORKS) && (ACE_VXWORKS <= 0x640) 00107 // VxWorks clears the sin_port member after a succesfull bind when 00108 // sin_addr != INADDR_ANY, so after the bind we do retrieve the 00109 // original address so that user code can safely check the addr 00110 // after the bind. See bugzilla 3107 for more details 00111 int result; 00112 ACE_SOCKCALL (::bind ((ACE_SOCKET) handle, 00113 addr, 00114 (ACE_SOCKET_LEN) addrlen), int, -1, result); 00115 if (result == -1) 00116 return -1; 00117 else 00118 return ACE_OS::getsockname (handle, addr, &addrlen); 00119 #else 00120 ACE_SOCKCALL_RETURN (::bind ((ACE_SOCKET) handle, 00121 addr, 00122 (ACE_SOCKET_LEN) addrlen), int, -1); 00123 #endif 00124 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::closesocket | ( | ACE_HANDLE | s | ) |
Takes care of windows specific requirement to call closesocket.
Definition at line 127 of file OS_NS_sys_socket.inl.
References ACE_OS_TRACE, ACE_SOCKCALL_RETURN, close(), and closesocket().
Referenced by ACE_SOCK::close(), ACE_Pipe::close(), ACE_Process::close_dup_handles(), ACE_Process::close_passed_handles(), and closesocket().
00128 { 00129 ACE_OS_TRACE ("ACE_OS::closesocket"); 00130 #if defined (ACE_WIN32) 00131 // @note Do not shutdown the write end here. Doing so will break 00132 // applications that duplicate a handle on fork(), for 00133 // example, and expect to continue writing in the fork()ed 00134 // process. 00135 00136 ACE_SOCKCALL_RETURN (::closesocket ((SOCKET) handle), int, -1); 00137 #else 00138 //FUZZ: disable check_for_lack_ACE_OS 00139 ACE_OSCALL_RETURN (::close (handle), int, -1); 00140 //FUZZ: enable check_for_lack_ACE_OS 00141 #endif /* ACE_WIN32 */ 00142 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::connect | ( | ACE_HANDLE | handle, | |
struct sockaddr * | addr, | |||
int | addrlen | |||
) |
BSD-style <connect> (no QoS).
Definition at line 145 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and connect().
00148 { 00149 ACE_OS_TRACE ("ACE_OS::connect"); 00150 #if defined (ACE_LACKS_CONNECT) 00151 ACE_UNUSED_ARG (handle); 00152 ACE_UNUSED_ARG (addr); 00153 ACE_UNUSED_ARG (addrlen); 00154 ACE_NOTSUP_RETURN (-1); 00155 #else 00156 ACE_SOCKCALL_RETURN (::connect ((ACE_SOCKET) handle, 00157 addr, 00158 (ACE_SOCKET_LEN) addrlen), int, -1); 00159 #endif /* ACE_LACKS_CONNECT */ 00160 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::enum_protocols | ( | int * | protocols, | |
ACE_Protocol_Info * | protocol_buffer, | |||
u_long * | buffer_length | |||
) |
Retrieve information about available transport protocols installed on the local machine. Windows specific...
Definition at line 163 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, and ACE_SOCKCALL_RETURN.
00166 { 00167 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00168 00169 ACE_SOCKCALL_RETURN (::WSAEnumProtocols (protocols, 00170 protocol_buffer, 00171 buffer_length), 00172 int, 00173 SOCKET_ERROR); 00174 00175 #else 00176 ACE_UNUSED_ARG (protocols); 00177 ACE_UNUSED_ARG (protocol_buffer); 00178 ACE_UNUSED_ARG (buffer_length); 00179 ACE_NOTSUP_RETURN (-1); 00180 #endif /* ACE_HAS_WINSOCK2 */ 00181 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getpeername | ( | ACE_HANDLE | handle, | |
struct sockaddr * | addr, | |||
int * | addrlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 184 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL, ACE_SOCKCALL_RETURN, AF_INET, getpeername(), and memset().
Referenced by ACE_SOCK_SEQPACK_Connector::complete(), ACE_SOCK_Connector::complete(), ACE_SOCK::get_remote_addr(), ACE_SOCK_SEQPACK_Association::get_remote_addrs(), and getpeername().
00186 { 00187 ACE_OS_TRACE ("ACE_OS::getpeername"); 00188 00189 #if defined (ACE_LACKS_GETPEERNAME) 00190 ACE_UNUSED_ARG (handle); 00191 ACE_UNUSED_ARG (addr); 00192 ACE_UNUSED_ARG (addrlen); 00193 ACE_NOTSUP_RETURN (-1); 00194 #elif defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) \ 00195 && (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO == 1) 00196 int result; 00197 ACE_SOCKCALL (::getpeername ((ACE_SOCKET) handle, 00198 addr, 00199 (ACE_SOCKET_LEN *) addrlen), 00200 int, 00201 -1, 00202 result); 00203 00204 // Some platforms, like older versions of the Linux kernel, do not 00205 // initialize the sin_zero field since that field is generally only 00206 // used for padding/alignment purposes. On those platforms 00207 // memcmp()-based comparisons of the sockaddr_in structure, such as 00208 // the one in the ACE_INET_Addr equality operator, may fail due to 00209 // random bytes in the sin_zero field even though that field is 00210 // unused. Prevent equality comparison of two different sockaddr_in 00211 // instances that refer to the same socket from failing by 00212 // explicitly initializing the sockaddr_in::sin_zero field to a 00213 // consistent value, e.g. zero. 00214 if (result != -1 && addr->sa_family == AF_INET) 00215 { 00216 ACE_OS::memset (reinterpret_cast<struct sockaddr_in *> (addr)->sin_zero, 00217 0, 00218 sizeof (reinterpret_cast<struct sockaddr_in *> (addr)->sin_zero)); 00219 } 00220 00221 return result; 00222 #else 00223 ACE_SOCKCALL_RETURN (::getpeername ((ACE_SOCKET) handle, 00224 addr, 00225 (ACE_SOCKET_LEN *) addrlen), 00226 int, 00227 -1); 00228 #endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ 00229 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getsockname | ( | ACE_HANDLE | handle, | |
struct sockaddr * | addr, | |||
int * | addrlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 232 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL, ACE_SOCKCALL_RETURN, AF_INET, getsockname(), and memset().
Referenced by bind(), ACE_SOCK::get_local_addr(), ACE_SOCK_SEQPACK_Association::get_local_addrs(), getsockname(), and ACE_SOCK_SEQPACK_Connector::shared_connect_start().
00235 { 00236 ACE_OS_TRACE ("ACE_OS::getsockname"); 00237 #if defined (ACE_LACKS_GETSOCKNAME) 00238 ACE_UNUSED_ARG (handle); 00239 ACE_UNUSED_ARG (addr); 00240 ACE_UNUSED_ARG (addrlen); 00241 ACE_NOTSUP_RETURN (-1); 00242 #elif defined (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO) \ 00243 && (ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO == 1) 00244 int result; 00245 ACE_SOCKCALL (::getsockname ((ACE_SOCKET) handle, 00246 addr, 00247 (ACE_SOCKET_LEN *) addrlen), 00248 int, -1, result); 00249 00250 // Some platforms, like older versions of the Linux kernel, do not 00251 // initialize the sin_zero field since that field is generally only 00252 // used for padding/alignment purposes. On those platforms 00253 // memcmp()-based comparisons of the sockaddr_in structure, such as 00254 // the one in the ACE_INET_Addr equality operator, may fail due to 00255 // random bytes in the sin_zero field even though that field is 00256 // unused. Prevent equality comparison of two different sockaddr_in 00257 // instances that refer to the same socket from failing by 00258 // explicitly initializing the sockaddr_in::sin_zero field to a 00259 // consistent value, e.g. zero. 00260 if (result != -1 && addr->sa_family == AF_INET) 00261 { 00262 ACE_OS::memset (reinterpret_cast<struct sockaddr_in *> (addr)->sin_zero, 00263 0, 00264 sizeof (reinterpret_cast<struct sockaddr_in *> (addr)->sin_zero)); 00265 } 00266 00267 return result; 00268 #else 00269 ACE_SOCKCALL_RETURN (::getsockname ((ACE_SOCKET) handle, 00270 addr, 00271 (ACE_SOCKET_LEN *) addrlen), 00272 int, -1); 00273 #endif /* ACE_GETNAME_RETURNS_RANDOM_SIN_ZERO */ 00274 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::getsockopt | ( | ACE_HANDLE | handle, | |
int | level, | |||
int | optname, | |||
char * | optval, | |||
int * | optlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 277 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and getsockopt().
Referenced by ACE_SOCK::get_option(), getsockopt(), and ACE::handle_timed_complete().
00282 { 00283 ACE_OS_TRACE ("ACE_OS::getsockopt"); 00284 #if defined (ACE_LACKS_GETSOCKOPT) 00285 ACE_UNUSED_ARG (handle); 00286 ACE_UNUSED_ARG (level); 00287 ACE_UNUSED_ARG (optname); 00288 ACE_UNUSED_ARG (optval); 00289 ACE_UNUSED_ARG (optlen); 00290 ACE_NOTSUP_RETURN (-1); 00291 #else 00292 ACE_SOCKCALL_RETURN (::getsockopt ((ACE_SOCKET) handle, 00293 level, 00294 optname, 00295 optval, 00296 (ACE_SOCKET_LEN *) optlen), 00297 int, 00298 -1); 00299 #endif /* ACE_LACKS_GETSOCKOPT */ 00300 }
ACE_NAMESPACE_INLINE_FUNCTION int ACE_OS::listen | ( | ACE_HANDLE | handle, | |
int | backlog | |||
) |
BSD-style <accept> (no QoS).
Definition at line 303 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and listen().
Referenced by listen(), ACE_SOCK_SEQPACK_Acceptor::shared_open(), and ACE_SOCK_Acceptor::shared_open().
00304 { 00305 ACE_OS_TRACE ("ACE_OS::listen"); 00306 #if defined (ACE_LACKS_LISTEN) 00307 ACE_UNUSED_ARG (handle); 00308 ACE_UNUSED_ARG (backlog); 00309 ACE_NOTSUP_RETURN (-1); 00310 #else 00311 ACE_SOCKCALL_RETURN (::listen ((ACE_SOCKET) handle, backlog), int, -1); 00312 #endif /* ACE_LACKS_LISTEN */ 00313 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::recv | ( | ACE_HANDLE | handle, | |
char * | buf, | |||
size_t | len, | |||
int | flags = 0 | |||
) |
BSD-style <accept> (no QoS).
Definition at line 316 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and recv().
Referenced by ACE_Pipe::recv(), recv(), ACE::recv(), ACE::recv_i(), ACE::recv_n_i(), and recvv().
00317 { 00318 ACE_OS_TRACE ("ACE_OS::recv"); 00319 00320 // On UNIX, a non-blocking socket with no data to receive, this 00321 // system call will return EWOULDBLOCK or EAGAIN, depending on the 00322 // platform. UNIX 98 allows either errno, and they may be the same 00323 // numeric value. So to make life easier for upper ACE layers as 00324 // well as application programmers, always change EAGAIN to 00325 // EWOULDBLOCK. Rather than hack the ACE_OSCALL_RETURN macro, it's 00326 // handled explicitly here. If the ACE_OSCALL macro ever changes, 00327 // this function needs to be reviewed. On Win32, the regular macros 00328 // can be used, as this is not an issue. 00329 #if defined (ACE_LACKS_RECV) 00330 ACE_UNUSED_ARG (handle); 00331 ACE_UNUSED_ARG (buf); 00332 ACE_UNUSED_ARG (len); 00333 ACE_UNUSED_ARG (flags); 00334 ACE_NOTSUP_RETURN (-1); 00335 #elif defined (ACE_WIN32) 00336 ACE_SOCKCALL_RETURN (::recv ((ACE_SOCKET) handle, buf, 00337 static_cast<int> (len), flags), ssize_t, -1); 00338 #else 00339 ssize_t ace_result_; 00340 ace_result_ = ::recv ((ACE_SOCKET) handle, buf, len, flags); 00341 00342 # if !(defined (EAGAIN) && defined (EWOULDBLOCK) && EAGAIN == EWOULDBLOCK) 00343 // Optimize this code out if we can detect that EAGAIN == 00344 // EWOULDBLOCK at compile time. If we cannot detect equality at 00345 // compile-time (e.g. if EAGAIN or EWOULDBLOCK are not preprocessor 00346 // macros) perform the check at run-time. The goal is to avoid two 00347 // TSS accesses in the _REENTRANT case when EAGAIN == EWOULDBLOCK. 00348 if (ace_result_ == -1 00349 # if !defined (EAGAIN) || !defined (EWOULDBLOCK) 00350 && EAGAIN != EWOULDBLOCK 00351 # endif /* !EAGAIN || !EWOULDBLOCK */ 00352 && errno == EAGAIN) 00353 { 00354 errno = EWOULDBLOCK; 00355 } 00356 # endif /* EAGAIN != EWOULDBLOCK*/ 00357 00358 return ace_result_; 00359 #endif /* ACE_LACKS_RECV */ 00360 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::recvfrom | ( | ACE_HANDLE | handle, | |
char * | buf, | |||
size_t | len, | |||
int | flags, | |||
struct sockaddr * | addr, | |||
int * | addrlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 363 of file OS_NS_sys_socket.inl.
Referenced by ACE_SOCK_Dgram::recv(), recvfrom(), and ACE::recvfrom().
00369 { 00370 ACE_OS_TRACE ("ACE_OS::recvfrom"); 00371 #if defined (ACE_LACKS_RECVFROM) 00372 ACE_UNUSED_ARG (handle); 00373 ACE_UNUSED_ARG (buf); 00374 ACE_UNUSED_ARG (len); 00375 ACE_UNUSED_ARG (flags); 00376 ACE_UNUSED_ARG (addr); 00377 ACE_UNUSED_ARG (addrlen); 00378 ACE_NOTSUP_RETURN (-1); 00379 #elif defined (ACE_WIN32) 00380 int const shortened_len = static_cast<int> (len); 00381 int const result = ::recvfrom ((ACE_SOCKET) handle, 00382 buf, 00383 shortened_len, 00384 flags, 00385 addr, 00386 (ACE_SOCKET_LEN *) addrlen); 00387 if (result == SOCKET_ERROR) 00388 { 00389 ACE_OS::set_errno_to_wsa_last_error (); 00390 if (errno == WSAEMSGSIZE && 00391 ACE_BIT_ENABLED (flags, MSG_PEEK)) 00392 return shortened_len; 00393 else 00394 return -1; 00395 } 00396 else 00397 return result; 00398 #else /* non Win32 */ 00399 ACE_SOCKCALL_RETURN (::recvfrom ((ACE_SOCKET) handle, 00400 buf, 00401 len, 00402 flags, 00403 addr, 00404 (ACE_SOCKET_LEN *) addrlen), 00405 ssize_t, -1); 00406 #endif /* ACE_LACKS_RECVFROM */ 00407 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::recvfrom | ( | ACE_HANDLE | handle, | |
iovec * | buffers, | |||
int | buffer_count, | |||
size_t & | number_of_bytes_recvd, | |||
int & | flags, | |||
struct sockaddr * | addr, | |||
int * | addrlen, | |||
ACE_OVERLAPPED * | overlapped, | |||
ACE_OVERLAPPED_COMPLETION_FUNC | func | |||
) |
BSD-style <accept> (no QoS).
Definition at line 410 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, and set_errno_to_wsa_last_error().
00419 { 00420 ACE_OS_TRACE ("ACE_OS::recvfrom"); 00421 00422 #if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) 00423 DWORD bytes_recvd; 00424 DWORD the_flags = flags; 00425 int result = ::WSARecvFrom ((SOCKET) handle, 00426 (WSABUF*)buffers, 00427 buffer_count, 00428 &bytes_recvd, 00429 &the_flags, 00430 addr, 00431 addrlen, 00432 overlapped, 00433 func); 00434 if (result != 0) { 00435 ACE_OS::set_errno_to_wsa_last_error (); 00436 } 00437 flags = the_flags; 00438 number_of_bytes_recvd = static_cast<size_t> (bytes_recvd); 00439 return result; 00440 #else 00441 ACE_UNUSED_ARG (handle); 00442 ACE_UNUSED_ARG (buffers); 00443 ACE_UNUSED_ARG (buffer_count); 00444 ACE_UNUSED_ARG (number_of_bytes_recvd); 00445 ACE_UNUSED_ARG (flags); 00446 ACE_UNUSED_ARG (addr); 00447 ACE_UNUSED_ARG (addrlen); 00448 ACE_UNUSED_ARG (overlapped); 00449 ACE_UNUSED_ARG (func); 00450 ACE_NOTSUP_RETURN (-1); 00451 #endif /* defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0) */ 00452 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::recvmsg | ( | ACE_HANDLE | handle, | |
struct msghdr * | msg, | |||
int | flags | |||
) |
BSD-style <accept> (no QoS).
Definition at line 455 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, recvmsg(), and set_errno_to_wsa_last_error().
Referenced by recvmsg(), and ACE::recvmsg().
00456 { 00457 ACE_OS_TRACE ("ACE_OS::recvmsg"); 00458 #if !defined (ACE_LACKS_RECVMSG) 00459 # if (defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)) 00460 DWORD bytes_received = 0; 00461 00462 int result = ::WSARecvFrom ((SOCKET) handle, 00463 (WSABUF *) msg->msg_iov, 00464 msg->msg_iovlen, 00465 &bytes_received, 00466 (DWORD *) &flags, 00467 msg->msg_name, 00468 &msg->msg_namelen, 00469 0, 00470 0); 00471 00472 if (result != 0) 00473 { 00474 ACE_OS::set_errno_to_wsa_last_error (); 00475 return -1; 00476 } 00477 else 00478 return bytes_received; 00479 # else /* ACE_HAS_WINSOCK2 */ 00480 ACE_SOCKCALL_RETURN (::recvmsg (handle, msg, flags), ssize_t, -1); 00481 # endif /* ACE_HAS_WINSOCK2 */ 00482 #else 00483 ACE_UNUSED_ARG (flags); 00484 ACE_UNUSED_ARG (msg); 00485 ACE_UNUSED_ARG (handle); 00486 00487 ACE_NOTSUP_RETURN (-1); 00488 #endif /* ACE_LACKS_RECVMSG */ 00489 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::recvv | ( | ACE_HANDLE | handle, | |
iovec * | iov, | |||
int | iovlen | |||
) |
BSD-style <accept> (no QoS).
Definition at line 492 of file OS_NS_sys_socket.inl.
References readv(), recv(), and set_errno_to_wsa_last_error().
Referenced by ACE_SOCK_IO::recv(), ACE_Pipe::recv(), ACE::recv(), ACE::recvv(), and ACE::recvv_n_i().
00495 { 00496 #if defined (ACE_HAS_WINSOCK2) 00497 00498 DWORD bytes_received = 0; 00499 int result = 1; 00500 00501 // Winsock 2 has WSARecv and can do this directly, but Winsock 1 needs 00502 // to do the recvs piece-by-piece. 00503 00504 # if (ACE_HAS_WINSOCK2 != 0) 00505 DWORD flags = 0; 00506 result = ::WSARecv ((SOCKET) handle, 00507 (WSABUF *) buffers, 00508 n, 00509 &bytes_received, 00510 &flags, 00511 0, 00512 0); 00513 # else 00514 int i, chunklen; 00515 char *chunkp = 0; 00516 00517 // Step through the buffers requested by caller; for each one, cycle 00518 // through reads until it's filled or an error occurs. 00519 for (i = 0; i < n && result > 0; ++i) 00520 { 00521 chunkp = buffers[i].iov_base; // Point to part of chunk being read 00522 chunklen = buffers[i].iov_len; // Track how much to read to chunk 00523 while (chunklen > 0 && result > 0) 00524 { 00525 result = ::recv ((SOCKET) handle, chunkp, chunklen, 0); 00526 if (result > 0) 00527 { 00528 chunkp += result; 00529 chunklen -= result; 00530 bytes_received += result; 00531 } 00532 } 00533 } 00534 # endif /* ACE_HAS_WINSOCK2 != 0 */ 00535 00536 if (result == SOCKET_ERROR) 00537 { 00538 ACE_OS::set_errno_to_wsa_last_error (); 00539 return -1; 00540 } 00541 else 00542 return (ssize_t) bytes_received; 00543 #else 00544 return ACE_OS::readv (handle, buffers, n); 00545 #endif /* ACE_HAS_WINSOCK2 */ 00546 }
ACE_NAMESPACE_INLINE_FUNCTION ssize_t ACE_OS::send | ( | ACE_HANDLE | handle, | |
const char * | buf, | |||
size_t | len, | |||
int | flags = 0 | |||
) |
BSD-style <accept> (no QoS).
Definition at line 549 of file OS_NS_sys_socket.inl.
References ACE_NOTSUP_RETURN, ACE_OS_TRACE, ACE_SOCKCALL_RETURN, and send().
Referenced by ACE_Pipe::send(), send(), ACE::send(), ACE::send_i(), ACE::send_n_i(), sendfile_emulation(), and sendv().
00550 { 00551 ACE_OS_TRACE ("ACE_OS::send"); 00552 00553 // On UNIX, a non-blocking socket with no data to receive, this 00554 // system call will return EWOULDBLOCK or EAGAIN, depending on the 00555 // platform. UNIX 98 allows either errno, and they may be the same 00556 // numeric value. So to make life easier for upper ACE layers as 00557 // well as application programmers, always change EAGAIN to 00558 // EWOULDBLOCK. Rather than hack the ACE_OSCALL_RETURN macro, it's 00559 // handled explicitly here. If the ACE_OSCALL macro ever changes, 00560 // this function needs to be reviewed. On Win32, the regular macros 00561 // can be used, as this is not an issue. 00562 #if defined (ACE_LACKS_SEND) 00563 ACE_UNUSED_ARG (handle); 00564 ACE_UNUSED_ARG (buf); 00565 ACE_UNUSED_ARG (len); 00566 ACE_UNUSED_ARG (flags); 00567 ACE_NOTSUP_RETURN (-1); 00568 #elif defined (ACE_WIN32) 00569 ACE_SOCKCALL_RETURN (::send ((ACE_SOCKET) handle,