Reference: IVECreateArena
Overview
Creates a shared memory segment.
Prototype (C)
#include "ive_shm.h"
IVEArena IVECreateArena(const char* filename, IVEArenaAttr attr, int fail_if_exist, int* p_status);
Prototype (Fortran)
There is no Fortran interface.
Parameters
- filename
- filename is the name to use for the
shared memory segment. As currently implemented, this name must be that
of a regular disk file (not a device file).
- attr
- attr specifies the attributes of the
arena. If attr is zero (NULL), the default attributes are
used.
- fail_if_exist
- Only has an effect if filename
exists. If fail_if_exist is true, then
the function call will fail if filename exists. If
fail_if_exist is false and filename exists, the
function will act as IVEAttachArena
does if filename appears to be a valid shared memory file
or will overwrite filename if it does not appear to be a
valid shared memory file.
- p_status
- If the call to IVECreateArena returns zero,
then *p_status will be set to one of the values listed
below if p_status is not zero.
- IVE_ERR_NO_MEM
- There was insufficient memory available to
complete the operation.
- IVE_ERR_NO_SPC
- There was insufficient disk space to create
a lock file.
- IVE_ERR_NO_RESOURCES
- There was insufficient system resources
available (other than memory) to complete the operation.
- IVE_ERR_IN_USE
- Another thread was in the process of creating
or attaching to filename.
- IVE_ERR_TIMEOUT
- The operation could not be completed because
it was interrupted too many times by signals or access to a remote
filesystem timed out.
- IVE_ERR_IO
- The operation could not be completed because an
I/O error occurred.
- IVE_ERR_NO_PERMISSION
- The caller does not have sufficient
privileges to access filename or it is in a read-only
filesystem.
- IVE_ERR_EXIST
- fail_if_exist is true, and a file
whose file name is filename is present.
- IVE_ERR_UNSUPPORTED
- The file size is not supported by the
file system or the other operations to create the shared memory segment
are not supported by the operating system.
- IVE_ERR_INVALID
- The size of the arena specified by attr
is too small to hold the arena header.
- IVE_ERR_BAD_FILENAME
- filename does not exist or
is a directory.
- IVE_ERR_INTERNAL
- An error internal to the library was detected.
This is most likely because of a bug in the library.
- IVE_ERR_UNRECOGNIZED
- The operating system or system library
returned an error code that was not expected.
Return value
If the function call fails, zero is returned. Otherwise, a non-zero
value is returned. When the application is done with the arena, it can
destroy it with IVEDestroyArena or just
detach from it with IVEDetachArena.
Cross references
IVEDestroyArena,
IVEAttachArena,
IVEDetachArena,
IVEArena, and
IVEArenaAttr
| categories
| alphabetical
|
modified July 1, 2001
Eric Branlund (eric@msg.ucsf.edu)