1 /* @(#)semshm.h 1.6 08/08/03 Copyright 1998,1999 Heiko Eissfeldt */ 2 3 /* 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. 8 * 9 * See the file CDDL.Schily.txt in this distribution for details. 10 * 11 * When distributing Covered Code, include this CDDL HEADER in each 12 * file and include the License file CDDL.Schily.txt from this distribution. 13 */ 14 15 #ifndef _SEMSHM_H 16 #define _SEMSHM_H 17 18 #undef DEBUG_SHM 19 #ifdef DEBUG_SHM 20 extern char *start_of_shm; 21 extern char *end_of_shm; 22 #endif 23 24 #define FREE_SEM 0 25 #define DEF_SEM 1 26 27 #if defined(HAVE_SEMGET) && defined(USE_SEMAPHORES) 28 extern int sem_id; 29 #else 30 31 #define sem_id 42 /* nearly any other number would do it too */ 32 33 extern void init_pipes __PR((void)); 34 extern void init_parent __PR((void)); 35 extern void init_child __PR((void)); 36 #endif 37 38 39 #ifdef HAVE_AREAS 40 /* 41 * The name of the shared memory mapping for the FIFO under BeOS. 42 */ 43 #define AREA_NAME "shmfifo" 44 #endif 45 46 extern void free_sem __PR((void)); 47 extern int semrequest __PR((int semid, int semnum)); 48 extern int semrelease __PR((int semid, int semnum, int amount)); 49 extern void semdestroy __PR((void)); 50 extern int flush_buffers __PR((void)); 51 extern void * request_shm_sem __PR((unsigned amount_of_sh_mem, unsigned char **pointer)); 52 53 #endif /* _SEMSHM_H */ 54