[ Previous | Next | Contents | Glossary | Home | Search ]
AIX Version 4.3 Base Operating System and Extensions Technical Reference, Volume 2

swapon Subroutine


Activates paging or swapping to a designated block device.


Standard C Library (libc.a)


int swapon (PathName)
char *PathName;


The swapon subroutine makes the designated block device available to the system for allocation for paging and swapping.

The specified block device must be a logical volume on a disk device. The paging space size is determined from the current size of the logical volume.


PathName Specifies the full path name of the block device.

Error Codes

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

EINTR Signal was received during processing of a request.
EINVAL Invalid argument (size of device is invalid).
ENOENT The PathName file does not exist.
ENOMEM The maximum number of paging space devices (16) are already defined, or no memory is available.
ENOTBLK Block device required.
ENOTDIR A component of the PathName prefix is not a directory.
ENXIO No such device address.

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

Implementation Specifics

This subroutine is part of Base Operating System (BOS) Runtime.

Related Information

The swapqry subroutine.

The swapon command.

The Subroutines Overview in AIX Version 4.3 General Programming Concepts: Writing and Debugging Programs.

[ Previous | Next | Contents | Glossary | Home | Search ]