Linux::Sysfs - Perl interface to libsysfs


Linux-Sysfs documentation Contained in the Linux-Sysfs distribution.

Index


Code Index:

NAME

Top

Linux::Sysfs - Perl interface to libsysfs

VERSION

Top

Version 0.03

SYNOPSIS

Top

    use Linux::Sysfs;

    my $path = Linux::Sysfs->get_mnt_path();

    my $module = Linux::Sysfs::Module->open('usbcore');
    my @parms  = $module->get_sections;

    $module->close;

DESCRIPTION

Top

Linux::Sysfs' purpose is to provide a consistent and stable interface for querying system device information exposed through the sysfs filesystem. The library implements functions for querying filesystem information, such as reading directories and files. It also contains routines for working with buses, classes, and the device tree.

The functionality of this module is split up between several packages. See the other packages under the Linux::Sysfs:: namespace for the full documentation.

EXPORT

Top

The following libsysfs constants may be imported.

$FSTYPE_NAME
$PROC_MNTS
$BUS_NAME
$CLASS_NAME
$BLOCK_NAME
$DEVICES_NAME
$DRIVERS_NAME
$MODULE_NAME
$NAME_ATTRIBUTE
$MOD_PARM_NAME
$MOD_SECT_NAME
$UNKNOWN
$PATH_ENV

All constants will be exported when using the ':all' tag when importing.

FUNCTIONS

Top

get_mnt_path

  my $path = Linux::Sysfs->get_mnt_path();

Finds the mount path for filesystem type "sysfs". Returns undef on failure.

DEPENDENCIES

Top

Linux::Sysfs requires libsysfs version 2.0.0 or later. See http://linux-diag.sourceforge.net/Sysfsutils.html.

INCOMPATIBILITIES

Top

This module currently doesn't work with any version of libsysfs smaller than 2.0.0.

BUGS AND LIMITATIONS

Top

In the current implementation of Linux::Sysfs it's not possible to free the objects when they get destroyed automatically. Therefor you should care about calling close() for each object when you don't need it anymore.

SEE ALSO

Top

Linux::Sysfs::Attribute

Linux::Sysfs::Bus

Linux::Sysfs::Class

Linux::Sysfs::ClassDevice

Linux::Sysfs::Device

Linux::Sysfs::Driver

Linux::Sysfs::Module

AUTHOR

Top

Florian Ragwitz <rafl@debian.org>

BUGS

Top

Please report any bugs or feature requests to <bug-linux-sysfs@rt.cpan.org>, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Linux-Sysfs. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

Top

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

    perldoc Linux::Sysfs

You can also look for information at:

* AnnoCPAN: Annotated CPAN documentation

http://annocpan.org/dist/Linux-Sysfs

* CPAN Ratings

http://cpanratings.perl.org/d/Linux-Sysfs

* RT: CPAN's request tracker

http://rt.cpan.org/NoAuth/Bugs.html?Dist=Linux-Sysfs

* Search CPAN

http://search.cpan.org/dist/Linux-Sysfs

LICENSE AND COPYRIGHT

Top


Linux-Sysfs documentation Contained in the Linux-Sysfs distribution.

package Linux::Sysfs;

use strict;
use warnings;
require Exporter;

our $VERSION = '0.03';
our @ISA     = qw(Exporter);

our @EXPORT_OK = qw(
        $FSTYPE_NAME
        $PROC_MNTS
        $BUS_NAME
        $CLASS_NAME
        $BLOCK_NAME
        $DEVICES_NAME
        $DRIVERS_NAME
        $MODULE_NAME
        $NAME_ATTRIBUTE
        $MOD_PARM_NAME
        $MOD_SECT_NAME
        $UNKNOWN
        $PATH_ENV
);

our %EXPORT_TAGS = ( all => \@EXPORT_OK );

eval {
    require XSLoader;
    XSLoader::load( 'Linux::Sysfs', $VERSION );
    1;
} or do {
    require DynaLoader;
    push @ISA, 'DynaLoader';
    Linux::Sysfs->bootstrap($VERSION);
};

1;

__END__