Leon Timmermans > Sys-Mmap-Simple > Sys::Mmap::Simple

Download:
Sys-Mmap-Simple-0.14.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  1
View Bugs
Report a bug
Module Version: 0.14   Source  

NAME ^

Sys::Mmap::Simple - Memory mapping made simple and safe.

VERSION ^

Version 0.14

SYNOPSIS ^

 use Sys::Mmap::Simple ':MAP';
 
 map_file my $mmap, $filename;
 if ($mmap ne "foobar") {
     $mmap =~ s/bar/quz/g;
 }

DESCRIPTION ^

This module is deprecated in favor of File::Map, its use is discouraged. It's nothing more than a thin compatibility layer.

FUNCTIONS ^

Mapping

The following functions for mapping a variable are available for exportation. They all take an lvalue as their first argument, except page_size.

Locking

These locking functions provide locking for threads for the mapped region. The mapped region has an internal lock and condition variable. The condition variable functions(wait_until, notify, broadcast) can only be used inside a locked block. If your perl has been compiled without thread support the condition functions will not be available, and locked will execute its block without locking.

CONSTANTS

PROT_NONE, PROT_READ, PROT_WRITE, PROT_EXEC, MAP_ANONYMOUS, MAP_SHARED, MAP_PRIVATE, MAP_ANON, MAP_FILE

These constants are used for sys_map. If you think you need them your mmap manpage will explain them, but in most cases you can skip sys_map altogether.

EXPORTS ^

All previously mentioned functions are available for exportation, but none are exported by default. Some functions may not be available on your OS or your version of perl as specified above. A number of tags are defined to make importation easier.

DIAGNOSTICS ^

If you use warnings, this module will give warnings if the variable is improperly used (anything that changes its size). This can be turned off lexically by using no warnings 'substr'.

If an error occurs in any of these functions, an exception will be thrown. In particular; trying to sync, remap, unmap, pin, unpin, advise or do locked a variable that hasn't been mapped will cause an exception to be thrown.

DEPENDENCIES ^

This module does not have any dependencies on non-standard modules.

PITFALLS ^

You probably don't want to use > as a mode. This does not give you reading permissions on many architectures, resulting in segmentation faults (more confusingly, it will work on some others).

BUGS AND LIMITATIONS ^

As any piece of software, bugs are likely to exist here. Bug reports are welcome.

Please report any bugs or feature requests to bug-sys-mmap-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Sys-Mmap-Simple. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SEE ALSO ^

AUTHOR ^

Leon Timmermans, <leont at cpan.org>

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Sys::Mmap::Simple

You can also look for information at:

COPYRIGHT AND LICENSE ^

Copyright 2008, 2009 Leon Timmermans, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as perl itself.