swapoff Subroutine

Purpose

Deactivates paging or swapping to a designated block device.

Library

Standard C Library (libc.a)

Syntax

int swapoff (PathName)
char *PathName;

Description

The swapoff subroutine deactivates a block device or logical volume that is actively being used for paging and swapping. There must be sufficient space to satisfy the system's paging space requirements in the remaining devices after this device is deactivated or swapoff will fail. Sufficient space must accommodate the current system-wide paging space usage and the npswarn value. Refer to the swap command for information on current system-wide paging space usage. Refer to the npswarn tunable parameter of the vmo command, and Values for the npswarn and npskill paramaters for information on the npswarn value.

Parameters

Item Description
PathName Specifies the full path name of the block device or logical volume.

Error Codes

If an error occurs, the errno global variable is set to indicate the error:

Item Description
EBUSY The deactivation is already running.
EINTR The signal was received during the processing of a request.
ENODEV The PathName file does not exist.
ENOMEM No memory is available.
ENOSPC There is not enough space in other paging spaces to satisfy the system's requirements.
ENOTBLK The device must be a block device or logical volume.
ENOTDIR A component of the PathName prefix is not a directory.
EPERM Caller does not have proper authority.

Other errors are from calls to the device driver's open subroutine or ioctl subroutine.