---
name: "Linux::IO_Prio"
section: "3pm"
platform: "linux"
package: "liblinux-io-prio-perl"
version: "0.03-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Linux::IO_Prio"
---

# Linux::IO\_Prio(3pm)

Interface to Linux ioprio\_set and ioprio\_get via syscall or ionice wrapper.

## NAME

Linux::IO\_Prio - Interface to Linux ioprio\_set and ioprio\_get via syscall or ionice wrapper.

## SYNOPSIS

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

## DESCRIPTION

Use [**ioprio\_get**(2)](/ioprio_get/2.md) and [**ioprio\_set**(2)](/ioprio_set/2.md) from Perl.  Only Linux is supported currently. Support for other unices will be added once the kernel capabilities are available.

## Exports

Nothing by default.

The required exports can be specified 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 -- all the above

  **ionice()**, **ionice\_class()** and **ionice\_data()** 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 [**ioprio\_set**(2)](/ioprio_set/2.md) for further details.

### Functions

*C API*

- $priority = ioprio\_get($which, $who)

  - $staus = ioprio\_set($which, $who, $priority)

  *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

  ## COPYRIGHT

This module is Copyright (c) 2011 Mark Hindley

All rights reserved.

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.

## WARRANTY

This is free software. IT COMES WITHOUT WARRANTY OF ANY KIND.

## AUTHOR

Mark Hindley \<mark@hindley.org.uk\>
