michael@0: /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* michael@0: ** prshm.c -- NSPR Named Shared Memory michael@0: ** michael@0: ** lth. Jul-1999. michael@0: */ michael@0: #include michael@0: #include "primpl.h" michael@0: michael@0: extern PRLogModuleInfo *_pr_shm_lm; michael@0: michael@0: michael@0: #if defined PR_HAVE_SYSV_NAMED_SHARED_MEMORY michael@0: /* SysV implementation is in pr/src/md/unix/uxshm.c */ michael@0: #elif defined PR_HAVE_POSIX_NAMED_SHARED_MEMORY michael@0: /* Posix implementation is in pr/src/md/unix/uxshm.c */ michael@0: #elif defined PR_HAVE_WIN32_NAMED_SHARED_MEMORY michael@0: /* Win32 implementation is in pr/src/md/windows/w32shm.c */ michael@0: #else michael@0: /* michael@0: ** there is no named_shared_memory michael@0: */ michael@0: extern PRSharedMemory* _MD_OpenSharedMemory( const char *name, PRSize size, PRIntn flags, PRIntn mode ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return NULL; michael@0: } michael@0: michael@0: extern void * _MD_AttachSharedMemory( PRSharedMemory *shm, PRIntn flags ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return NULL; michael@0: } michael@0: michael@0: extern PRStatus _MD_DetachSharedMemory( PRSharedMemory *shm, void *addr ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: extern PRStatus _MD_CloseSharedMemory( PRSharedMemory *shm ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return PR_FAILURE; michael@0: } michael@0: michael@0: extern PRStatus _MD_DeleteSharedMemory( const char *name ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return PR_FAILURE; michael@0: } michael@0: #endif /* HAVE_SYSV_NAMED_SHARED_MEMORY */ michael@0: michael@0: /* michael@0: ** FUNCTION: PR_OpenSharedMemory() michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRSharedMemory * ) michael@0: PR_OpenSharedMemory( michael@0: const char *name, michael@0: PRSize size, michael@0: PRIntn flags, michael@0: PRIntn mode michael@0: ) michael@0: { michael@0: if (!_pr_initialized) _PR_ImplicitInitialization(); michael@0: return( _PR_MD_OPEN_SHARED_MEMORY( name, size, flags, mode )); michael@0: } /* end PR_OpenSharedMemory() */ michael@0: michael@0: /* michael@0: ** FUNCTION: PR_AttachSharedMemory() michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( void * ) michael@0: PR_AttachSharedMemory( michael@0: PRSharedMemory *shm, michael@0: PRIntn flags michael@0: ) michael@0: { michael@0: return( _PR_MD_ATTACH_SHARED_MEMORY( shm, flags )); michael@0: } /* end PR_AttachSharedMemory() */ michael@0: michael@0: /* michael@0: ** FUNCTION: PR_DetachSharedMemory() michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRStatus ) michael@0: PR_DetachSharedMemory( michael@0: PRSharedMemory *shm, michael@0: void *addr michael@0: ) michael@0: { michael@0: return( _PR_MD_DETACH_SHARED_MEMORY( shm, addr )); michael@0: } /* end PR_DetachSharedMemory() */ michael@0: michael@0: /* michael@0: ** FUNCTION: PR_CloseSharedMemory() michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRStatus ) michael@0: PR_CloseSharedMemory( michael@0: PRSharedMemory *shm michael@0: ) michael@0: { michael@0: return( _PR_MD_CLOSE_SHARED_MEMORY( shm )); michael@0: } /* end PR_CloseSharedMemory() */ michael@0: michael@0: /* michael@0: ** FUNCTION: PR_DeleteSharedMemory() michael@0: ** michael@0: */ michael@0: PR_EXTERN( PRStatus ) michael@0: PR_DeleteSharedMemory( michael@0: const char *name michael@0: ) michael@0: { michael@0: if (!_pr_initialized) _PR_ImplicitInitialization(); michael@0: return(_PR_MD_DELETE_SHARED_MEMORY( name )); michael@0: } /* end PR_DestroySharedMemory() */ michael@0: /* end prshm.c */