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: ** prshma.h -- NSPR Anonymous Shared Memory michael@0: ** michael@0: ** michael@0: */ michael@0: michael@0: #include "primpl.h" michael@0: michael@0: extern PRLogModuleInfo *_pr_shma_lm; michael@0: michael@0: #if defined(XP_UNIX) michael@0: /* defined in pr/src/md/unix/uxshm.c */ michael@0: #elif defined(WIN32) michael@0: /* defined in pr/src/md/windows/w32shm.c */ michael@0: #else michael@0: extern PRFileMap * _PR_MD_OPEN_ANON_FILE_MAP( const char *dirName, PRSize size, PRFileMapProtect prot ) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return NULL; michael@0: } michael@0: extern PRStatus _PR_MD_EXPORT_FILE_MAP_AS_STRING(PRFileMap *fm, PRSize bufSize, char *buf) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return PR_FAILURE; michael@0: } michael@0: extern PRFileMap * _PR_MD_IMPORT_FILE_MAP_FROM_STRING(const char *fmstring) michael@0: { michael@0: PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0); michael@0: return NULL; michael@0: } michael@0: #endif michael@0: michael@0: /* michael@0: ** PR_OpenAnonFileMap() -- Creates an anonymous file-mapped shared memory michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT(PRFileMap*) michael@0: PR_OpenAnonFileMap( michael@0: const char *dirName, michael@0: PRSize size, michael@0: PRFileMapProtect prot michael@0: ) michael@0: { michael@0: return(_PR_MD_OPEN_ANON_FILE_MAP( dirName, size, prot )); michael@0: } /* end PR_OpenAnonFileMap() */ michael@0: michael@0: /* michael@0: ** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export michael@0: ** to my children processes via PR_CreateProcess() michael@0: ** michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRStatus) michael@0: PR_ProcessAttrSetInheritableFileMap( michael@0: PRProcessAttr *attr, michael@0: PRFileMap *fm, michael@0: const char *shmname michael@0: ) michael@0: { michael@0: PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); michael@0: return( PR_FAILURE); michael@0: } /* end PR_ProcessAttrSetInheritableFileMap() */ michael@0: michael@0: /* michael@0: ** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported michael@0: ** by my parent process via PR_CreateProcess() michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRFileMap *) michael@0: PR_GetInheritedFileMap( michael@0: const char *shmname michael@0: ) michael@0: { michael@0: PRFileMap *fm = NULL; michael@0: PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 ); michael@0: return( fm ); michael@0: } /* end PR_GetInhteritedFileMap() */ michael@0: michael@0: /* michael@0: ** PR_ExportFileMapAsString() -- Creates a string identifying a PRFileMap michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRStatus ) michael@0: PR_ExportFileMapAsString( michael@0: PRFileMap *fm, michael@0: PRSize bufSize, michael@0: char *buf michael@0: ) michael@0: { michael@0: return( _PR_MD_EXPORT_FILE_MAP_AS_STRING( fm, bufSize, buf )); michael@0: } /* end PR_ExportFileMapAsString() */ michael@0: michael@0: /* michael@0: ** PR_ImportFileMapFromString() -- Creates a PRFileMap from the identifying string michael@0: ** michael@0: ** michael@0: */ michael@0: PR_IMPLEMENT( PRFileMap * ) michael@0: PR_ImportFileMapFromString( michael@0: const char *fmstring michael@0: ) michael@0: { michael@0: return( _PR_MD_IMPORT_FILE_MAP_FROM_STRING(fmstring)); michael@0: } /* end PR_ImportFileMapFromString() */ michael@0: /* end prshma.c */