ACE_OS Namespace Reference

This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems. More...

Classes

struct  macaddr_node_t
class  ace_flock_t
 OS file locking structure. More...

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_NAMESPACE_INLINE_FUNCTION
unsigned long 
inet_addr (const char *name)
ACE_Export int inet_aton (const char *strptr, struct in_addr *addr)
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_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_Export int scandir_emulation (const ACE_TCHAR *dirname, ACE_DIRENT **namelist[], ACE_SCANDIR_SELECTOR selector, ACE_SCANDIR_COMPARATOR comparator)
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_NAMESPACE_INLINE_FUNCTION int fcntl (ACE_HANDLE handle, int cmd, long arg=0)
ACE_Export ACE_HANDLE 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.
ACE_Export ACE_HANDLE open (const wchar_t *filename, int mode, mode_t perms=ACE_DEFAULT_OPEN_PERMS, LPSECURITY_ATTRIBUTES sa=0)
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_Export
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_Export int getmacaddress (struct macaddr_node_t *node)
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_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_NAMESPACE_INLINE_FUNCTION void clearerr (FILE *fp)
ACE_Export int asprintf (char **bufp, const char *format,...)
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
ACE_HANDLE 
fileno (FILE *stream)
ACE_NAMESPACE_INLINE_FUNCTION
FILE * 
fopen (const char *filename, const char *mode)
ACE_Export int fprintf (FILE *fp, const char *format,...)
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_Export int printf (const char *format,...)
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_Export int snprintf (char *buf, size_t maxlen, const char *format,...)
ACE_Export int sprintf (char *buf, const char *format,...)
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_Export int vasprintf_emulation (char **bufp, const char *format, va_list argptr)
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_NAMESPACE_INLINE_FUNCTION
wchar_t * 
strtok_r (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts)
 Finds the next token in a string (wchar_t version).
ACE_Export char * strtok_r_emulation (char *s, const char *tokens, char **lasts)
 Emulated strtok_r.
ACE_Export wchar_t * strtok_r_emulation (ACE_WCHAR_T *s, const ACE_WCHAR_T *tokens, ACE_WCHAR_T **lasts)
 Emulated strtok_r (wchar_t 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 strcasecmp (const wchar_t *s, const wchar_t *t)
 Compares two strings (case insensitive const wchar_t 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_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_Export 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.
ACE_Export int 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)
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_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_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_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_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_Export ssize_t sendfile_emulation (ACE_HANDLE out_fd, ACE_HANDLE in_fd, off_t *offset, size_t count)
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_NAMESPACE_INLINE_FUNCTION
ssize_t 
readv (ACE_HANDLE handle, const iovec *iov, int iovlen)
ACE_Export ssize_t readv_emulation (ACE_HANDLE handle, const iovec *iov, int iovcnt)
ACE_NAMESPACE_INLINE_FUNCTION
ssize_t 
writev (ACE_HANDLE handle, const iovec *iov, int iovcnt)
ACE_Export int uname (ACE_utsname *name)
ACE_NAMESPACE_INLINE_FUNCTION pid_t wait (int *=0)
 Calls OS wait function, so it's only portable to UNIX/POSIX platforms.
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_Export void cleanup_tss (const u_int main_thread)
ACE_Export int lwp_getparams (ACE_Sched_Params &)
ACE_Export int lwp_setparams (const ACE_Sched_Params &)
ACE_NAMESPACE_INLINE_FUNCTION long priority_control (ACE_idtype_t, ACE_id_t, int, void *)
 Low-level interface to priocntl(2).
ACE_Export int scheduling_class (const char *class_name, ACE_id_t &)
 Find the schedling class ID that corresponds to the class name.
ACE_Export int set_scheduling_params (const ACE_Sched_Params &, ACE_id_t id=ACE_SELF)
 Friendly 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_Export int thr_create (ACE_THR_FUNC func, void *args, long flags, ACE_thread_t *thr_id, ACE_hthread_t *t_handle=0, long priority=ACE_DEFAULT_THREAD_PRIORITY, void *stack=0, size_t stacksize=ACE_DEFAULT_THREAD_STACKSIZE, ACE_Base_Thread_Adapter *thread_adapter=0, const char **thr_name=0)
ACE_NAMESPACE_INLINE_FUNCTION int thr_equal (ACE_thread_t t1, ACE_thread_t t2)
ACE_Export void thr_exit (ACE_THR_FUNC_RETURN status=0)
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_Export int thr_get_affinity (ACE_hthread_t thr_id, size_t cpu_set_size, cpu_set_t *cpu_mask)
ACE_Export int thr_set_affinity (ACE_hthread_t thr_id, size_t cpu_set_size, const cpu_set_t *cpu_mask)
ACE_Export int thr_key_detach (ACE_thread_key_t key, void *inst)
ACE_Export int thr_key_used (ACE_thread_key_t key)
ACE_Export int thr_keycreate (ACE_thread_key_t *key, ACE_THR_DEST, void *inst=0)
ACE_Export int thr_keyfree (ACE_thread_key_t key)
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_Export int thr_setprio (const ACE_Sched_Priority prio)
ACE_Export int thr_setspecific (ACE_thread_key_t key, void *data)
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_Export void unique_name (const void *object, char *name, size_t length)
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_Export int argv_to_string (int argc, ACE_TCHAR **argv, ACE_TCHAR *&buf, bool substitute_env_args=true, bool quote_args=false)
 used by ARGV::argv_to_string() and ACE_OS::fork_exec()
ACE_Export int argv_to_string (ACE_TCHAR **argv, ACE_TCHAR *&buf, bool substitute_env_args=true, bool quote_args=false)
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
ACE_HANDLE 
dup (ACE_HANDLE handle, pid_t pid)
ACE_NAMESPACE_INLINE_FUNCTION int dup2 (ACE_HANDLE oldfd, ACE_HANDLE newfd)
ACE_Export int execl (const char *path, const char *arg0,...)
ACE_Export int execle (const char *path, const char *arg0,...)
ACE_Export int execlp (const char *file, const char *arg0,...)
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_Export long num_processors (void)
 Get the number of CPUs configured in the machine.
ACE_Export long num_processors_online (void)
 Get the number of CPUs currently online.
ACE_NAMESPACE_INLINE_FUNCTION int pipe (ACE_HANDLE handles[])
ACE_Export ssize_t pread (ACE_HANDLE handle, void *buf, size_t nbyte, ACE_OFF_T offset)
ACE_Export ssize_t pwrite (ACE_HANDLE handle, const void *buf, size_t nbyte, ACE_OFF_T offset)
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_Export ssize_t read_n (ACE_HANDLE handle, void *buf, size_t len, size_t *bytes_transferred=0)
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_Export int string_to_argv (ACE_TCHAR *buf, int &argc, ACE_TCHAR **&argv, bool substitute_env_args=true)
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_Export ssize_t write_n (ACE_HANDLE handle, const void *buf, size_t len, size_t *bytes_transferred=0)
ACE_NAMESPACE_INLINE_FUNCTION
wint_t 
fgetwc (FILE *fp)
ACE_Export int wcscmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2)
 Emulated wcscmp - Compares strings.
ACE_Export size_t wcslen_emulation (const ACE_WCHAR_T *string)
 Emulated wcslen - Returns the length of a string.
ACE_Export ACE_WCHAR_T * wcsncat_emulation (ACE_WCHAR_T *destination, const ACE_WCHAR_T *source, size_t count)
 Emulated wcscat - Appends a string.
ACE_Export int wcsncmp_emulation (const ACE_WCHAR_T *string1, const ACE_WCHAR_T *string2, size_t len)
 Emulated wcsncmp - Compares two arrays.
ACE_Export 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_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)
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_isblank (ACE_TCHAR c)
 Returns true if the character is a control character.
ACE_NAMESPACE_INLINE_FUNCTION int ace_isascii (ACE_TCHAR c)
 Returns true if the character is a control 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 ace_isctype (int c, ctype_t desc)
 Tests c for the property specified by the desc argument.
Functions from <cstring>

Included are the functions defined in <cstring> and their <cwchar> equivalents.

Todo:
To be complete, we should add strcoll, and strxfrm.


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_Export const void * memchr_emulation (const void *s, int c, size_t len)
 Emulated memchr - Finds a character in a buffer.
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_Export void * fast_memcpy (void *t, const void *s, size_t len)
 Finds characters in a buffer (const void version).
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
wchar_t * 
strcat (wchar_t *s, const wchar_t *t)
 Appends a string to another string (wchar_t version).
ACE_NAMESPACE_INLINE_FUNCTION
const char * 
strchr (const char *s, int c)
ACE_NAMESPACE_INLINE_FUNCTION
const wchar_t * 
strchr (const wchar_t *s, wchar_t 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
wchar_t * 
strchr (wchar_t *s, wchar_t c)
 Finds the first occurance of a character in a string (wchar_t 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
wchar_t * 
strcpy (wchar_t *s, const wchar_t *t)
 Copies a string (wchar_t version).
ACE_NAMESPACE_INLINE_FUNCTION
size_t 
strcspn (const char *s, const char *reject)
ACE_NAMESPACE_INLINE_FUNCTION
size_t 
strcspn (const wchar_t *s, const wchar_t *reject)
ACE_NAMESPACE_INLINE_FUNCTION
char * 
strdup (const char *s)
 Returns a malloced duplicated string (char version).
ACE_Export char * strdup_emulation (const char *s)
 Finds characters in a buffer (const void version).
ACE_NAMESPACE_INLINE_FUNCTION
wchar_t * 
strdup (const wchar_t *s)
 Returns a malloced duplicated string (wchar_t version).
ACE_Export wchar_t * strdup_emulation (const wchar_t *s)
 Finds characters in a buffer (const void version).
ACE_Export char * strecpy (char *des, const char *src)
ACE_Export wchar_t * strecpy (wchar_t *s, const wchar_t *t)
ACE_Export char * strerror (int errnum)
ACE_Export char * strerror_emulation (int errnum)
 Emulated strerror - Returns a system error message.
ACE_Export char * strsignal (int signum)
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_Export const char * strnchr (const char *s, int c, size_t len)
ACE_Export const ACE_WCHAR_T * strnchr (const ACE_WCHAR_T *s, ACE_WCHAR_T c, size_t len)
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_Export const char * strnstr (const char *s, const char *t, size_t len)
ACE_Export const ACE_WCHAR_T * strnstr (const ACE_WCHAR_T *s, const ACE_WCHAR_T *t, size_t len)
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
const wchar_t * 
strpbrk (const wchar_t *s1, const wchar_t *s2)
 Searches for characters in a string (const wchar_t version).
ACE_NAMESPACE_INLINE_FUNCTION
char * 
strpbrk (char *s1, const char *s2)
 Searches for characters in a string (char version).
ACE_NAMESPACE_INLINE_FUNCTION
wchar_t * 
strpbrk (wchar_t *s1, const wchar_t *s2)
 Searches for characters in a string (wchar_t version).
ACE_NAMESPACE_INLINE_FUNCTION
const char * 
strrchr (const char *s, int c)
ACE_NAMESPACE_INLINE_FUNCTION
const wchar_t * 
strrchr (const wchar_t *s, wchar_t 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
wchar_t * 
strrchr (wchar_t *s, wchar_t c)
 Finds the last occurance of a character in a string (wchar_t version).
ACE_Export char * strrchr_emulation (char *s, int c)
ACE_Export const char * strrchr_emulation (const char *s, int c)
ACE_Export char * strsncpy (char *dst, const char *src, size_t maxlen)
 This is a "safe" c string copy function (char version).
ACE_Export 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
size_t 
strspn (const char *s1, const char *s2)
ACE_NAMESPACE_INLINE_FUNCTION
size_t 
strspn (const wchar_t *s1, const wchar_t *s2)
ACE_NAMESPACE_INLINE_FUNCTION
const char * 
strstr (const char *s, const char *t)
ACE_NAMESPACE_INLINE_FUNCTION
const wchar_t * 
strstr (const wchar_t *s, const wchar_t *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
wchar_t * 
strstr (wchar_t *s, const wchar_t *t)
 Finds the first occurance of a substring in a string (wchar_t 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
wchar_t * 
strtok (wchar_t *s, const wchar_t *tokens)
 Finds the next token in a string (wchar_t version).

Non-standard functions

These functions aren't in the standard.



ACE_Export ACE_EXIT_HOOK exit_hook_
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION void _exit (int status=0)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION void abort (void)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int atexit (ACE_EXIT_HOOK func, const char *name=0)
ACE_NAMESPACE_INLINE_FUNCTION int atoi (const char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION long atol (const char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
double 
atof (const char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
void * 
atop (const char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
void * 
bsearch (const void *key, const void *base, size_t nel, size_t size, ACE_COMPARE_FUNC)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export void * calloc (size_t elements, size_t sizeof_elements)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export void exit (int status=0)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export void free (void *)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
char * 
getenv (const char *symbol)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export ACE_TCHARgetenvstrings (void)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
char * 
itoa (int value, char *string, int radix)
 Converts an integer to a string.
ACE_Export char * itoa_emulation (int value, char *string, int radix)
 Emulated itoa - Converts an integer to a string.
ACE_Export void * malloc (size_t)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
ACE_HANDLE 
mkstemp (char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
char * 
mktemp (char *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int putenv (const char *string)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION void qsort (void *base, size_t nel, size_t width, ACE_COMPARE_FUNC)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int setenv (const char *envname, const char *envval, int overwrite)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int unsetenv (const char *name)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int rand (void)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION int rand_r (ACE_RANDR_TYPE &seed)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export void * realloc (void *, size_t)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
char * 
realpath (const char *file_name, char *resolved_name)
 Function that is called by <ACE_OS::exit>, if non-null.
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)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_Export ACE_TCHARstrenvdup (const ACE_TCHAR *str)
 Function that is called by <ACE_OS::exit>, if non-null.
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
ACE_INT64 
strtoll (const char *s, char **ptr, int base)
 Converts a string to a signed 64 bit int value (char version).
ACE_NAMESPACE_INLINE_FUNCTION
ACE_UINT64 
strtoull (const char *s, char **ptr, int base)
 Converts a string to a unsigned 64 bit int value (char version).
ACE_NAMESPACE_INLINE_FUNCTION int system (const ACE_TCHAR *s)
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION
const char * 
getprogname ()
ACE_Export const char * getprogname_emulation ()
 Function that is called by <ACE_OS::exit>, if non-null.
ACE_NAMESPACE_INLINE_FUNCTION void setprogname (const char *name)
ACE_Export void setprogname_emulation (const char *name)
 Function that is called by <ACE_OS::exit>, if non-null.



ACE_Export ACE_thread_t NULL_thread
ACE_Export ACE_hthread_t NULL_hthread
ACE_Export ACE_thread_key_t NULL_key
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 *s)
ACE_NAMESPACE_INLINE_FUNCTION int raise (const int signum)
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)
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_NAMESPACE_INLINE_FUNCTION
ACE_HANDLE 
accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen)
 BSD-style accept (no QoS).
ACE_Export ACE_HANDLE accept (ACE_HANDLE handle, struct sockaddr *addr, int *addrlen, const ACE_Accept_QoS_Params &qos_params)
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_Export int connect (ACE_HANDLE handle, const sockaddr *addr, int addrlen, const ACE_QoS_Params &qos_params)
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_Export 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.
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_Export int socket_init (int version_high=1, int version_low=1)
ACE_Export int socket_fini (void)
 Finalize WinSock after last use (e.g., when a DLL is unloaded).
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)
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_Export int cond_init (ACE_cond_t *cv, short type=ACE_DEFAULT_SYNCH_TYPE, const char *name=0, void *arg=0)
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 *timeout)
ACE_NAMESPACE_INLINE_FUNCTION int cond_wait (ACE_cond_t *cv, ACE_mutex_t *m)
ACE_Export int event_destroy (ACE_event_t *event)
ACE_Export int event_init (ACE_event_t *event, int manual_reset=0, int initial_state=0, int type=ACE_DEFAULT_SYNCH_TYPE, const char *name=0, void *arg=0, LPSECURITY_ATTRIBUTES sa=0)
ACE_Export int event_pulse (ACE_event_t *event)
ACE_Export int event_reset (ACE_event_t *event)
ACE_Export int event_signal (ACE_event_t *event)
ACE_Export int event_timedwait (ACE_event_t *event, ACE_Time_Value *timeout, int use_absolute_time=1)
ACE_Export int event_wait (ACE_event_t *event)
ACE_Export int mutex_destroy (ACE_mutex_t *m)
ACE_Export int mutex_init (ACE_mutex_t *m, int lock_scope=ACE_DEFAULT_SYNCH_TYPE, const char *name=0, ACE_mutexattr_t *arg=0, LPSECURITY_ATTRIBUTES sa=0, int lock_type=0)
ACE_Export int mutex_lock (ACE_mutex_t *m)
ACE_Export int mutex_lock (ACE_mutex_t *m, int &abandoned)
ACE_Export int mutex_lock (ACE_mutex_t *m, const ACE_Time_Value &timeout)
ACE_NAMESPACE_INLINE_FUNCTION int mutex_lock (ACE_mutex_t *m, const ACE_Time_Value *timeout)
ACE_Export void mutex_lock_cleanup (void *mutex)
 Handle asynchronous thread cancellation cleanup.
ACE_Export int mutex_trylock (ACE_mutex_t *m)
ACE_Export int mutex_trylock (ACE_mutex_t *m, int &abandoned)
ACE_Export int mutex_unlock (ACE_mutex_t *m)
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 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)
ACE_Export int rwlock_init (ACE_rwlock_t *rw, int type=ACE_DEFAULT_SYNCH_TYPE, const ACE_TCHAR *name=0, void *arg=0)
ACE_Export int sched_params (const ACE_Sched_Params &, ACE_id_t id=ACE_SELF)
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_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_Export struct tmlocaltime_r (const time_t *clock, struct tm *res)
ACE_Export time_t mktime (struct tm *timeptr)
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)
ACE_NAMESPACE_INLINE_FUNCTION pid_t fork (void)
ACE_Export pid_t fork (const ACE_TCHAR *program_name)
ACE_Export pid_t fork_exec (ACE_TCHAR *argv[])

Detailed Description

This namespace defines an OS independent programming API that shields developers from nonportable aspects of writing efficient system programs on Win32, POSIX and other versions of UNIX, and various real-time operating systems.

This class is a wrapper for the XTI/TLI operations.

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 Documentation

typedef ACE_WCHAR_T ACE_OS::WChar

Definition at line 45 of file OS_NS_wchar.h.


Enumeration Type Documentation

Enumerator:
ACE_HRTIMER_START 
ACE_HRTIMER_INCR 
ACE_HRTIMER_STOP 
ACE_HRTIMER_GETTIME 

Definition at line 159 of file OS_NS_time.h.

00160     {
00161       ACE_HRTIMER_START = 0x0,  // Only use these if you can stand
00162       ACE_HRTIMER_INCR = 0x1,   // for interrupts to be disabled during
00163       ACE_HRTIMER_STOP = 0x2,   // the timed interval!!!!
00164       ACE_HRTIMER_GETTIME = 0xFFFF
00165     };


Function Documentation

void ACE_OS::_exit ( int  status = 0  ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 23 of file OS_NS_stdlib.inl.

00024 {
00025   ACE_OS_TRACE ("ACE_OS::_exit");
00026 #if defined (ACE_VXWORKS)
00027   ::exit (status);
00028 #elif !defined (ACE_HAS_WINCE)
00029   ::_exit (status);
00030 #else
00031   ::TerminateProcess (::GetCurrentProcess (), status);
00032 #endif /* ACE_VXWORKS */
00033 }

void ACE_OS::abort ( void   ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 36 of file OS_NS_stdlib.inl.

00037 {
00038 #if !defined (ACE_HAS_WINCE)
00039   ::abort ();
00040 #else
00041   // @@ CE doesn't support abort?
00042   exit (1);
00043 #endif /* !ACE_HAS_WINCE */
00044 }

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 18 of file OS_NS_sys_socket.cpp.

00022 {
00023 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00024   ACE_SOCKCALL_RETURN (::WSAAccept ((ACE_SOCKET) handle,
00025                                     addr,
00026                                     (ACE_SOCKET_LEN *) addrlen,
00027                                     (LPCONDITIONPROC) qos_params.qos_condition_callback (),
00028                                     qos_params.callback_data ()),
00029                        ACE_HANDLE,
00030                        ACE_INVALID_HANDLE);
00031 # else
00032   ACE_UNUSED_ARG (qos_params);
00033   return ACE_OS::accept (handle,
00034                          addr,
00035                          addrlen);
00036 # endif /* ACE_HAS_WINSOCK2 */
00037 }

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.

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 }

int ACE_OS::access ( const char *  path,
int  amode 
)

Definition at line 37 of file OS_NS_unistd.inl.

00038 {
00039   ACE_OS_TRACE ("ACE_OS::access");
00040 #if defined (ACE_LACKS_ACCESS)
00041 #  if defined (ACE_HAS_ACCESS_EMULATION)
00042   // @@ WINCE: There should be a Win32 API that can do this.
00043   // Hard coded read access here.
00044   ACE_UNUSED_ARG (amode);
00045   FILE* handle = ACE_OS::fopen (ACE_TEXT_CHAR_TO_TCHAR(path),
00046                                 ACE_TEXT ("r"));
00047   if (handle != 0)
00048     {
00049       ACE_OS::fclose (handle);
00050       return 0;
00051     }
00052   return -1;
00053 #  else
00054     ACE_UNUSED_ARG (path);
00055     ACE_UNUSED_ARG (amode);
00056     ACE_NOTSUP_RETURN (-1);
00057 #  endif  /* ACE_HAS_ACCESS_EMULATION */
00058 #elif defined(ACE_WIN32)
00059   // Windows doesn't support checking X_OK(6)
00060   ACE_OSCALL_RETURN (::access (path, amode & 6), int, -1);
00061 #else
00062   ACE_OSCALL_RETURN (::access (path, amode), int, -1);
00063 #endif /* ACE_LACKS_ACCESS */
00064 }

int ACE_OS::ace_isalnum ( ACE_TCHAR  c  ) 

Returns true if the character is an alphanumeric character.

Definition at line 16 of file OS_NS_ctype.inl.

00017 {
00018 #if defined (ACE_USES_WCHAR)
00019 # if defined (_MSC_VER)
00020   // For MSVC 7.x, we need to prevent "illegal" character getting into
00021   // isalnum, otherwise, it will crash the program.
00022   return c > 0 && c < 0xFF && iswalnum (c);
00023 # else
00024   return iswalnum (c);
00025 # endif /* _MSC_VER */
00026 #else /* ACE_USES_WCHAR */
00027   return isalnum ((unsigned char) c);
00028 #endif /* ACE_USES_WCHAR */
00029 }

int ACE_OS::ace_isalpha ( ACE_TCHAR  c  ) 

Returns true if the character is an alphabetic character.

Definition at line 73 of file OS_NS_ctype.inl.

00074 {
00075 #if defined (ACE_USES_WCHAR)
00076   return iswalpha (c);
00077 #else /* ACE_USES_WCHAR */
00078   return isalpha ((unsigned char) c);
00079 #endif /* ACE_USES_WCHAR */
00080 }

int ACE_OS::ace_isascii ( ACE_TCHAR  c  ) 

Returns true if the character is a control character.

Definition at line 32 of file OS_NS_ctype.inl.

00033 {
00034 #if defined (ACE_USES_WCHAR)
00035 # if defined (ACE_LACKS_ISWASCII)
00036   if (c < 256)
00037     return isascii (static_cast<int> (c));
00038   else
00039     return c;
00040 # else
00041   return iswascii (c);
00042 # endif
00043 #else /* ACE_USES_WCHAR */
00044 # if defined (ACE_LACKS_ISASCII)
00045   return (static_cast<unsigned char>(c) <= 0x7F);
00046 #else
00047   return isascii ((unsigned char) c);
00048 #endif /* ACE_LACKS_ISASCII */
00049 #endif /* ACE_USES_WCHAR */
00050 }

int ACE_OS::ace_isblank ( ACE_TCHAR  c  ) 

Returns true if the character is a control character.

Definition at line 53 of file OS_NS_ctype.inl.

00054 {
00055 #if defined (ACE_USES_WCHAR)
00056 # if defined (ACE_LACKS_ISWBLANK)
00057 #  if !defined (ACE_LACKS_ISWCTYPE)
00058   return ace_iswctype (c, _BLANK);
00059 #  else
00060   return (c == 0x9) || (c == 0x20);
00061 #  endif /* !ACE_LACKS_ISWCTYPE */
00062 # else
00063    return iswblank (c);
00064 # endif /* ACE_LACKS_ISWBLANK */
00065 #elif defined (ACE_LACKS_ISBLANK)
00066   return (c == 0x9) || (c == 0x20);
00067 #else /* ACE_USES_WCHAR */
00068   return isblank ((unsigned char) c);
00069 #endif /* ACE_USES_WCHAR */
00070 }

int ACE_OS::ace_iscntrl ( ACE_TCHAR  c  ) 

Returns true if the character is a control character.

Definition at line 83 of file OS_NS_ctype.inl.

00084 {
00085 #if defined (ACE_USES_WCHAR)
00086   return iswcntrl (c);
00087 #else /* ACE_USES_WCHAR */
00088   return iscntrl ((unsigned char) c);
00089 #endif /* ACE_USES_WCHAR */
00090 }

int ACE_OS::ace_isctype ( int  c,
ctype_t  desc 
)

Tests c for the property specified by the desc argument.

Definition at line 218 of file OS_NS_ctype.inl.

00219 {
00220 #if defined (ACE_ISCTYPE_EQUIVALENT)
00221   return ACE_ISCTYPE_EQUIVALENT (c, desc);
00222 #elif !defined (ACE_LACKS_ISCTYPE)
00223   return isctype (c, desc);
00224 #else
00225   ACE_UNUSED_ARG (c);
00226   ACE_UNUSED_ARG (desc);
00227   ACE_NOTSUP_RETURN (-1);
00228 #endif
00229 }

int ACE_OS::ace_isdigit ( ACE_TCHAR  c  ) 

Returns true if the character is a decimal-digit character.

Definition at line 93 of file OS_NS_ctype.inl.

00094 {
00095 #if defined (ACE_USES_WCHAR)
00096   return iswdigit (c);
00097 #else /* ACE_USES_WCHAR */
00098   return isdigit ((unsigned char) c);
00099 #endif /* ACE_USES_WCHAR */
00100 }

int ACE_OS::ace_isgraph ( ACE_TCHAR  c  ) 

Returns true if the character is a printable character other than a space.

Definition at line 103 of file OS_NS_ctype.inl.

00104 {
00105 #if defined (ACE_USES_WCHAR)
00106   return iswgraph (c);
00107 #else /* ACE_USES_WCHAR */
00108   return isgraph ((unsigned char) c);
00109 #endif /* ACE_USES_WCHAR */
00110 }

int ACE_OS::ace_islower ( ACE_TCHAR  c  ) 

Returns true if the character is a lowercase character.

Definition at line 113 of file OS_NS_ctype.inl.

00114 {
00115 #if defined (ACE_USES_WCHAR)
00116   return iswlower (c);
00117 #else /* ACE_USES_WCHAR */
00118   return islower ((unsigned char) c);
00119 #endif /* ACE_USES_WCHAR */
00120 }

int ACE_OS::ace_isprint ( ACE_TCHAR  c  ) 

Returns true if the character is a printable character.

Definition at line 123 of file OS_NS_ctype.inl.

00124 {
00125 #if defined (ACE_USES_WCHAR)
00126 # if defined (ACE_LACKS_CORRECT_ISWPRINT_TAB)
00127   /* The MS CRT has the bug that for tab (\t) iswprint returns true instead of
00128    * false.  This has been reported to Microsoft:
00129    * https://connect.microsoft.com/VisualStudio/feedback ID# 381915
00130    */
00131   if (c == 0x9)
00132     {
00133       return 0;
00134     }
00135 # endif
00136   return iswprint (c);
00137 #else /* ACE_USES_WCHAR */
00138   return isprint ((unsigned char) c);
00139 #endif /* ACE_USES_WCHAR */
00140 }

int ACE_OS::ace_ispunct ( ACE_TCHAR  c  ) 

Returns true if the character is a punctuation character.

Definition at line 143 of file OS_NS_ctype.inl.

00144 {
00145 #if defined (ACE_USES_WCHAR)
00146   return iswpunct (c);
00147 #else /* ACE_USES_WCHAR */
00148   return ispunct ((unsigned char) c);
00149 #endif /* ACE_USES_WCHAR */
00150 }

int ACE_OS::ace_isspace ( ACE_TCHAR  c  ) 

Returns true if the character is a space character.

Definition at line 153 of file OS_NS_ctype.inl.

00154 {
00155 #if defined (ACE_USES_WCHAR)
00156   return iswspace (c);
00157 #else /* ACE_USES_WCHAR */
00158   return isspace ((unsigned char) c);
00159 #endif /* ACE_USES_WCHAR */
00160 }

int ACE_OS::ace_isupper ( ACE_TCHAR  c  ) 

Returns true if the character is an uppercase character.

Definition at line 163 of file OS_NS_ctype.inl.

00164 {
00165 #if defined (ACE_USES_WCHAR)
00166   return iswupper (c);
00167 #else /* ACE_USES_WCHAR */
00168   return isupper ((unsigned char) c);
00169 #endif /* ACE_USES_WCHAR */
00170 }

int ACE_OS::ace_isxdigit ( ACE_TCHAR  c  ) 

Returns true if the character is a hexadecimal-digit character.

Definition at line 173 of file OS_NS_ctype.inl.

00174 {
00175 #if defined (ACE_USES_WCHAR)
00176   return iswxdigit (c);
00177 #else /* ACE_USES_WCHAR */
00178   return isxdigit ((unsigned char) c);
00179 #endif /* ACE_USES_WCHAR */
00180 }

int ACE_OS::ace_tolower ( int  c  ) 

Converts a character to lower case (char version).

Definition at line 183 of file OS_NS_ctype.inl.

00184 {
00185   return tolower (c);
00186 }

int ACE_OS::ace_toupper ( int  c  ) 

Converts a character to upper case (char version).

Definition at line 204 of file OS_NS_ctype.inl.

00205 {
00206   return toupper (c);
00207 }

u_int ACE_OS::alarm ( u_int  secs  ) 

Definition at line 80 of file OS_NS_unistd.inl.

00081 {
00082   ACE_OS_TRACE ("ACE_OS::alarm");
00083 #if defined (ACE_LACKS_ALARM)
00084   ACE_UNUSED_ARG (secs);
00085   ACE_NOTSUP_RETURN (0);
00086 #else
00087   return ::alarm (secs);
00088 #endif /* ACE_LACKS_ALARM */
00089 }

long ACE_OS::allocation_granularity ( void   ) 

Definition at line 110 of file OS_NS_unistd.inl.

00111 {
00112 #if defined (ACE_WIN32)
00113   SYSTEM_INFO sys_info;
00114   ::GetSystemInfo (&sys_info);
00115   return sys_info.dwAllocationGranularity;
00116 #else
00117   return ACE_OS::getpagesize ();
00118 #endif /* ACE_WIN32 */
00119 }

int ACE_OS::alphasort ( const void *  a,
const void *  b 
)

Definition at line 142 of file OS_NS_dirent.inl.

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 }

int ACE_OS::argv_to_string ( ACE_TCHAR **  argv,
ACE_TCHAR *&  buf,
bool  substitute_env_args = true,
bool  quote_args = false 
)

Definition at line 46 of file OS_NS_unistd.cpp.

00050 {
00051   if (argv == 0 || argv[0] == 0)
00052     return 0;
00053 
00054   int argc;
00055   for (argc = 0; argv[argc] != 0; ++argc)
00056     continue;
00057 
00058   return argv_to_string (argc,
00059                          argv,
00060                          buf,
00061                          substitute_env_args,
00062                          quote_args);
00063 }

int ACE_OS::argv_to_string ( int  argc,
ACE_TCHAR **  argv,
ACE_TCHAR *&  buf,
bool  substitute_env_args = true,
bool  quote_args = false 
)

used by ARGV::argv_to_string() and ACE_OS::fork_exec()

Definition at line 66 of file OS_NS_unistd.cpp.

00071 {
00072 #if defined (ACE_LACKS_STRENVDUP)
00073   ACE_UNUSED_ARG (substitute_env_args);
00074 #endif /* ACE_LACKS_STRENVDUP */
00075 
00076   if (argc <= 0 || argv == 0 || argv[0] == 0)
00077     return 0;
00078 
00079   size_t buf_len = 0;
00080 
00081   // Determine the length of the buffer.
00082 
00083   ACE_TCHAR **argv_p = argv;
00084 
00085   for (int i = 0; i < argc; ++i)
00086     {
00087 #if !defined (ACE_LACKS_STRENVDUP)
00088       // Account for environment variables.
00089       if (substitute_env_args
00090           && ACE_OS::strchr (argv[i], ACE_TEXT ('$')) != 0)
00091         {
00092           if (argv_p == argv)
00093             {
00094               argv_p = (ACE_TCHAR **) ACE_OS::malloc (argc * sizeof (ACE_TCHAR *));
00095               if (argv_p == 0)
00096                 {
00097                   errno = ENOMEM;
00098                   return 0;
00099                 }
00100               ACE_OS::memcpy (argv_p, argv, argc * sizeof (ACE_TCHAR *));
00101             }
00102           argv_p[i] = ACE_OS::strenvdup (argv[i]);
00103           if (argv_p[i] == 0)
00104             {
00105               ACE_OS::free (argv_p);
00106               errno = ENOMEM;
00107               return 0;
00108             }
00109         }
00110 #endif /* ACE_LACKS_STRENVDUP */
00111       // If must quote, we only do it if the arg contains spaces, or
00112       // is empty. Perhaps a check for other c | ord(c) <= 32 is in
00113       // order?
00114       if (quote_args
00115           && (ACE_OS::strchr (argv_p[i], ACE_TEXT (' ')) != 0
00116               || ACE_OS::strchr (argv_p[i], ACE_TEXT ('\t')) != 0
00117               || ACE_OS::strchr (argv_p[i], ACE_TEXT ('\n')) != 0
00118               || *argv_p[i] == 0))
00119         {
00120           if (argv_p == argv)
00121             {
00122               argv_p = (ACE_TCHAR **) ACE_OS::malloc (argc * sizeof (ACE_TCHAR *));
00123               if (argv_p == 0)
00124                 {
00125                   errno = ENOMEM;
00126                   return 0;
00127                 }
00128               ACE_OS::memcpy (argv_p, argv, argc * sizeof (ACE_TCHAR *));
00129             }
00130           int quotes = 0;
00131           ACE_TCHAR *temp = argv_p[i];
00132           if (ACE_OS::strchr (temp, ACE_TEXT ('"')) != 0)
00133             {
00134               for (int j = 0; temp[j] != 0; ++j)
00135                 if (temp[j] == ACE_TEXT ('"'))
00136                   ++quotes;
00137             }
00138           argv_p[i] =
00139             (ACE_TCHAR *) ACE_OS::malloc ((ACE_OS::strlen (temp) + quotes + 3)
00140                                           * sizeof (ACE_TCHAR));
00141           if (argv_p[i] == 0)
00142             {
00143               ACE_OS::free (argv_p);
00144               errno = ENOMEM;
00145               return 0;
00146             }
00147           ACE_TCHAR *end = argv_p[i];
00148 
00149           *end++ = ACE_TEXT ('"');
00150 
00151           if (quotes > 0)
00152             {
00153               for (ACE_TCHAR *p = temp;
00154                    *p != 0;
00155                    *end++ = *p++)
00156                 if (*p == ACE_TEXT ('"'))
00157                   *end++ = ACE_TEXT ('\\');
00158 
00159               *end++ = ACE_TEXT ('\0');
00160             }
00161           else
00162             end = ACE_OS::strecpy (end, temp);
00163 
00164           end[-1] = ACE_TEXT ('"');
00165 
00166           *end = ACE_TEXT ('\0');
00167           if (temp != argv[i])
00168             ACE_OS::free (temp);
00169         }
00170       buf_len += ACE_OS::strlen (argv_p[i]);
00171 
00172       // Add one for the extra space between each string.
00173       buf_len++;
00174     }
00175 
00176   // Step through all argv params and copy each one into buf; separate
00177   // each param with white space.
00178 
00179   ACE_NEW_RETURN (buf,
00180                   ACE_TCHAR[buf_len + 1],
00181                   0);
00182 
00183   // Initial null charater to make it a null string.
00184   buf[0] = ACE_TEXT ('\0');
00185   ACE_TCHAR *end = buf;
00186 
00187   for (int i = 0; i < argc; ++i)
00188     {
00189       end = ACE_OS::strecpy (end, argv_p[i]);
00190       if (argv_p[i] != argv[i])
00191         ACE_OS::free (argv_p[i]);
00192 
00193       // Replace the null char that strecpy put there with white
00194       // space.
00195       end[-1] = ACE_TEXT (' ');
00196     }
00197   // Null terminate the string.
00198   *end = ACE_TEXT ('\0');
00199 
00200   if (argv_p != argv)
00201     ACE_OS::free (argv_p);
00202 
00203   // The number of arguments.
00204   return argc;
00205 }

char * ACE_OS::asctime ( const struct tm tm  ) 

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 14 of file OS_NS_time.inl.

00015 {
00016   ACE_OS_TRACE ("ACE_OS::asctime");
00017 #if defined (ACE_LACKS_ASCTIME)
00018   ACE_UNUSED_ARG (t);
00019   ACE_NOTSUP_RETURN (0);
00020 #else
00021   ACE_OSCALL_RETURN (ACE_STD_NAMESPACE::asctime (t), char *, 0);
00022 #endif /* ACE_LACKS_ASCTIME */
00023 }

char * ACE_OS::asctime_r ( const struct tm tm,
char *  buf,
int  buflen 
)

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 26 of file OS_NS_time.inl.

00027 {
00028   ACE_OS_TRACE ("ACE_OS::asctime_r");
00029 #if defined (ACE_HAS_REENTRANT_FUNCTIONS)
00030 # if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R)
00031   char *result;
00032 #   if defined (DIGITAL_UNIX)
00033   ACE_OSCALL (::_Pasctime_r (t, buf), char *, 0, result);
00034 #   else
00035   ACE_OSCALL (::asctime_r (t, buf), char *, 0, result);
00036 #   endif /* DIGITAL_UNIX */
00037   ACE_OS::strsncpy (buf, result, buflen);
00038   return buf;
00039 # else
00040 #   if defined (ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R)
00041   ACE_OSCALL_RETURN (::asctime_r (t, buf, reinterpret_cast<size_t*>(&buflen)), char *, 0);
00042 #   else
00043   ACE_OSCALL_RETURN (::asctime_r (t, buf, buflen), char *, 0);
00044 #   endif /* ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R */
00045 # endif /* ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R */
00046 #elif defined (ACE_LACKS_ASCTIME_R)
00047   ACE_UNUSED_ARG (t);
00048   ACE_UNUSED_ARG (buf);
00049   ACE_UNUSED_ARG (buflen);
00050   ACE_NOTSUP_RETURN (0);
00051 #elif defined (ACE_HAS_TR24731_2005_CRT)
00052   char *result = buf;
00053   ACE_SECURECRTCALL (asctime_s (buf, static_cast<size_t> (buflen), t), \
00054                      char*, 0, result);
00055   return result;
00056 #else
00057   char *result = 0;
00058   ACE_OSCALL (ACE_STD_NAMESPACE::asctime (t), char *, 0, result);
00059   ACE_OS::strsncpy (buf, result, buflen);
00060   return buf;
00061 #endif /* ACE_HAS_REENTRANT_FUNCTIONS */
00062 }

int ACE_OS::asprintf ( char **  bufp,
const char *  format,
  ... 
)

Definition at line 272 of file OS_NS_stdio.cpp.

00273 {
00274   // ACE_OS_TRACE ("ACE_OS::asprintf");
00275   va_list ap;
00276   va_start (ap, format);
00277   int const result = ACE_OS::vasprintf (bufp, format, ap);
00278   va_end (ap);
00279   return result;
00280 }

int ACE_OS::atexit ( ACE_EXIT_HOOK  func,
const char *  name = 0 
)

Register an at exit hook. The name can be used to analyze shutdown problems

Definition at line 47 of file OS_NS_stdlib.inl.

00048 {
00049   return ACE_OS_Object_Manager::instance ()->at_exit (func, name);
00050 }

double ACE_OS::atof ( const char *  s  ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 89 of file OS_NS_stdlib.inl.

00090 {
00091   ACE_OSCALL_RETURN (::atof (s), double, -1);
00092 }

int ACE_OS::atoi ( const char *  s  ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 53 of file OS_NS_stdlib.inl.

00054 {
00055   ACE_OSCALL_RETURN (::atoi (s), int, -1);
00056 }

long ACE_OS::atol ( const char *  s  ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 71 of file OS_NS_stdlib.inl.

00072 {
00073   ACE_OSCALL_RETURN (::atol (s), long, -1);
00074 }

void * ACE_OS::atop ( const char *  s  ) 

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 109 of file OS_NS_stdlib.inl.

00110 {
00111   ACE_TRACE ("ACE_OS::atop");
00112 #if defined (ACE_WIN64)
00113   intptr_t ip = ::_atoi64 (s);
00114 #elif defined (ACE_OPENVMS)
00115 #  if !defined (__INITIAL_POINTER_SIZE) || (__INITIAL_POINTER_SIZE < 64)
00116   int ip = ::atoi (s);
00117 #  else
00118   intptr_t ip = ::atoi (s);
00119 #  endif
00120 #else
00121   intptr_t ip = ::atoi (s);
00122 #endif /* ACE_WIN64 */
00123   void * p = reinterpret_cast<void *> (ip);
00124   return p;
00125 }

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.

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 }

void * ACE_OS::bsearch ( const void *  key,
const void *  base,
size_t  nel,
size_t  size,
ACE_COMPARE_FUNC  compar 
)

Function that is called by <ACE_OS::exit>, if non-null.

Definition at line 148 of file OS_NS_stdlib.inl.

00153 {
00154 #if !defined (ACE_LACKS_BSEARCH)
00155   return ::bsearch (key, base, nel, size, compar);
00156 #else
00157   ACE_UNUSED_ARG (key);
00158   ACE_UNUSED_ARG (base);
00159   ACE_UNUSED_ARG (nel);
00160   ACE_UNUSED_ARG (size);
00161   ACE_UNUSED_ARG (compar);
00162   ACE_NOTSUP_RETURN (0);
00163 #endif /* ACE_LACKS_BSEARCH */
00164 }

ACE_Export void* ACE_OS::calloc ( size_t  elements,
size_t  sizeof_elements 
)

Function that is called by <ACE_OS::exit>, if non-null.

double ACE_OS::ceil ( double  x  ) 

This method computes the smallest integral value not less than x.

Definition at line 26 of file OS_NS_math.inl.

00027   {
00028 #if defined (ACE_LACKS_CEIL)
00029     // This method computes the smallest integral value not less than x.
00030     if (x < 0)
00031       return static_cast<long> (x);
00032     else if ((static_cast<long> (x) < x) || (static_cast<long> (x) > x))
00033       return static_cast<long> (x) + 1;
00034     else
00035       return x;
00036 #else
00037     return ::ceil (x);
00038 #endif
00039   }

int ACE_OS::chdir ( const char *  path  ) 

Definition at line 122 of file OS_NS_unistd.inl.

00123 {
00124   ACE_OS_TRACE ("ACE_OS::chdir");
00125 #if defined (ACE_LACKS_CHDIR)
00126   ACE_UNUSED_ARG (path);
00127   ACE_NOTSUP_RETURN (-1);
00128 #elif defined (ACE_HAS_NONCONST_CHDIR)
00129   ACE_OSCALL_RETURN (::chdir (const_cast<char *> (path)), int, -1);
00130 #else
00131   ACE_OSCALL_RETURN (::chdir (path), int, -1);
00132 #endif /* ACE_HAS_NONCONST_CHDIR */
00133 }

void ACE_OS::cleanup_tss ( const u_int  main_thread  ) 

Call TSS destructors for the current thread. If the current thread is the main thread, then the argument must be 1. For private use of ACE_Object_Manager and ACE_Thread_Adapter only.

Definition at line 1098 of file OS_NS_Thread.cpp.

01099 {
01100 #if defined (ACE_HAS_TSS_EMULATION) || defined (ACE_WIN32)
01101   { // scope the cleanup instance
01102     // Call TSS destructors for current thread.
01103     TSS_Cleanup_Instance cleanup;
01104     if (cleanup.valid ())
01105       {
01106         cleanup->thread_exit ();
01107       }
01108   }
01109 #endif /* ACE_HAS_TSS_EMULATION || ACE_WIN32 */
01110 
01111   if (main_thread)
01112     {
01113 #if !defined (ACE_HAS_TSS_EMULATION)  &&  !defined (ACE_HAS_MINIMAL_ACE_OS)
01114       // Just close the ACE_Log_Msg for the current (which should be
01115       // main) thread.  We don't have TSS emulation; if there's native
01116       // TSS, it should call its destructors when the main thread
01117       // exits.
01118       ACE_Base_Thread_Adapter::close_log_msg ();
01119 #endif /* ! ACE_HAS_TSS_EMULATION  &&  ! ACE_HAS_MINIMAL_ACE_OS */
01120 
01121 #if defined (ACE_WIN32) || defined (ACE_HAS_TSS_EMULATION)
01122       // Finally, free up the ACE_TSS_Cleanup instance.  This method gets
01123       // called by the ACE_Object_Manager.
01124       TSS_Cleanup_Instance cleanup(TSS_Cleanup_Instance::DESTROY);
01125       if (cleanup.valid ())
01126       {
01127         ; // the pointer deletes the Cleanup when it goes out of scope
01128       }
01129 
01130 #endif /* WIN32 || ACE_HAS_TSS_EMULATION */
01131 
01132 #if defined (ACE_HAS_TSS_EMULATION)
01133       ACE_TSS_Emulation::tss_close ();
01134 #endif /* ACE_HAS_TSS_EMULATION */
01135     }
01136 }

void ACE_OS::clearerr ( FILE *  fp  ) 

Definition at line 344 of file OS_NS_stdio.inl.

00345 {
00346   ace_clearerr_helper (fp);
00347 }

int ACE_OS::clock_gettime ( clockid_t  clockid,
struct timespec ts 
)

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 65 of file OS_NS_time.inl.

00066 {
00067   ACE_OS_TRACE ("ACE_OS::clock_gettime");
00068 #if defined (ACE_HAS_CLOCK_GETTIME)
00069   ACE_OSCALL_RETURN (::clock_gettime (clockid, ts), int, -1);
00070 #else
00071   ACE_UNUSED_ARG (clockid);
00072   ACE_UNUSED_ARG (ts);
00073   ACE_NOTSUP_RETURN (-1);
00074 #endif /* ACE_HAS_CLOCK_GETTIME */
00075 }

int ACE_OS::clock_settime ( clockid_t  clockid,
const struct timespec ts 
)

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 78 of file OS_NS_time.inl.

00079 {
00080 #if defined (ACE_HAS_CLOCK_SETTIME)
00081 #  if defined (ACE_HAS_NONCONST_CLOCK_SETTIME)
00082   ACE_OSCALL_RETURN (::clock_settime (clockid, const_cast<struct timespec *>(ts)), int, -1);
00083 #  else
00084   ACE_OSCALL_RETURN (::clock_settime (clockid, ts), int, -1);
00085 #  endif /* ACE_HAS_NONCONST_CLOCK_SETTIME */
00086 #else
00087   ACE_UNUSED_ARG (clockid);
00088   ACE_UNUSED_ARG (ts);
00089   ACE_NOTSUP_RETURN (-1);
00090 #endif /* ACE_HAS_CLOCK_SETTIME */
00091 }

int ACE_OS::close ( ACE_HANDLE  handle  ) 

Definition at line 184 of file OS_NS_unistd.inl.

00185 {
00186   ACE_OS_TRACE ("ACE_OS::close");
00187 #if defined (ACE_WIN32)
00188   ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CloseHandle (handle), ace_result_), int, -1);
00189 #else
00190   ACE_OSCALL_RETURN (::close (handle), int, -1);
00191 #endif /* ACE_WIN32 */
00192 }

void ACE_OS::closedir ( ACE_DIR d  ) 

Definition at line 17 of file OS_NS_dirent.inl.

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 }

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.

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 }

char * ACE_OS::compile ( const char *  instring,
char *  expbuf,
char *  endbuf 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 11 of file OS_NS_regex.inl.

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 }

int ACE_OS::cond_broadcast ( ACE_cond_t cv  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 186 of file OS_NS_Thread.inl.

00187 {
00188   ACE_OS_TRACE ("ACE_OS::cond_broadcast");
00189 # if defined (ACE_HAS_THREADS)
00190 #   if defined (ACE_HAS_PTHREADS)
00191   int result;
00192   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_cond_broadcast (cv),
00193                                        result),
00194                      int, -1);
00195 #   elif defined (ACE_HAS_STHREADS)
00196   int result;
00197   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_broadcast (cv),
00198                                        result),
00199                      int, -1);
00200 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00201   ::WakeAllConditionVariable  (cv);
00202   return 0;
00203 #   endif /* ACE_HAS_STHREADS */
00204 # else
00205   ACE_UNUSED_ARG (cv);
00206   ACE_NOTSUP_RETURN (-1);
00207 # endif /* ACE_HAS_THREADS */
00208 }

int ACE_OS::cond_destroy ( ACE_cond_t cv  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 211 of file OS_NS_Thread.inl.

00212 {
00213   ACE_OS_TRACE ("ACE_OS::cond_destroy");
00214 # if defined (ACE_HAS_THREADS)
00215 #   if defined (ACE_HAS_PTHREADS)
00216   int result;
00217   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_cond_destroy (cv), result), int, -1);
00218 #   elif defined (ACE_HAS_STHREADS)
00219   int result;
00220   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_destroy (cv), result), int, -1);
00221 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00222   // Windows doesn't have a destroy
00223   return 0;
00224 #   endif /* ACE_HAS_STHREADS */
00225 # else
00226   ACE_UNUSED_ARG (cv);
00227   ACE_NOTSUP_RETURN (-1);
00228 # endif /* ACE_HAS_THREADS */
00229 }

int ACE_OS::cond_init ( ACE_cond_t cv,
ACE_condattr_t attributes,
const char *  name = 0,
void *  arg = 0 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 232 of file OS_NS_Thread.inl.

00236 {
00237   // ACE_OS_TRACE ("ACE_OS::cond_init");
00238   ACE_UNUSED_ARG (name);
00239   ACE_UNUSED_ARG (arg);
00240 # if defined (ACE_HAS_THREADS)
00241 #   if defined (ACE_HAS_PTHREADS)
00242   int result = -1;
00243 
00244 #     if defined (ACE_PTHREAD_COND_T_INITIALIZE)
00245   /* VxWorks 6.x API reference states:
00246    *   If the memory for the condition variable object has been allocated
00247    *   dynamically, it is a good policy to always zero out the
00248    *   block of memory so as to avoid spurious EBUSY return code
00249    *   when calling this routine.
00250    */
00251   ACE_OS::memset (cv, 0, sizeof (*cv));
00252 #     endif
00253 
00254   if (ACE_ADAPT_RETVAL (pthread_cond_init (cv, &attributes), result) == 0)
00255      result = 0;
00256   else
00257      result = -1;       // ACE_ADAPT_RETVAL used it for intermediate status
00258 
00259   return result;
00260 #   elif defined (ACE_HAS_STHREADS)
00261   int result;
00262   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_init (cv,
00263                                                     attributes.type,
00264                                                     arg),
00265                                        result),
00266                      int, -1);
00267 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00268     ::InitializeConditionVariable (cv);
00269     return 0;
00270 #   endif /* ACE_HAS_PTHREADS vs. ACE_HAS_STHREADS */
00271 # else
00272   ACE_UNUSED_ARG (cv);
00273   ACE_UNUSED_ARG (attributes);
00274   ACE_UNUSED_ARG (name);
00275   ACE_UNUSED_ARG (arg);
00276   ACE_NOTSUP_RETURN (-1);
00277 # endif /* ACE_HAS_THREADS */
00278 }

int ACE_OS::cond_init ( ACE_cond_t cv,
short  type = ACE_DEFAULT_SYNCH_TYPE,
const char *  name = 0,
void *  arg = 0 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 1567 of file OS_NS_Thread.cpp.

01568 {
01569   ACE_condattr_t attributes;
01570   if (ACE_OS::condattr_init (attributes, type) == 0
01571       && ACE_OS::cond_init (cv, attributes, name, arg) == 0)
01572     {
01573       (void) ACE_OS::condattr_destroy (attributes);
01574       return 0;
01575     }
01576   return -1;
01577 }

int ACE_OS::cond_signal ( ACE_cond_t cv  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 300 of file OS_NS_Thread.inl.

00301 {
00302   ACE_OS_TRACE ("ACE_OS::cond_signal");
00303 # if defined (ACE_HAS_THREADS)
00304 #   if defined (ACE_HAS_PTHREADS)
00305   int result;
00306   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_cond_signal (cv), result),
00307                      int, -1);
00308 #   elif defined (ACE_HAS_STHREADS)
00309   int result;
00310   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_signal (cv), result), int, -1);
00311 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00312   ::WakeConditionVariable (cv);
00313   return 0;
00314 #   endif /* ACE_HAS_STHREADS */
00315 # else
00316   ACE_UNUSED_ARG (cv);
00317   ACE_NOTSUP_RETURN (-1);
00318 # endif /* ACE_HAS_THREADS */
00319 }

int ACE_OS::cond_timedwait ( ACE_cond_t cv,
ACE_mutex_t m,
ACE_Time_Value timeout 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 348 of file OS_NS_Thread.inl.

00351 {
00352   ACE_OS_TRACE ("ACE_OS::cond_timedwait");
00353 # if defined (ACE_HAS_THREADS)
00354   int result = 0;
00355   timespec_t ts;
00356 
00357   if (timeout != 0)
00358     ts = *timeout; // Calls ACE_Time_Value::operator timespec_t().
00359 
00360 #   if defined (ACE_HAS_PTHREADS)
00361 
00362   ACE_OSCALL (ACE_ADAPT_RETVAL (timeout == 0
00363                                 ? pthread_cond_wait (cv, external_mutex)
00364                                 : pthread_cond_timedwait (cv, external_mutex,
00365                                                             (ACE_TIMESPEC_PTR) &ts),
00366                                 result),
00367               int, -1, result);
00368   // We need to adjust this to make the POSIX and Solaris return
00369   // values consistent.  EAGAIN is from Pthreads DRAFT4 (HP-UX 10.20 and down)
00370   if (result == -1 &&
00371       (errno == ETIMEDOUT || errno == EAGAIN))
00372     errno = ETIME;
00373 
00374 #   elif defined (ACE_HAS_STHREADS)
00375   ACE_OSCALL (ACE_ADAPT_RETVAL (timeout == 0
00376                                 ? ::cond_wait (cv, external_mutex)
00377                                 : ::cond_timedwait (cv,
00378                                                     external_mutex,
00379                                                     (timestruc_t*)&ts),
00380                                 result),
00381               int, -1, result);
00382 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00383   int msec_timeout = 0;
00384   if (timeout != 0)
00385     {
00386       ACE_Time_Value relative_time (*timeout - ACE_OS::gettimeofday ());
00387       // Watchout for situations where a context switch has caused the
00388       // current time to be > the timeout.
00389       if (relative_time > ACE_Time_Value::zero)
00390         msec_timeout = relative_time.msec ();
00391     }
00392 
00393   ACE_OSCALL (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, &external_mutex->thr_mutex_, msec_timeout),
00394                                 result),
00395               int, -1, result);
00396 
00397   return result;
00398 #   endif /* ACE_HAS_STHREADS */
00399   if (timeout != 0)
00400     timeout->set (ts); // Update the time value before returning.
00401 
00402   return result;
00403 # else
00404   ACE_UNUSED_ARG (cv);
00405   ACE_UNUSED_ARG (external_mutex);
00406   ACE_UNUSED_ARG (timeout);
00407   ACE_NOTSUP_RETURN (-1);
00408 # endif /* ACE_HAS_THREADS */
00409 }

int ACE_OS::cond_wait ( ACE_cond_t cv,
ACE_mutex_t m 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 322 of file OS_NS_Thread.inl.

00324 {
00325   ACE_OS_TRACE ("ACE_OS::cond_wait");
00326 # if defined (ACE_HAS_THREADS)
00327 #   if defined (ACE_HAS_PTHREADS)
00328   int result;
00329   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (pthread_cond_wait (cv, external_mutex), result),
00330                      int, -1);
00331 #   elif defined (ACE_HAS_STHREADS)
00332   int result;
00333   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::cond_wait (cv, external_mutex), result),
00334                      int, -1);
00335 #   elif defined (ACE_HAS_WTHREADS) && defined (ACE_HAS_WTHREADS_CONDITION_VARIABLE)
00336   int result;
00337   ACE_OSCALL_RETURN (ACE_ADAPT_RETVAL (::SleepConditionVariableCS (cv, &external_mutex->thr_mutex_, INFINITE), result),
00338                      int, -1);
00339 #   endif /* ACE_HAS_PTHREADS */
00340 # else
00341   ACE_UNUSED_ARG (cv);
00342   ACE_UNUSED_ARG (external_mutex);
00343   ACE_NOTSUP_RETURN (-1);
00344 # endif /* ACE_HAS_THREADS */
00345 }

int ACE_OS::condattr_destroy ( ACE_condattr_t attributes  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 125 of file OS_NS_Thread.inl.

00126 {
00127 #if defined (ACE_HAS_THREADS)
00128 #   if defined (ACE_HAS_PTHREADS)
00129   pthread_condattr_destroy (&attributes);
00130 #   else
00131   attributes.type = 0;
00132 #   endif /* ACE_HAS_PTHREADS */
00133   return 0;
00134 # else
00135   ACE_UNUSED_ARG (attributes);
00136   return 0;
00137 # endif /* ACE_HAS_THREADS  */
00138 }

int ACE_OS::condattr_init ( ACE_condattr_t attributes,
int  type = ACE_DEFAULT_SYNCH_TYPE 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 141 of file OS_NS_Thread.inl.

00142 {
00143   ACE_UNUSED_ARG (type);
00144 # if defined (ACE_HAS_THREADS)
00145 #   if defined (ACE_HAS_PTHREADS)
00146   int result = -1;
00147 
00148 #   if defined (ACE_PTHREAD_CONDATTR_T_INITIALIZE)
00149       /* Tests show that VxWorks 6.x pthread lib does not only
00150        * require zeroing of mutex/condition objects to function correctly
00151        * but also of the attribute objects.
00152        */
00153       ACE_OS::memset (&attributes, 0, sizeof (attributes));
00154 #   endif
00155   if (
00156       ACE_ADAPT_RETVAL (pthread_condattr_init (&attributes), result) == 0
00157 #       if defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)
00158       && ACE_ADAPT_RETVAL (pthread_condattr_setpshared (&attributes, type),
00159                            result) == 0
00160 #       endif /* _POSIX_THREAD_PROCESS_SHARED && ! ACE_LACKS_CONDATTR_PSHARED */
00161       )
00162      result = 0;
00163   else
00164      result = -1;       // ACE_ADAPT_RETVAL used it for intermediate status
00165 
00166   return result;
00167 #   else
00168   attributes.type = type;
00169   return 0;
00170 #   endif /* ACE_HAS_PTHREADS */
00171 
00172 # else
00173   ACE_UNUSED_ARG (attributes);
00174   ACE_UNUSED_ARG (type);
00175   ACE_NOTSUP_RETURN (-1);
00176 # endif /* ACE_HAS_THREADS */
00177 }

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 40 of file OS_NS_sys_socket.cpp.

00044 {
00045   ACE_OS_TRACE ("ACE_OS::connect");
00046 # if defined (ACE_HAS_WINSOCK2) && (ACE_HAS_WINSOCK2 != 0)
00047   ACE_SOCKCALL_RETURN (::WSAConnect ((ACE_SOCKET) handle,
00048                                      (const sockaddr *) addr,
00049                                      (ACE_SOCKET_LEN) addrlen,
00050                                      (WSABUF *) qos_params.caller_data (),
00051                                      (WSABUF *) qos_params.callee_data (),
00052                                      (QOS *) qos_params.socket_qos (),
00053                                      (QOS *) qos_params.group_socket_qos ()),
00054                        int, -1);
00055 # else
00056   ACE_UNUSED_ARG (qos_params);
00057   return ACE_OS::connect (handle,
00058                           const_cast <sockaddr *> (addr),
00059                           addrlen);
00060 # endif /* ACE_HAS_WINSOCK2 */
00061 }

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.

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_HANDLE ACE_OS::creat ( const ACE_TCHAR filename,
mode_t  mode 
)

Definition at line 16 of file OS_NS_sys_stat.inl.

00017   {
00018     ACE_OS_TRACE ("ACE_OS::creat");
00019 #if defined (ACE_WIN32)
00020     return ACE_OS::open (filename, O_CREAT|O_TRUNC|O_WRONLY, mode);
00021 #else
00022     ACE_OSCALL_RETURN (::creat (ACE_TEXT_ALWAYS_CHAR (filename), mode),
00023                        ACE_HANDLE, ACE_INVALID_HANDLE);
00024 #endif /* ACE_WIN32 */
00025   }

ACE_TCHAR * ACE_OS::ctime ( const time_t *  t  ) 

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 97 of file OS_NS_time.inl.

00098 {
00099   ACE_OS_TRACE ("ACE_OS::ctime");
00100 #if defined (ACE_HAS_WINCE)
00101   static ACE_TCHAR buf [ctime_buf_size];
00102   return ACE_OS::ctime_r (t,
00103                           buf,
00104                           ctime_buf_size);
00105 #elif defined (ACE_WIN32) && defined (ACE_USES_WCHAR)
00106   ACE_OSCALL_RETURN (::_wctime (t), wchar_t *, 0);
00107 #else
00108 #  if defined (ACE_USES_WCHAR)   /* Not Win32, else it would do the above */
00109   char *narrow_time;
00110   ACE_OSCALL (::ctime (t), char *, 0, narrow_time);
00111   if (narrow_time == 0)
00112     return 0;
00113   // ACE_Ascii_To_Wide::convert allocates (via new []) a wchar_t[]. If
00114   // we've done this before, free the previous one. Yes, this leaves a
00115   // small memory leak (26 characters) but there's no way around this
00116   // that I know of. (Steve Huston, 12-Feb-2003).
00117   static wchar_t *wide_time = 0;
00118   if (wide_time != 0)
00119     delete [] wide_time;
00120   wide_time = ACE_Ascii_To_Wide::convert (narrow_time);
00121   return wide_time;
00122 #  else
00123   ACE_OSCALL_RETURN (::ctime (t), char *, 0);
00124 #  endif /* ACE_USES_WCHAR */
00125 # endif /* ACE_HAS_WINCE */
00126 }

ACE_TCHAR * ACE_OS::ctime_r ( const time_t *  clock,
ACE_TCHAR buf,
int  buflen 
)

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 130 of file OS_NS_time.inl.

00131 {
00132   ACE_OS_TRACE ("ACE_OS::ctime_r");
00133 
00134 #if defined (ACE_HAS_REENTRANT_FUNCTIONS)
00135 
00136   char *bufp = 0;
00137 #   if defined (ACE_USES_WCHAR)
00138   char narrow_buf[ctime_buf_size];
00139   bufp = narrow_buf;
00140 #   else
00141   bufp = buf;
00142 #   endif /* ACE_USES_WCHAR */
00143 
00144   if (buflen < ctime_buf_size)
00145     {
00146       errno = ERANGE;
00147       return 0;
00148     }
00149 #   if defined (ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R)
00150 #      if defined (DIGITAL_UNIX)
00151   ACE_OSCALL (::_Pctime_r (t, bufp), ACE_TCHAR *, 0, bufp);
00152 #      else /* DIGITAL_UNIX */
00153   ACE_OSCALL (::ctime_r (t, bufp), char *, 0, bufp);
00154 #      endif /* DIGITAL_UNIX */
00155 #   else /* ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R */
00156 
00157 #      if defined (ACE_HAS_SIZET_PTR_ASCTIME_R_AND_CTIME_R)
00158   bufp = ::ctime_r (t, bufp, reinterpret_cast<size_t*>(&buflen));
00159 #      else /* ACE_CTIME_R_RETURNS_INT */
00160   bufp = ::ctime_r (t, bufp, buflen);
00161 #      endif /* ACE_CTIME_R_RETURNS_INT */
00162 
00163 #   endif /* ACE_HAS_2_PARAM_ASCTIME_R_AND_CTIME_R */
00164 
00165   if (bufp == 0)
00166     return 0;
00167 
00168 #   if defined (ACE_USES_WCHAR)
00169   ACE_Ascii_To_Wide wide_buf (bufp);
00170   ACE_OS_String::strcpy (buf, wide_buf.wchar_rep ());
00171   return buf;
00172 #   else
00173   return bufp;
00174 #   endif /* ACE_USES_WCHAR */
00175 
00176 #elif defined (ACE_HAS_TR24731_2005_CRT)
00177   if (buflen < ctime_buf_size)
00178     {
00179       errno = ERANGE;
00180       return 0;
00181     }
00182   ACE_TCHAR *result = buf;
00183 #  if defined (ACE_USES_WCHAR)
00184   ACE_SECURECRTCALL (_wctime_s (buf, buflen, t), wchar_t *, 0, result);
00185 #  else
00186   ACE_SECURECRTCALL (ctime_s (buf, buflen, t), char *, 0, result);
00187 #  endif
00188   return result;
00189 
00190 #else /* ACE_HAS_REENTRANT_FUNCTIONS */
00191   if (buflen < ctime_buf_size)
00192     {
00193       errno = ERANGE;
00194       return 0;
00195     }
00196 
00197   ACE_TCHAR *result = 0;
00198 #     if defined (ACE_USES_WCHAR)
00199   ACE_OSCALL (::_wctime (t), wchar_t *, 0, result);
00200 #     else /* ACE_USES_WCHAR */
00201   ACE_OSCALL (::ctime (t), char *, 0, result);
00202 #     endif /* ACE_USES_WCHAR */
00203   if (result != 0)
00204     ACE_OS::strsncpy (buf, result, buflen);
00205   return buf;
00206 #endif /* ACE_HAS_REENTRANT_FUNCTIONS */
00207 }

char * ACE_OS::cuserid ( char *  user,
size_t  maxlen = ACE_MAX_USERID 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 352 of file OS_NS_stdio.inl.

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 (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 const 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 }

double ACE_OS::difftime ( time_t  t1,
time_t  t0 
)

strptime wrapper. Note that the struct tm will always be set to zero

Definition at line 212 of file OS_NS_time.inl.

00213 {
00214   return ::ace_difftime (t1, t0);
00215 }

int ACE_OS::dlclose ( ACE_SHLIB_HANDLE  handle  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 26 of file OS_NS_dlfcn.inl.

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_TCHAR * ACE_OS::dlerror ( void   ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 77 of file OS_NS_dlfcn.inl.

00078 {
00079   ACE_OS_TRACE ("ACE_OS::dlerror");
00080 # if defined (ACE_HAS_SVR4_DYNAMIC_LINKING)
00081   const char *err = 0;
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_SHLIB_HANDLE ACE_OS::dlopen ( const ACE_TCHAR filename,
int  mode = ACE_DEFAULT_SHLIB_MODE 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 121 of file OS_NS_dlfcn.inl.

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 }

void * ACE_OS::dlsym ( ACE_SHLIB_HANDLE  handle,
const ACE_TCHAR symbol 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 203 of file OS_NS_dlfcn.inl.

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_HANDLE ACE_OS::dup ( ACE_HANDLE  handle,
pid_t  pid 
)

Definition at line 220 of file OS_NS_unistd.inl.

00221 {
00222   ACE_OS_TRACE("ACE_OS::dup");
00223 #if defined (ACE_LACKS_DUP)
00224   ACE_UNUSED_ARG (handle);
00225   ACE_UNUSED_ARG (pid);
00226   ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE);
00227 #elif defined (ACE_WIN32)
00228   ACE_HANDLE new_fd;
00229   ACE_HANDLE hTargetProcess = ::OpenProcess (PROCESS_DUP_HANDLE,
00230                                              FALSE,
00231                                              pid);
00232   if(::DuplicateHandle(::GetCurrentProcess (),
00233                        handle,
00234                        hTargetProcess,
00235                        &new_fd,
00236                        0,
00237                        TRUE,
00238                        DUPLICATE_SAME_ACCESS))
00239     {
00240       ::CloseHandle (hTargetProcess);
00241       return new_fd;
00242     }
00243   else
00244     ACE_FAIL_RETURN (ACE_INVALID_HANDLE);
00245   /*NOTREACHED*/
00246 #else
00247   ACE_UNUSED_ARG (pid);
00248   ACE_OSCALL_RETURN(::dup(handle), ACE_HANDLE, ACE_INVALID_HANDLE);
00249 #endif /*ACE_WIN32 &&  !ACE_HAS_WINCE*/
00250 }

ACE_HANDLE ACE_OS::dup ( ACE_HANDLE  handle  ) 

Definition at line 195 of file OS_NS_unistd.inl.

00196 {
00197   ACE_OS_TRACE ("ACE_OS::dup");
00198 #if defined (ACE_LACKS_DUP)
00199   ACE_UNUSED_ARG (handle);
00200   ACE_NOTSUP_RETURN (ACE_INVALID_HANDLE);
00201 #elif defined (ACE_WIN32)
00202   ACE_HANDLE new_fd;
00203   if (::DuplicateHandle(::GetCurrentProcess (),
00204                         handle,
00205                         ::GetCurrentProcess(),
00206                         &new_fd,
00207                         0,
00208                         TRUE,
00209                         DUPLICATE_SAME_ACCESS))
00210     return new_fd;
00211   else
00212     ACE_FAIL_RETURN (ACE_INVALID_HANDLE);
00213   /* NOTREACHED */
00214 #else
00215   ACE_OSCALL_RETURN (::dup (handle), ACE_HANDLE, ACE_INVALID_HANDLE);
00216 #endif /* ACE_LACKS_DUP */
00217 }

int ACE_OS::dup2 ( ACE_HANDLE  oldfd,
ACE_HANDLE  newfd 
)

Definition at line 253 of file OS_NS_unistd.inl.

00254 {
00255   ACE_OS_TRACE ("ACE_OS::dup2");
00256 #if defined (ACE_LACKS_DUP2)
00257   // msvcrt has _dup2 ?!
00258   ACE_UNUSED_ARG (oldhandle);
00259   ACE_UNUSED_ARG (newhandle);
00260   ACE_NOTSUP_RETURN (-1);
00261 #else
00262   ACE_OSCALL_RETURN (::dup2 (oldhandle, newhandle), int, -1);
00263 #endif /* ACE_LACKS_DUP2 */
00264 }

void ACE_OS::endpwent ( void   ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 12 of file OS_NS_pwd.inl.

00013 {
00014 #if !defined (ACE_LACKS_PWD_FUNCTIONS)
00015   ::endpwent ();
00016 #endif /* ! ACE_LACKS_PWD_FUNCTIONS */
00017 }

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.

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 }

int ACE_OS::event_destroy ( ACE_event_t event  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 2349 of file OS_NS_Thread.cpp.

02350 {
02351 #if defined (ACE_WIN32)
02352   ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::CloseHandle (*event), ace_result_), int, -1);
02353 #elif defined (ACE_HAS_THREADS)
02354   if (event->eventdata_)
02355     {
02356       // mutex_destroy()/cond_destroy() are called in a loop if the object
02357       // is BUSY.  This avoids conditions where we fail to destroy these
02358       // objects because at time of destroy they were just being used in
02359       // another thread possibly causing deadlocks later on if they keep
02360       // being used after we're gone.
02361 
02362       if (event->eventdata_->type_ == USYNC_PROCESS)
02363         {
02364           if (event->name_)
02365             {
02366               // Only destroy the event data if we're the ones who initialized
02367               // it.
02368 
02369               int r1, r2;
02370 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02371         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02372      (!defined (ACE_USES_FIFO_SEM) && \
02373         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02374               // First destroy the mutex so locking after this will return
02375               // errors.
02376               while ((r1 = ACE_OS::mutex_destroy (&event->eventdata_->lock_)) == -1
02377                      && errno == EBUSY)
02378                 {
02379                   ACE_OS::thr_yield ();
02380                 }
02381 # else
02382               r1 = ACE_OS::sema_destroy(&event->lock_);
02383 # endif
02384 
02385 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02386     (!defined (ACE_USES_FIFO_SEM) && \
02387       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02388               // Now fix event to manual reset, raise signal and broadcast
02389               // until is's possible to destroy the condition.
02390               event->eventdata_->manual_reset_ = 1;
02391               while ((r2 = ACE_OS::cond_destroy (&event->eventdata_->condition_)) == -1
02392                      && errno == EBUSY)
02393                 {
02394                   event->eventdata_->is_signaled_ = 1;
02395                   ACE_OS::cond_broadcast (&event->eventdata_->condition_);
02396                   ACE_OS::thr_yield ();
02397                 }
02398 # else
02399               r2 = ACE_OS::sema_destroy(&event->semaphore_);
02400 # endif
02401               ACE_OS::munmap (event->eventdata_,
02402                               sizeof (ACE_eventdata_t));
02403               ACE_OS::shm_unlink (ACE_TEXT_CHAR_TO_TCHAR(event->name_));
02404               ACE_OS::free (event->name_);
02405               return r1 != 0 || r2 != 0 ? -1 : 0;
02406             }
02407           else
02408             {
02409               ACE_OS::munmap (event->eventdata_,
02410                               sizeof (ACE_eventdata_t));
02411 # if (!defined (ACE_HAS_PTHREADS) || !defined (_POSIX_THREAD_PROCESS_SHARED) || \
02412         (defined (ACE_LACKS_MUTEXATTR_PSHARED) && defined (ACE_LACKS_CONDATTR_PSHARED))) && \
02413      (defined (ACE_USES_FIFO_SEM) || \
02414         (defined (ACE_HAS_POSIX_SEM) && defined (ACE_HAS_POSIX_SEM_TIMEOUT) && defined (ACE_LACKS_NAMED_POSIX_SEM)))
02415               ACE_OS::sema_destroy(&event->lock_);
02416 # endif
02417 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02418     (!defined (ACE_USES_FIFO_SEM) && \
02419       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02420               return 0;
02421 # else
02422               return ACE_OS::sema_destroy(&event->semaphore_);
02423 # endif
02424             }
02425         }
02426       else
02427         {
02428           int r1, r2;
02429           // First destroy the mutex so locking after this will return errors.
02430 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02431         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02432      (!defined (ACE_USES_FIFO_SEM) && \
02433         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02434       // first destroy the mutex so locking after this will return errors
02435           while ((r1 = ACE_OS::mutex_destroy (&event->eventdata_->lock_)) == -1
02436                  && errno == EBUSY)
02437             {
02438               ACE_OS::thr_yield ();
02439             }
02440 # else
02441           r1 = ACE_OS::sema_destroy(&event->lock_);
02442 # endif
02443 
02444 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02445     (!defined (ACE_USES_FIFO_SEM) && \
02446       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02447           // Now fix event to manual reset, raise signal and broadcast until
02448           // it's possible to destroy the condition.
02449           event->eventdata_->manual_reset_ = 1;
02450           while ((r2 = ACE_OS::cond_destroy (&event->eventdata_->condition_)) == -1
02451                  && errno == EBUSY)
02452             {
02453               event->eventdata_->is_signaled_ = 1;
02454               ACE_OS::cond_broadcast (&event->eventdata_->condition_);
02455               ACE_OS::thr_yield ();
02456             }
02457 # else
02458           r2 = ACE_OS::sema_destroy(&event->semaphore_);
02459 # endif
02460           delete event->eventdata_;
02461           return r1 != 0 || r2 != 0 ? -1 : 0;
02462         }
02463     }
02464 
02465   return 0;
02466 #else
02467   ACE_UNUSED_ARG (event);
02468   ACE_NOTSUP_RETURN (-1);
02469 #endif /* ACE_WIN32 */
02470 }

int ACE_OS::event_init ( ACE_event_t event,
int  manual_reset = 0,
int  initial_state = 0,
int  type = ACE_DEFAULT_SYNCH_TYPE,
const char *  name = 0,
void *  arg = 0,
LPSECURITY_ATTRIBUTES  sa = 0 
)

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 2473 of file OS_NS_Thread.cpp.

02480 {
02481 #if defined (ACE_WIN32)
02482   ACE_UNUSED_ARG (type);
02483   ACE_UNUSED_ARG (arg);
02484   SECURITY_ATTRIBUTES sa_buffer;
02485   SECURITY_DESCRIPTOR sd_buffer;
02486 # if defined (ACE_HAS_WINCE)
02487   // @@todo (brunsch) This idea should be moved into ACE_OS_Win32.
02488   *event = ::CreateEventW (ACE_OS::default_win32_security_attributes_r
02489                              (sa, &sa_buffer, &sd_buffer),
02490                            manual_reset,
02491                            initial_state,
02492                            ACE_Ascii_To_Wide (name).wchar_rep ());
02493 # else /* ACE_HAS_WINCE */
02494   *event = ::CreateEventA (ACE_OS::default_win32_security_attributes_r
02495                              (sa, &sa_buffer, &sd_buffer),
02496                            manual_reset,
02497                            initial_state,
02498                            name);
02499 # endif /* ACE_HAS_WINCE */
02500   if (*event == 0)
02501     ACE_FAIL_RETURN (-1);
02502   else
02503     {
02504       // Make sure to set errno to ERROR_ALREADY_EXISTS if necessary.
02505       ACE_OS::set_errno_to_last_error ();
02506       return 0;
02507     }
02508 #elif defined (ACE_HAS_THREADS)
02509   ACE_UNUSED_ARG (sa);
02510   event->eventdata_ = 0;
02511   ACE_eventdata_t* evtdata;
02512 
02513   if (type == USYNC_PROCESS)
02514     {
02515       const char *name_p = 0;
02516 #  if defined (ACE_SHM_OPEN_REQUIRES_ONE_SLASH)
02517       char adj_name[MAXPATHLEN];
02518       if (name[0] != '/')
02519         {
02520           adj_name[0] = '/';
02521           ACE_OS::strsncpy (&adj_name[1], name, MAXPATHLEN-1);
02522           name_p = adj_name;
02523         }
02524       else
02525         {
02526           name_p = name;
02527         }
02528 #  else
02529       name_p = name;
02530 #  endif /* ACE_SHM_OPEN_REQUIRES_ONE_SLASH */
02531       int owner = 0;
02532       // Let's see if the shared memory entity already exists.
02533       ACE_HANDLE fd = ACE_OS::shm_open (ACE_TEXT_CHAR_TO_TCHAR (name_p),
02534                                         O_RDWR | O_CREAT | O_EXCL,
02535                                         ACE_DEFAULT_FILE_PERMS);
02536       if (fd == ACE_INVALID_HANDLE)
02537         {
02538           if (errno == EEXIST)
02539             fd = ACE_OS::shm_open (ACE_TEXT_CHAR_TO_TCHAR (name_p),
02540                                    O_RDWR | O_CREAT,
02541                                    ACE_DEFAULT_FILE_PERMS);
02542           if (fd == ACE_INVALID_HANDLE)   // Still can't get it.
02543             return -1;
02544         }
02545       else
02546         {
02547           // We own this shared memory object!  Let's set its size.
02548           if (ACE_OS::ftruncate (fd, sizeof (ACE_eventdata_t)) == -1)
02549             {
02550               ACE_OS::close (fd);
02551               return -1;
02552             }
02553           owner = 1;
02554         }
02555 
02556       evtdata =
02557         (ACE_eventdata_t *) ACE_OS::mmap (0,
02558                                           sizeof (ACE_eventdata_t),
02559                                           PROT_RDWR,
02560                                           MAP_SHARED,
02561                                           fd,
02562                                           0);
02563       ACE_OS::close (fd);
02564       if (evtdata == MAP_FAILED)
02565         {
02566           if (owner)
02567             ACE_OS::shm_unlink (ACE_TEXT_CHAR_TO_TCHAR (name_p));
02568           return -1;
02569         }
02570 
02571       if (owner)
02572         {
02573           event->name_ = ACE_OS::strdup (name_p);
02574           if (event->name_ == 0)
02575             {
02576               ACE_OS::shm_unlink (ACE_TEXT_CHAR_TO_TCHAR (name_p));
02577               return -1;
02578             }
02579           event->eventdata_ = evtdata;
02580           event->eventdata_->type_ = type;
02581           event->eventdata_->manual_reset_ = manual_reset;
02582           event->eventdata_->is_signaled_ = initial_state;
02583           event->eventdata_->auto_event_signaled_ = false;
02584           event->eventdata_->waiting_threads_ = 0;
02585           event->eventdata_->signal_count_ = 0;
02586 
02587 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02588     (!defined (ACE_USES_FIFO_SEM) && \
02589       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02590           int result = ACE_OS::cond_init (&event->eventdata_->condition_,
02591                                           static_cast<short> (type),
02592                                           name,
02593                                           arg);
02594 # else
02595           char   sem_name[128];
02596           ACE_OS::strncpy (sem_name,
02597                            name,
02598                            sizeof (sem_name) - (1 + sizeof ("._ACE_EVTSEM_")));
02599           ACE_OS::strcat (sem_name, "._ACE_EVTSEM_");
02600           int result = ACE_OS::sema_init (&event->semaphore_,
02601                                           0,
02602                                           type,
02603                                           sem_name,
02604                                           arg);
02605 # endif
02606           if (result == 0)
02607 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02608         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02609      (!defined (ACE_USES_FIFO_SEM) && \
02610         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02611             result = ACE_OS::mutex_init (&event->eventdata_->lock_,
02612                                          type,
02613                                          name,
02614                                          (ACE_mutexattr_t *) arg);
02615 # else
02616           {
02617             char   lck_name[128];
02618             ACE_OS::strncpy
02619               (lck_name,
02620                name,
02621                sizeof (lck_name) - (1 + sizeof ("._ACE_EVTLCK_")));
02622             ACE_OS::strcat (lck_name, "._ACE_EVTLCK_");
02623             result = ACE_OS::sema_init (&event->lock_,
02624                                         0,
02625                                         type,
02626                                         lck_name,
02627                                         arg);
02628             if (result == 0)
02629               result = ACE_OS::sema_post (&event->lock_); /* Initially unlock */
02630           }
02631 # endif
02632           return result;
02633         }
02634       else
02635         {
02636           int result = 0;
02637 
02638           event->name_ = 0;
02639           event->eventdata_ = evtdata;
02640 #if (!defined (ACE_HAS_PTHREADS) || !defined (_POSIX_THREAD_PROCESS_SHARED) || defined (ACE_LACKS_CONDATTR_PSHARED)) && \
02641   (defined (ACE_USES_FIFO_SEM) || \
02642     (defined (ACE_HAS_POSIX_SEM) && defined (ACE_HAS_POSIX_SEM_TIMEOUT) && !defined (ACE_LACKS_NAMED_POSIX_SEM)))
02643           char   sem_name[128];
02644           ACE_OS::strncpy (sem_name,
02645                            name,
02646                            sizeof (sem_name) - (1 + sizeof ("._ACE_EVTSEM_")));
02647           ACE_OS::strcat (sem_name, "._ACE_EVTSEM_");
02648           result = ACE_OS::sema_init(&event->semaphore_,
02649                                      0,
02650                                      type,
02651                                      sem_name,
02652                                      arg);
02653 # endif
02654 
02655 # if (!defined (ACE_HAS_PTHREADS) || !defined (_POSIX_THREAD_PROCESS_SHARED) || \
02656         (defined (ACE_LACKS_MUTEXATTR_PSHARED) && defined (ACE_LACKS_CONDATTR_PSHARED))) && \
02657      (defined (ACE_USES_FIFO_SEM) || \
02658         (defined (ACE_HAS_POSIX_SEM) && defined (ACE_HAS_POSIX_SEM_TIMEOUT) && defined (ACE_LACKS_NAMED_POSIX_SEM)))
02659           if (result == 0)
02660             {
02661               char   lck_name[128];
02662               ACE_OS::strncpy
02663                 (lck_name,
02664                  name,
02665                  sizeof (lck_name) - (1 + sizeof ("._ACE_EVTLCK_")));
02666               ACE_OS::strcat (lck_name, "._ACE_EVTLCK_");
02667               result = ACE_OS::sema_init (&event->lock_,
02668                                           0,
02669                                           type,
02670                                           lck_name,
02671                                           arg);
02672             }
02673 # endif
02674           return result;
02675         }
02676     }
02677   else
02678     {
02679       ACE_NEW_RETURN (evtdata, ACE_eventdata_t, -1);
02680       event->name_ = 0;
02681       event->eventdata_ = evtdata;
02682       event->eventdata_->type_ = type;
02683       event->eventdata_->manual_reset_ = manual_reset;
02684       event->eventdata_->is_signaled_ = initial_state;
02685       event->eventdata_->auto_event_signaled_ = false;
02686       event->eventdata_->waiting_threads_ = 0;
02687       event->eventdata_->signal_count_ = 0;
02688 
02689 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02690     (!defined (ACE_USES_FIFO_SEM) && \
02691       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02692       int result = ACE_OS::cond_init (&event->eventdata_->condition_,
02693                                       static_cast<short> (type),
02694                                       name,
02695                                       arg);
02696 # else
02697       int result = ACE_OS::sema_init (&event->semaphore_,
02698                                       0,
02699                                       type,
02700                                       name,
02701                                       arg);
02702 # endif
02703       if (result == 0)
02704 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02705         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02706      (!defined (ACE_USES_FIFO_SEM) && \
02707         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02708         result = ACE_OS::mutex_init (&event->eventdata_->lock_,
02709                                      type,
02710                                      name,
02711                                      (ACE_mutexattr_t *) arg);
02712 # else
02713       result = ACE_OS::sema_init (&event->lock_,
02714                                   0,
02715                                   type,
02716                                   name,
02717                                   arg);
02718       if (result == 0)
02719         result = ACE_OS::sema_post(&event->lock_);    /* initially unlock */
02720 # endif
02721 
02722       return result;
02723     }
02724 #else
02725   ACE_UNUSED_ARG (event);
02726   ACE_UNUSED_ARG (manual_reset);
02727   ACE_UNUSED_ARG (initial_state);
02728   ACE_UNUSED_ARG (type);
02729   ACE_UNUSED_ARG (name);
02730   ACE_UNUSED_ARG (arg);
02731   ACE_UNUSED_ARG (sa);
02732   ACE_NOTSUP_RETURN (-1);
02733 #endif /* ACE_WIN32 */
02734 }

int ACE_OS::event_pulse ( ACE_event_t event  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 2737 of file OS_NS_Thread.cpp.

02738 {
02739 #if defined (ACE_WIN32)
02740   ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::PulseEvent (*event), ace_result_), int, -1);
02741 #elif defined (ACE_HAS_THREADS)
02742   int result = 0;
02743   int error = 0;
02744 
02745   // grab the lock first
02746 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02747         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02748      (!defined (ACE_USES_FIFO_SEM) && \
02749         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02750   if (ACE_OS::mutex_lock (&event->eventdata_->lock_) == 0)
02751 # else
02752   if (ACE_OS::sema_wait (&event->lock_) == 0)
02753 # endif
02754   {
02755     if (event->eventdata_->waiting_threads_ > 0)
02756     {
02757       // Manual-reset event.
02758       if (event->eventdata_->manual_reset_ == 1)
02759       {
02760         // Wakeup all waiters.
02761 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02762     (!defined (ACE_USES_FIFO_SEM) && \
02763       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02764         if (ACE_OS::cond_broadcast (&event->eventdata_->condition_) != 0)
02765         {
02766           result = -1;
02767           error = errno;
02768         }
02769         if (result == 0)
02770           event->eventdata_->signal_count_ = event->eventdata_->waiting_threads_;
02771 # else
02772         event->eventdata_->signal_count_ = event->eventdata_->waiting_threads_;
02773         for (unsigned long i=0; i<event->eventdata_->signal_count_ ;++i)
02774           if (ACE_OS::sema_post(&event->semaphore_) != 0)
02775           {
02776             event->eventdata_->signal_count_ = 0;
02777             result = -1;
02778             error = errno;
02779           }
02780 
02781         if (result == 0)
02782           while(event->eventdata_->signal_count_!=0 && event->eventdata_->waiting_threads_!=0)
02783             ACE_OS::thr_yield ();
02784 # endif
02785       }
02786       // Auto-reset event: wakeup one waiter.
02787       else
02788       {
02789 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02790     (!defined (ACE_USES_FIFO_SEM) && \
02791       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02792         if (ACE_OS::cond_signal (&event->eventdata_->condition_) != 0)
02793 # else
02794         if (ACE_OS::sema_post(&event->semaphore_) != 0)
02795 # endif
02796         {
02797           result = -1;
02798           error = errno;
02799         }
02800 
02801         event->eventdata_->auto_event_signaled_ = true;
02802       }
02803     }
02804 
02805     // Reset event.
02806     event->eventdata_->is_signaled_ = 0;
02807 
02808     // Now we can let go of the lock.
02809 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02810         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02811      (!defined (ACE_USES_FIFO_SEM) && \
02812         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02813     ACE_OS::mutex_unlock (&event->eventdata_->lock_);
02814 # else
02815     ACE_OS::sema_post (&event->lock_);
02816 # endif
02817     if (result == -1)
02818       // Reset errno in case mutex_unlock() also fails...
02819       errno = error;
02820   }
02821   else
02822     result = -1;
02823   return result;
02824 #else
02825   ACE_UNUSED_ARG (event);
02826   ACE_NOTSUP_RETURN (-1);
02827 #endif /* ACE_WIN32 */
02828 }

int ACE_OS::event_reset ( ACE_event_t event  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 2831 of file OS_NS_Thread.cpp.

02832 {
02833 #if defined (ACE_WIN32)
02834   ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::ResetEvent (*event), ace_result_), int, -1);
02835 #elif defined (ACE_HAS_THREADS)
02836   int result = 0;
02837 
02838   // Grab the lock first.
02839 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02840         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02841      (!defined (ACE_USES_FIFO_SEM) && \
02842         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02843   if (ACE_OS::mutex_lock (&event->eventdata_->lock_) == 0)
02844 # else
02845   if (ACE_OS::sema_wait (&event->lock_) == 0)
02846 # endif
02847   {
02848     // Reset event.
02849     event->eventdata_->is_signaled_ = 0;
02850     event->eventdata_->auto_event_signaled_ = false;
02851 
02852     // Now we can let go of the lock.
02853 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02854         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02855      (!defined (ACE_USES_FIFO_SEM) && \
02856         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02857     ACE_OS::mutex_unlock (&event->eventdata_->lock_);
02858 # else
02859     ACE_OS::sema_post (&event->lock_);
02860 # endif
02861   }
02862   else
02863     result = -1;
02864   return result;
02865 #else
02866   ACE_UNUSED_ARG (event);
02867   ACE_NOTSUP_RETURN (-1);
02868 #endif /* ACE_WIN32 */
02869 }

int ACE_OS::event_signal ( ACE_event_t event  ) 

This is necessary to deal with POSIX pthreads and their use of structures for thread ids.

Definition at line 2872 of file OS_NS_Thread.cpp.

02873 {
02874 #if defined (ACE_WIN32)
02875   ACE_WIN32CALL_RETURN (ACE_ADAPT_RETVAL (::SetEvent (*event), ace_result_), int, -1);
02876 #elif defined (ACE_HAS_THREADS)
02877   int result = 0;
02878   int error = 0;
02879 
02880   // grab the lock first
02881 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02882         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02883      (!defined (ACE_USES_FIFO_SEM) && \
02884         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02885   if (ACE_OS::mutex_lock (&event->eventdata_->lock_) == 0)
02886 # else
02887   if (ACE_OS::sema_wait (&event->lock_) == 0)
02888 # endif
02889   {
02890     // Manual-reset event.
02891     if (event->eventdata_->manual_reset_ == 1)
02892     {
02893       // wakeup all
02894 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02895     (!defined (ACE_USES_FIFO_SEM) && \
02896       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02897       if (ACE_OS::cond_broadcast (&event->eventdata_->condition_) != 0)
02898       {
02899         result = -1;
02900         error = errno;
02901       }
02902 # else
02903       if (ACE_OS::sema_post(&event->semaphore_) != 0)
02904       {
02905         result = -1;
02906         error = errno;
02907       }
02908 # endif
02909 
02910       if (result == 0)
02911         // signal event
02912         event->eventdata_->is_signaled_ = 1;
02913     }
02914     // Auto-reset event
02915     else
02916     {
02917       if (event->eventdata_->waiting_threads_ == 0)
02918         // No waiters: signal event.
02919         event->eventdata_->is_signaled_ = 1;
02920       // Waiters: wakeup one waiter.
02921 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && !defined (ACE_LACKS_CONDATTR_PSHARED)) || \
02922     (!defined (ACE_USES_FIFO_SEM) && \
02923       (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02924       else if (ACE_OS::cond_signal (&event->eventdata_->condition_) != 0)
02925 # else
02926       else if (ACE_OS::sema_post(&event->semaphore_) != 0)
02927 # endif
02928       {
02929         result = -1;
02930         error = errno;
02931       }
02932 
02933       event->eventdata_->auto_event_signaled_ = true;
02934     }
02935 
02936     // Now we can let go of the lock.
02937 # if (defined (ACE_HAS_PTHREADS) && defined (_POSIX_THREAD_PROCESS_SHARED) && \
02938         (!defined (ACE_LACKS_MUTEXATTR_PSHARED) || !defined (ACE_LACKS_CONDATTR_PSHARED))) || \
02939      (!defined (ACE_USES_FIFO_SEM) && \
02940         (!defined (ACE_HAS_POSIX_SEM) || !defined (ACE_HAS_POSIX_SEM_TIMEOUT) || defined (ACE_LACKS_NAMED_POSIX_SEM)))
02941     ACE_OS::mutex_unlock (&event->