Linux::IO_Prio(3pm)

πŸ“¦
version 0.03 Β· 5 versions
, in ubuntu resolute, ubuntu stonking

πŸ’– Linux::IO_Prio πŸ’–

okay bestie, so this is a Perl module β€” it lives in the User Contributed Perl Documentation section, and its whole personality is being a lil bridge between your Perl code and Linux's ioprio_set and ioprio_get syscalls. whether you go raw syscall or use the ionice wrapper, it's got you 🫢


🌸 NAME 🌸

Linux::IO_Prio β€” it's the interface to Linux's ioprio_set and ioprio_get, reachable either via syscall or via the ionice wrapper. that's the whole vibe. no cap. ✨


πŸŽ€ SYNOPSIS πŸŽ€

like, here's the tea in actual code:

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);

look at her go. two whole ways to say the same thing, and she ate both times πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so literally, this module lets you call ioprio_get(2) and ioprio_set(2) straight from Perl. only Linux is supported right now β€” that's it, that's the current roster. support for other unices is coming eventually, but only once the kernel capabilities actually exist, so don't hold your breath, bestie 😭

✨ Exports ✨

default situation? nothing. zero. nada. you get nothing unless you ask, which honestly? iconic behavior. ask for what you want, individually or by tag:

  • :ionice β€” ionice ionice_data ionice_class
  • :c_api β€” ioprio_set ioprio_get
  • :macro β€” IOPRIO_PRIO_VALUE IOPRIO_PRIO_CLASS IOPRIO_PRIO_DATA
  • :who β€” IOPRIO_WHO_PROCESS IOPRIO_WHO_PGRP IOPRIO_WHO_USER
  • :class β€” IOPRIO_CLASS_NONE IOPRIO_CLASS_RT IOPRIO_CLASS_BE IOPRIO_CLASS_IDLE
  • :all β€” literally all the above 🫢

so ionice(), ionice_class() and ionice_data() are thin little wrappers around the C API, and the whole point is letting you make convenient single function calls instead of doing the most. every other export means the exact same thing and has the exact same prototype as its C API equivalent. for the deep lore, go read man ioprio_set(2). πŸ“

πŸ’œ Functions πŸ’œ

C API:

$priority = ioprio_get($which, $who)
$staus = ioprio_set($which, $who, $priority)
yes, that's $staus up there, not $status β€” that's fr fr how it's written in the source and we do not touch the source. keeping it exactly as-is πŸ’€

Wrappers:

$status = ionice($which, $who, $class, $data)
$class = ionice_class($which, $who)
$data = ionice_data($which, $who)

🌈 MACROS 🌈

$priority = IOPRIO_PRIO_VALUE($class, $data)
$class = IOPRIO_PRIO_CLASS($mask)
$data = IOPRIO_PRIO_DATA ($mask)

⭐ CONSTANTS ⭐

  • IOPRIO_WHO_PROCESS
  • IOPRIO_WHO_PGRP
  • IOPRIO_WHO_USER
  • IOPRIO_CLASS_NONE
  • IOPRIO_CLASS_RT
  • IOPRIO_CLASS_BE
  • IOPRIO_CLASS_IDLE

seven little constants, all lined up, all ready to vibe check your I/O priority πŸ‘‘


this module is Copyright (c) 2011 Mark Hindley

all rights reserved, periodt.

you may distribute it under the terms of either the GNU General Public License or the Artistic License, exactly as specified in the Perl README file. and if you need more liberal licensing terms than that? bestie, just contact the maintainer. πŸ’Œ


πŸ’€ WARRANTY πŸ’€

this is free software. IT COMES WITHOUT WARRANTY OF ANY KIND. all caps, all drama, all facts. don't come for her if it breaks 😭


🧚 AUTHOR 🧚

Mark Hindley <mark@hindley.org.uk>


and that's a wrap on this page, babes ✨ it was written up for perl v5.40.1, dated 2025-08-10, and it lives its life under the name Linux::IO_Prio(3pm) β€” the manual for a little module that is honestly so real. go set some I/O priorities, you main character πŸŒΈπŸ’…

πŸ“¦ where this page comes from