.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Linux::IO_Prio 3pm" .TH Linux::IO_Prio 3pm 2024-03-06 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Linux::IO_Prio \- Interface to Linux ioprio_set and ioprio_get via syscall or ionice wrapper. .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use Linux::IO_Prio qw(:all); \& \& my $status = ioprio_set(IOPRIO_WHO_PROCESS, $$, \& IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); \& \& my $status = ionice(IOPRIO_WHO_PROCESS, $$, IOPRIO_CLASS_IDLE, 0); .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Use \fBioprio_get\fR\|(2) and \fBioprio_set\fR\|(2) from Perl. Only Linux is supported currently. Support for other unices will be added once the kernel capabilities are available. .SH Exports .IX Header "Exports" Nothing by default. .PP The required exports can be specified individually or by tag: .IP ":ionice \-\- ionice ionice_data ionice_class" 4 .IX Item ":ionice -- ionice ionice_data ionice_class" .PD 0 .IP ":c_api \-\- ioprio_set ioprio_get" 4 .IX Item ":c_api -- ioprio_set ioprio_get" .IP ":macro \-\- IOPRIO_PRIO_VALUE IOPRIO_PRIO_CLASS IOPRIO_PRIO_DATA" 4 .IX Item ":macro -- IOPRIO_PRIO_VALUE IOPRIO_PRIO_CLASS IOPRIO_PRIO_DATA" .IP ":who \-\- IOPRIO_WHO_PROCESS IOPRIO_WHO_PGRP IOPRIO_WHO_USER" 4 .IX Item ":who -- IOPRIO_WHO_PROCESS IOPRIO_WHO_PGRP IOPRIO_WHO_USER" .IP ":class \-\- IOPRIO_CLASS_NONE IOPRIO_CLASS_RT IOPRIO_CLASS_BE IOPRIO_CLASS_IDLE" 4 .IX Item ":class -- IOPRIO_CLASS_NONE IOPRIO_CLASS_RT IOPRIO_CLASS_BE IOPRIO_CLASS_IDLE" .IP ":all \-\- all the above" 4 .IX Item ":all -- all the above" .PD .PP \&\fBionice()\fR, \fBionice_class()\fR and \fBionice_data()\fR are thin wrappers around the C API allowing conventient single function calls. All of the other exports have the same meaning and prototypes as the C API equivalents. See man \fBioprio_set\fR\|(2) for further details. .SS Functions .IX Subsection "Functions" \fIC API\fR .IX Subsection "C API" .ie n .IP "$priority = ioprio_get($which, $who)" 4 .el .IP "\f(CW$priority\fR = ioprio_get($which, \f(CW$who\fR)" 4 .IX Item "$priority = ioprio_get($which, $who)" .PD 0 .ie n .IP "$staus = ioprio_set($which, $who, $priority)" 4 .el .IP "\f(CW$staus\fR = ioprio_set($which, \f(CW$who\fR, \f(CW$priority\fR)" 4 .IX Item "$staus = ioprio_set($which, $who, $priority)" .PD .PP \fIWrappers\fR .IX Subsection "Wrappers" .ie n .IP "$status = ionice($which, $who, $class, $data)" 4 .el .IP "\f(CW$status\fR = ionice($which, \f(CW$who\fR, \f(CW$class\fR, \f(CW$data\fR)" 4 .IX Item "$status = ionice($which, $who, $class, $data)" .PD 0 .ie n .IP "$class = ionice_class($which, $who)" 4 .el .IP "\f(CW$class\fR = ionice_class($which, \f(CW$who\fR)" 4 .IX Item "$class = ionice_class($which, $who)" .ie n .IP "$data = ionice_data($which, $who)" 4 .el .IP "\f(CW$data\fR = ionice_data($which, \f(CW$who\fR)" 4 .IX Item "$data = ionice_data($which, $who)" .PD .SS MACROS .IX Subsection "MACROS" .ie n .IP "$priority = IOPRIO_PRIO_VALUE($class, $data)" 4 .el .IP "\f(CW$priority\fR = IOPRIO_PRIO_VALUE($class, \f(CW$data\fR)" 4 .IX Item "$priority = IOPRIO_PRIO_VALUE($class, $data)" .PD 0 .ie n .IP "$class = IOPRIO_PRIO_CLASS($mask)" 4 .el .IP "\f(CW$class\fR = IOPRIO_PRIO_CLASS($mask)" 4 .IX Item "$class = IOPRIO_PRIO_CLASS($mask)" .ie n .IP "$data = IOPRIO_PRIO_DATA ($mask)" 4 .el .IP "\f(CW$data\fR = IOPRIO_PRIO_DATA ($mask)" 4 .IX Item "$data = IOPRIO_PRIO_DATA ($mask)" .PD .SS CONSTANTS .IX Subsection "CONSTANTS" .IP IOPRIO_WHO_PROCESS 4 .IX Item "IOPRIO_WHO_PROCESS" .PD 0 .IP IOPRIO_WHO_PGRP 4 .IX Item "IOPRIO_WHO_PGRP" .IP IOPRIO_WHO_USER 4 .IX Item "IOPRIO_WHO_USER" .IP IOPRIO_CLASS_NONE 4 .IX Item "IOPRIO_CLASS_NONE" .IP IOPRIO_CLASS_RT 4 .IX Item "IOPRIO_CLASS_RT" .IP IOPRIO_CLASS_BE 4 .IX Item "IOPRIO_CLASS_BE" .IP IOPRIO_CLASS_IDLE 4 .IX Item "IOPRIO_CLASS_IDLE" .PD .SH COPYRIGHT .IX Header "COPYRIGHT" This module is Copyright (c) 2011 Mark Hindley .PP All rights reserved. .PP You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. If you need more liberal licensing terms, please contact the maintainer. .SH WARRANTY .IX Header "WARRANTY" This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND. .SH AUTHOR .IX Header "AUTHOR" Mark Hindley