diff options
Diffstat (limited to 'ace/os_include/sys/sem.h')
-rw-r--r-- | ace/os_include/sys/sem.h | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/ace/os_include/sys/sem.h b/ace/os_include/sys/sem.h index 90525d91e2f..4e9a0290bdc 100644 --- a/ace/os_include/sys/sem.h +++ b/ace/os_include/sys/sem.h @@ -2,19 +2,19 @@ //============================================================================= /** - * @file sem.h + * @file os_sem.h * * XSI semaphore facility * * $Id$ * - * @author Don Hinton <dhinton@ieee.org> + * @author Don Hinton <dhinton@dresystems.com> * @author This code was originally in various places including ace/OS.h. */ //============================================================================= -#ifndef ACE_OS_INCLUDE_SYS_SEM_H -#define ACE_OS_INCLUDE_SYS_SEM_H +#ifndef ACE_OS_INCLUDE_SYS_OS_SEM_H +#define ACE_OS_INCLUDE_SYS_OS_SEM_H #include "ace/pre.h" @@ -27,8 +27,44 @@ #include "ace/os_include/sys/ipc.h" #if !defined (ACE_LACKS_SYS_SEM_H) -# include /**/ <sys/sem.h> +# include /**/ <sys/sem.h> #endif /* !ACE_LACKS_SYS_SEM_H */ +// Place all additions (especially function declarations) within extern "C" {} +#ifdef __cplusplus +extern "C" +{ +#endif /* __cplusplus */ + +#if defined (ACE_LACKS_SEMBUF_T) + struct sembuf + { + /// semaphore # + unsigned short sem_num; + + /// semaphore operation + short sem_op; + + /// operation flags + short sem_flg; + }; +#endif /* ACE_LACKS_SEMBUF_T */ + +#if !defined (ACE_HAS_SEMUN) || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) + union semun + { + /// value for SETVAL + int val; + /// buffer for IPC_STAT & IPC_SET + struct semid_ds *buf; + /// array for GETALL & SETALL + u_short *array; + }; +#endif /* !ACE_HAS_SEMUN || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) */ + +#ifdef __cplusplus +} +#endif /* __cplusplus */ + #include "ace/post.h" -#endif /* ACE_OS_INCLUDE_SYS_SEM_H */ +#endif /* ACE_OS_INCLUDE_SYS_OS_SEM_H */ |