From b67b8b5497a043141e0563b0fc51e9a137e5dce4 Mon Sep 17 00:00:00 2001 From: jwh1 Date: Thu, 27 Jul 2000 13:42:41 +0000 Subject: Thu Jul 27 08:36:01 2000 John Heitmann --- PACE/ChangeLog | 23 +++++++++++++++++++ PACE/pace/config/config.h | 8 +++++++ PACE/pace/fcntl.h | 12 ++++++++-- PACE/pace/mqueue.h | 6 ++++- PACE/pace/posix/time.inl | 55 +++++++++++++++++++++++----------------------- PACE/pace/posix/unistd.inl | 25 ++++++++++----------- PACE/pace/semaphore.h | 7 ++++-- PACE/pace/stdio.h | 6 ++++- 8 files changed, 95 insertions(+), 47 deletions(-) diff --git a/PACE/ChangeLog b/PACE/ChangeLog index 76c256b7e56..888b3eff07e 100644 --- a/PACE/ChangeLog +++ b/PACE/ChangeLog @@ -1,3 +1,26 @@ +Thu Jul 27 08:36:01 2000 John Heitmann + + * pace/fcntl.h + * pace/mqueue.h + * pace/semaphore.h + * pace/stdio.h + Added :: qualifier to macros, but of course these should + be defined by the user, so these will go away once + I update OS.*. + + * pace/config/config.h + Added _REENTRANT for solaris. + + * pace/posix/time.inl + * pace/posix/unistd.inl + Took away PACE_HAS_PTHREAD_SEMANTICS in favor of platform + specific code. It appears PAC_HAS_PTHREAD_SEMANTICS is now + superfluous. + + * ../ace/OS.i + Qualified two functions with pace_ as they should + have been originally. Paceified ACE_OS::gettimeofday. + Wed Jul 26 17:13:51 2000 John Heitmann * pace/emulation/mqueue.c: diff --git a/PACE/pace/config/config.h b/PACE/pace/config/config.h index f4ea25daa50..0aaf45919e5 100644 --- a/PACE/pace/config/config.h +++ b/PACE/pace/config/config.h @@ -16,6 +16,12 @@ #ifndef PACE_CONFIG_CONFIG_H #define PACE_CONFIG_CONFIG_H +#if (PACE_SUNOS) +# if !defined (_REENTRANT) +# define _REENTRANT +# endif /* _REENTRANT */ +#endif /* PACE_SUNOS */ + #if !defined (PACE_HAS_POSIX_C_SOURCE) # if defined (_POSIX_C_SOURCE) # define PACE_HAS_POSIX_C_SOURCE _POSIX_C_SOURCE @@ -47,12 +53,14 @@ # endif /* other POSIX */ #endif /* ! PACE_HAS_REENTRANT */ + #if !defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) # if defined (_POSIX_PTHREAD_SEMANTICS) # define PACE_HAS_POSIX_PTHREAD_SEMANTICS _POSIX_PTHREAD_SEMANTICS # endif /* _POSIX_PTHREAD_SEMANTICS */ #endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ + #if PACE_HAS_POSIX == PACE_LYNXOS # define PACE_NONCONST_ARG_CAST(TYPE) (TYPE) #else /* ! PACE_LYNXOS */ diff --git a/PACE/pace/fcntl.h b/PACE/pace/fcntl.h index fa71ebd13ee..b1e9afae442 100644 --- a/PACE/pace/fcntl.h +++ b/PACE/pace/fcntl.h @@ -49,7 +49,11 @@ extern "C" { IEEE Std 1003.1, 1996 Edition), Section 6.5.2. */ #if (PACE_HAS_POSIX_FM_UOF) -# define pace_fcntl fcntl +# if defined (PACE_HAS_CPLUSPLUS) +# define pace_fcntl ::fcntl +# else +# define pace_fcntl fcntl +# endif /* PACE_HAS_CPLUSPLUS */ #endif /* PACE_HAS_POSIX_FM_UOF */ /* int fcntl (int fildes, int cmd, *//* arg *//* ... ); */ @@ -59,7 +63,11 @@ extern "C" { IEEE Std 1003.1, 1996 Edition), Section 5.3.1. */ #if (PACE_HAS_POSIX_DI_UOF) -# define pace_open open +# if defined (PACE_HAS_CPLUPLUS) +# define pace_open ::open +# else +# define pace_open open +# endif /* PACE_HAS_CPLUSPLUS */ #endif /* PACE_HAS_POSIX_DI_UOF */ /* int open (const char *path, int oflag, *//* pace_mode_t mode *//* ... );*/ diff --git a/PACE/pace/mqueue.h b/PACE/pace/mqueue.h index 7f2cd6b2315..aaa3447ea91 100644 --- a/PACE/pace/mqueue.h +++ b/PACE/pace/mqueue.h @@ -66,7 +66,11 @@ extern "C" { IEEE Std 1003.1, 1996 Edition), Section 15.2.1. */ #if (PACE_HAS_POSIX_NONUOF_FUNCS) - # define pace_mq_open mq_open +# if defined (PACE_HAS_CPLUSPLUS) +# define pace_mq_open ::mq_open +# else +# define pace_mq_open mq_open +# endif /* PACE_HAS_CPLUSPLUS */ #endif /* PACE_HAS_POSIX_NONUOF_FUNCS */ /* mqd_t mq_open (const char *name, int oflag, (*//* args *//*) ... ); */ diff --git a/PACE/pace/posix/time.inl b/PACE/pace/posix/time.inl index 6a3a04c2d30..91845cf8461 100644 --- a/PACE/pace/posix/time.inl +++ b/PACE/pace/posix/time.inl @@ -31,14 +31,16 @@ PACE_INLINE char * pace_asctime_r (const pace_tm * time, char * buf) { -# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +#if (PACE_LYNXOS) + /*lynxos 3.1 has POSIX.4 Draft 9 versions of this */ + if (asctime_r (time, buf, 26) == -1) /* ??? */ + return (char*) 0; + return buf; +#elif (PACE_SUNOS) + return asctime_r (time, buf, 26); +#else return asctime_r (time, buf); -# else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (time); - PACE_UNUSED_ARG (buf); - PACE_ERRNO_NO_SUPPORT (); - return 0; -# endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +#endif /* PACE_LYNXOS */ } #endif /* PACE_HAS_POSIX_CLSR_UOF */ @@ -125,14 +127,11 @@ PACE_INLINE char * pace_ctime_r (const pace_time_t * clock, char * buf) { -# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +# if (PACE_SUNOS) || (PACE_LYNXOS) + return ctime_r (clock, buf, 26); +# else return ctime_r (clock, buf); -# else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (clock); - PACE_UNUSED_ARG (buf); - PACE_ERRNO_NO_SUPPORT (); - return 0; -# endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +# endif /* PACE_SUNOS */ } #endif /* PACE_HAS_POSIX_CLSR_UOF */ @@ -150,14 +149,14 @@ PACE_INLINE pace_tm * pace_gmtime_r (const pace_time_t * clock, pace_tm * result) { -# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +#if (PACE_LYNXOS) + /*lynxos 3.1 has POSIX.4 Draft 9 versions of these */ + if (gmtime_r (result, clock) == 0) + return (pace_tm*)0; + return result; /* ????? */ +#else return gmtime_r (clock, result); -# else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (clock); - PACE_UNUSED_ARG (result); - PACE_ERRNO_NO_SUPPORT (); - return 0; -# endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +#endif /* PACE_LYNXOS */ } #endif /* PACE_HAS_POSIX_CLSR_UOF */ @@ -175,14 +174,14 @@ PACE_INLINE pace_tm * pace_localtime_r (const pace_time_t * clock, pace_tm * result) { -# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +#if (PACE_LYNXOS) + /*lynxos 3.1 has POSIX.4 Draft 9 versions of these */ + if (localtime_r (result, clock) == 0) + return (pace_tm*)0; + return result; /* ????? */ +#else return localtime_r (clock, result); -# else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (clock); - PACE_UNUSED_ARG (result); - PACE_ERRNO_NO_SUPPORT (); - return 0; -# endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +#endif /* PACE_LYNXOS */ } #endif /* PACE_HAS_POSIX_CLSR_UOF */ diff --git a/PACE/pace/posix/unistd.inl b/PACE/pace/posix/unistd.inl index 01ffc365603..d06564e25d0 100644 --- a/PACE/pace/posix/unistd.inl +++ b/PACE/pace/posix/unistd.inl @@ -227,13 +227,13 @@ PACE_INLINE int pace_getlogin_r (char * name, size_t namesize) { -# if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +#if (PACE_SUNOS) || (PACE_LYNXOS) + if (getlogin_r (name, (int) namesize) == 0) + return errno; + return 0; +#else return getlogin_r (name, namesize); -# else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (name); - PACE_UNUSED_ARG (namesize); - PACE_ERRNO_NO_SUPPORT_RETURN (-1); -# endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +#endif /* SUN_OS */ } #endif /* PACE_HAS_POSIX_UGR_UOF */ @@ -433,14 +433,13 @@ pace_ttyname_r (PACE_HANDLE fildes, char * name, size_t namesize) { -#if defined (PACE_HAS_POSIX_PTHREAD_SEMANTICS) +#if (PACE_SUNOS) || (PACE_LYNXOS) + if (ttyname_r (fildes, name, (int) namesize) == 0) + return errno; + return 0; +#else return ttyname_r (fildes, name, namesize); -#else /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ - PACE_UNUSED_ARG (fildes); - PACE_UNUSED_ARG (name); - PACE_UNUSED_ARG (namesize); - PACE_ERRNO_NO_SUPPORT_RETURN (-1); -#endif /* ! PACE_HAS_POSIX_PTHREAD_SEMANTICS */ +#endif /* PACE_SUNOS */ } #endif /* PACE_HAS_POSIX_NONUOF_FUNCS */ diff --git a/PACE/pace/semaphore.h b/PACE/pace/semaphore.h index d69c7635b34..fd4bc1fcebe 100644 --- a/PACE/pace/semaphore.h +++ b/PACE/pace/semaphore.h @@ -72,9 +72,12 @@ extern "C" { IEEE Std 1003.1, 1996 Edition), Section 11.2.3. */ #if (PACE_HAS_POSIX_NONUOF_FUNCS) - # define pace_sem_open sem_open +# if defined (PACE_HAS_CPLUSPLUS) +# define pace_sem_open ::sem_open +# else +# define pace_sem_open sem_open +# endif /* PACE_HAS_CPLUSPLUS */ #endif /* PACE_HAS_POSIX_NONUOF_FUNCS */ - /* int fprintf (FILE *stream, const char *format, (*//* args *//*) ... ); */ /** PACE's implementation of the POSIX function sem_post. diff --git a/PACE/pace/stdio.h b/PACE/pace/stdio.h index b1680fb84b6..a35c636c2b6 100644 --- a/PACE/pace/stdio.h +++ b/PACE/pace/stdio.h @@ -204,7 +204,11 @@ extern "C" { IEEE Std 1003.1, 1996 Edition), Section 8.1. */ #if (PACE_HAS_POSIX_DI_UOF) - #define pace_fscanf fscanf +# if defined (PACE_HAS_CPLUSPLUS) +# define pace_fscanf ::fscanf +# else +# define pace_fscanf fscanf +# endif /* PACE_HAS_CPLUSPLUS */ #endif /* PACE_HAS_POSIX_DI_UOF */ /* int pace_scanf (const char *format, ... ); */ -- cgit v1.2.1