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