os_sem.h

Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 //=============================================================================
00004 /**
00005  *  @file    os_sem.h
00006  *
00007  *  XSI semaphore facility
00008  *
00009  *  os_sem.h,v 1.4 2004/08/25 16:05:42 shuston Exp
00010  *
00011  *  @author Don Hinton <dhinton@dresystems.com>
00012  *  @author This code was originally in various places including ace/OS.h.
00013  */
00014 //=============================================================================
00015 
00016 #ifndef ACE_OS_INCLUDE_SYS_OS_SEM_H
00017 #define ACE_OS_INCLUDE_SYS_OS_SEM_H
00018 
00019 #include /**/ "ace/pre.h"
00020 
00021 #include "ace/config-lite.h"
00022 
00023 #if !defined (ACE_LACKS_PRAGMA_ONCE)
00024 # pragma once
00025 #endif /* ACE_LACKS_PRAGMA_ONCE */
00026 
00027 #include "ace/os_include/sys/os_ipc.h"
00028 
00029 #if !defined (ACE_LACKS_SYS_SEM_H)
00030 #  include /**/ <sys/sem.h>
00031 #endif /* !ACE_LACKS_SYS_SEM_H */
00032 
00033 // Place all additions (especially function declarations) within extern "C" {}
00034 #ifdef __cplusplus
00035 extern "C"
00036 {
00037 #endif /* __cplusplus */
00038 
00039 # if !defined (GETVAL)
00040 #   define GETVAL 0
00041 # endif /* GETVAL */
00042 
00043 # if !defined (SETVAL)
00044 #   define SETVAL 0
00045 # endif /* SETVAL */
00046 
00047 # if !defined (GETALL)
00048 #   define GETALL 0
00049 # endif /* GETALL */
00050 
00051 # if !defined (SETALL)
00052 #   define SETALL 0
00053 # endif /* SETALL */
00054 
00055 # if !defined (SEM_UNDO)
00056 #   define SEM_UNDO 0
00057 # endif /* SEM_UNDO */
00058 
00059 #if defined (ACE_LACKS_SEMBUF_T)
00060    struct sembuf
00061    {
00062      /// semaphore #
00063      unsigned short sem_num;
00064 
00065      /// semaphore operation
00066      short sem_op;
00067 
00068      /// operation flags
00069      short sem_flg;
00070    };
00071 #endif /* ACE_LACKS_SEMBUF_T */
00072 
00073 #if !defined (ACE_HAS_SEMUN) || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED))
00074    union semun
00075    {
00076      /// value for SETVAL
00077      int val;
00078      /// buffer for IPC_STAT & IPC_SET
00079      struct semid_ds *buf;
00080      /// array for GETALL & SETALL
00081      u_short *array;
00082    };
00083 #endif /* !ACE_HAS_SEMUN || (defined (__GLIBC__) && defined (_SEM_SEMUN_UNDEFINED)) */
00084 
00085 #ifdef __cplusplus
00086 }
00087 #endif /* __cplusplus */
00088 
00089 #include /**/ "ace/post.h"
00090 #endif /* ACE_OS_INCLUDE_SYS_OS_SEM_H */

Generated on Thu Nov 9 09:41:58 2006 for ACE by doxygen 1.3.6