CH_MAP_DISC2(3)

EXPERIMENTAL_FUNC
ch_map_disc2 - Attempt to map a disc file, fallback to reading.

SYNOPSIS
#include <karma_ch.h>

Channel ch_map_disc2

(CONST char *filename, unsigned int option)

DESCRIPTION
This routine will attempt to open a memory channel with the memory pages being mapped from a disc file. The disc file must already exist. If memory mapping cannot be performed, a normal memory channel is created and the data is read in.

filename
    The pathname of the file to open.

option
    Control value which determines whether the channel is opened as an ordinary disc file or is mapped. See <-ch_MAP_CONTROLS-> for legal values. If the file is not mapped then the routine will attempt to open an ordinary disc channel. If the file is opened as a disc channel the access mode is: "rz".

RETURN VALUE
A channel object on success, else NULL.

Multi-threading Level
Unsafe.

NOTES
The channel may be queried to determine if it has been memory mapped using the call <<ch_test_for_mmap>>.

If the "CH_MMAP_DISABLE" environment variable is defined, then memory mapping is disabled.

Writing to the memory may cause a segmentation fault.

AUTHOR
Richard Gooch (rgooch@atnf.csiro.au)

AVAILABLITY
The Karma Distribution is available for anonymous ftp from: ftp://ftp.atnf.csiro.au/pub/software/karma/ ftp://wuarchive.wustl.edu/graphics/graphics/packages/karma/ ftp://ftp.pwr.wroc.pl/pub/karma/ The Karma Home Page is: http://www.atnf.csiro.au/karma/