1*61186Sbostic.\" Copyright (c) 1980, 1991, 1993 2*61186Sbostic.\" The Regents of the University of California. All rights reserved. 320161Smckusick.\" 443568Strent.\" %sccs.include.redist.man% 520161Smckusick.\" 6*61186Sbostic.\" @(#)swapon.2 8.1 (Berkeley) 06/04/93 738053Sbostic.\" 847208Scael.Dd 947208Scael.Dt SWAPON 2 1047208Scael.Os BSD 4 1147208Scael.Sh NAME 1247208Scael.Nm swapon 1347208Scael.Nd add a swap device for interleaved paging/swapping 1447208Scael.Sh SYNOPSIS 1547208Scael.Fd #include <unistd.h> 1647208Scael.Ft int 1747208Scael.Fn swapon "const char *special" 1847208Scael.Sh DESCRIPTION 1947208Scael.Fn Swapon 2020162Smckusickmakes the block device 2147208Scael.Fa special 2220162Smckusickavailable to the system for 2320162Smckusickallocation for paging and swapping. The names of potentially 2420162Smckusickavailable devices are known to the system and defined at system 2520162Smckusickconfiguration time. The size of the swap area on 2647208Scael.Fa special 2720162Smckusickis calculated at the time the device is first made available 2820162Smckusickfor swapping. 2947208Scael.Sh RETURN VALUES 3047208ScaelIf an error has occurred, a value of -1 is returned and 3147208Scael.Va errno 3226514Sdonnis set to indicate the error. 3347208Scael.Sh ERRORS 3447208Scael.Fn Swapon 3521004Smckusicksucceeds unless: 3647208Scael.Bl -tag -width ENAMETOOLONG 3747208Scael.It Bq Er ENOTDIR 3821004SmckusickA component of the path prefix is not a directory. 3947208Scael.It Bq Er EINVAL 4021004SmckusickThe pathname contains a character with the high-order bit set. 4147208Scael.It Bq Er ENAMETOOLONG 4221004SmckusickA component of a pathname exceeded 255 characters, 4321004Smckusickor an entire path name exceeded 1023 characters. 4447208Scael.It Bq Er ENOENT 4521004SmckusickThe named device does not exist. 4647208Scael.It Bq Er EACCES 4721004SmckusickSearch permission is denied for a component of the path prefix. 4847208Scael.It Bq Er ELOOP 4921004SmckusickToo many symbolic links were encountered in translating the pathname. 5047208Scael.It Bq Er EPERM 5121004SmckusickThe caller is not the super-user. 5247208Scael.It Bq Er ENOTBLK 5347208Scael.Fa Special 5424440Smckusickis not a block device. 5547208Scael.It Bq Er EBUSY 5647208ScaelThe device specified by 5747208Scael.Fa special 5847208Scaelhas already 5924440Smckusickbeen made available for swapping 6047208Scael.It Bq Er EINVAL 6147208ScaelThe device configured by 6247208Scael.Fa special 6347208Scaelwas not 6424440Smckusickconfigured into the system as a swap device. 6547208Scael.It Bq Er ENXIO 6624440SmckusickThe major device number of 6747208Scael.Fa special 6824440Smckusickis out of range (this indicates no device driver exists 6924440Smckusickfor the associated hardware). 7047208Scael.It Bq Er EIO 7124440SmckusickAn I/O error occurred while opening the swap device. 7247208Scael.It Bq Er EFAULT 7347208Scael.Fa Special 7424440Smckusickpoints outside the process's allocated address space. 7547208Scael.Sh SEE ALSO 7647208Scael.Xr swapon 8 , 7747208Scael.Xr config 8 7847208Scael.Sh BUGS 7920161SmckusickThere is no way to stop swapping on a disk so that the pack may be 8020161Smckusickdismounted. 8147208Scael.Pp 8220162SmckusickThis call will be upgraded in future versions of the system. 8347208Scael.Sh HISTORY 8447208ScaelThe 8547208Scael.Nm 8647208Scaelfunction call appeared in 8747208Scael.Bx 4.0 . 88