nsprpub/pr/src/memory/prshma.c

Wed, 31 Dec 2014 06:55:46 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:55:46 +0100
changeset 1
ca08bd8f51b2
permissions
-rw-r--r--

Added tag TORBROWSER_REPLICA for changeset 6474c204b198

michael@0 1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
michael@0 2 /* This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 5
michael@0 6 /*
michael@0 7 ** prshma.h -- NSPR Anonymous Shared Memory
michael@0 8 **
michael@0 9 **
michael@0 10 */
michael@0 11
michael@0 12 #include "primpl.h"
michael@0 13
michael@0 14 extern PRLogModuleInfo *_pr_shma_lm;
michael@0 15
michael@0 16 #if defined(XP_UNIX)
michael@0 17 /* defined in pr/src/md/unix/uxshm.c */
michael@0 18 #elif defined(WIN32)
michael@0 19 /* defined in pr/src/md/windows/w32shm.c */
michael@0 20 #else
michael@0 21 extern PRFileMap * _PR_MD_OPEN_ANON_FILE_MAP( const char *dirName, PRSize size, PRFileMapProtect prot )
michael@0 22 {
michael@0 23 PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
michael@0 24 return NULL;
michael@0 25 }
michael@0 26 extern PRStatus _PR_MD_EXPORT_FILE_MAP_AS_STRING(PRFileMap *fm, PRSize bufSize, char *buf)
michael@0 27 {
michael@0 28 PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
michael@0 29 return PR_FAILURE;
michael@0 30 }
michael@0 31 extern PRFileMap * _PR_MD_IMPORT_FILE_MAP_FROM_STRING(const char *fmstring)
michael@0 32 {
michael@0 33 PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);
michael@0 34 return NULL;
michael@0 35 }
michael@0 36 #endif
michael@0 37
michael@0 38 /*
michael@0 39 ** PR_OpenAnonFileMap() -- Creates an anonymous file-mapped shared memory
michael@0 40 **
michael@0 41 */
michael@0 42 PR_IMPLEMENT(PRFileMap*)
michael@0 43 PR_OpenAnonFileMap(
michael@0 44 const char *dirName,
michael@0 45 PRSize size,
michael@0 46 PRFileMapProtect prot
michael@0 47 )
michael@0 48 {
michael@0 49 return(_PR_MD_OPEN_ANON_FILE_MAP( dirName, size, prot ));
michael@0 50 } /* end PR_OpenAnonFileMap() */
michael@0 51
michael@0 52 /*
michael@0 53 ** PR_ProcessAttrSetInheritableFileMap() -- Prepare FileMap for export
michael@0 54 ** to my children processes via PR_CreateProcess()
michael@0 55 **
michael@0 56 **
michael@0 57 */
michael@0 58 PR_IMPLEMENT( PRStatus)
michael@0 59 PR_ProcessAttrSetInheritableFileMap(
michael@0 60 PRProcessAttr *attr,
michael@0 61 PRFileMap *fm,
michael@0 62 const char *shmname
michael@0 63 )
michael@0 64 {
michael@0 65 PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
michael@0 66 return( PR_FAILURE);
michael@0 67 } /* end PR_ProcessAttrSetInheritableFileMap() */
michael@0 68
michael@0 69 /*
michael@0 70 ** PR_GetInheritedFileMap() -- Import a PRFileMap previously exported
michael@0 71 ** by my parent process via PR_CreateProcess()
michael@0 72 **
michael@0 73 */
michael@0 74 PR_IMPLEMENT( PRFileMap *)
michael@0 75 PR_GetInheritedFileMap(
michael@0 76 const char *shmname
michael@0 77 )
michael@0 78 {
michael@0 79 PRFileMap *fm = NULL;
michael@0 80 PR_SetError( PR_NOT_IMPLEMENTED_ERROR, 0 );
michael@0 81 return( fm );
michael@0 82 } /* end PR_GetInhteritedFileMap() */
michael@0 83
michael@0 84 /*
michael@0 85 ** PR_ExportFileMapAsString() -- Creates a string identifying a PRFileMap
michael@0 86 **
michael@0 87 */
michael@0 88 PR_IMPLEMENT( PRStatus )
michael@0 89 PR_ExportFileMapAsString(
michael@0 90 PRFileMap *fm,
michael@0 91 PRSize bufSize,
michael@0 92 char *buf
michael@0 93 )
michael@0 94 {
michael@0 95 return( _PR_MD_EXPORT_FILE_MAP_AS_STRING( fm, bufSize, buf ));
michael@0 96 } /* end PR_ExportFileMapAsString() */
michael@0 97
michael@0 98 /*
michael@0 99 ** PR_ImportFileMapFromString() -- Creates a PRFileMap from the identifying string
michael@0 100 **
michael@0 101 **
michael@0 102 */
michael@0 103 PR_IMPLEMENT( PRFileMap * )
michael@0 104 PR_ImportFileMapFromString(
michael@0 105 const char *fmstring
michael@0 106 )
michael@0 107 {
michael@0 108 return( _PR_MD_IMPORT_FILE_MAP_FROM_STRING(fmstring));
michael@0 109 } /* end PR_ImportFileMapFromString() */
michael@0 110 /* end prshma.c */

mercurial