pthread_getiopri_np or pthread_setiopri_np Subroutine

Purpose

Sets and gets the I/O priority of a specified pthread.

Library

Threads Library (libpthreads.a)

Syntax

#include <pthread.h>
#include <sys/extendio.h>

int pthread_getiopri_np( pthread *pri)
int pthread_setiopri_np( pthread pri)

pthread_t pthread;
iopri_t pri;

Description

The pthread_getiopri_np subroutine stores the I/O scheduling priority of the pthread into the pri argument. The pthread_setiopri_np subroutine sets the I/O scheduling priority to the pri argument of the specified pthread.

AIX® provides the ability to prioritize I/O buffers on a per-I/O and per-process basis. With the pthread_getiopri_np subroutine and the pthread_setiopri_np subroutine, AIX provides the ability to prioritize I/O buffers on a per-thread basis.

Note: Both subroutines are only supported in a System Scope (1:1) environment.

Parameters

Item Description
pthread Specifies the target thread.
pri I/O priority field used to set or store the current I/O priority of the pthread.

Return Values

Upon successful completion, the pthread_getiopri_np subroutine or the pthread_setiopri_np subroutine returns zero. A non-zero value indicates an error.

Error Codes

If any of the following conditions occur, the pthread_getiopri_np subroutine and the pthread_setiopri_np subroutine fail and return the corresponding value:

Item Description
ESRCH The provided pthread is not valid.
ENOTSUP This function was called in a Process Scope (M:N) environment.
EPERM The caller does not have the valid Role Based Access Control (RBAC) permissions (the ACT_P_GETPRI permission for the pthread_getiopri_np subroutine, the ACT_P_SETPRI permission for the pthread_setiopri_np subroutine).
EINVAL The specified I/O priority is not valid.