155682Smarkm/* $OpenBSD: swap.h,v 1.7 2013/09/30 12:02:30 millert Exp $ */ 278527Sassar/* $NetBSD: swap.h,v 1.2 1998/09/13 14:46:24 christos Exp $ */ 355682Smarkm 455682Smarkm/* 555682Smarkm * Copyright (c) 1995, 1996, 1998 Matthew R. Green, Tobias Weingartner 655682Smarkm * All rights reserved. 755682Smarkm * 855682Smarkm * Redistribution and use in source and binary forms, with or without 955682Smarkm * modification, are permitted provided that the following conditions 1055682Smarkm * are met: 1155682Smarkm * 1. Redistributions of source code must retain the above copyright 1255682Smarkm * notice, this list of conditions and the following disclaimer. 1355682Smarkm * 2. Redistributions in binary form must reproduce the above copyright 1455682Smarkm * notice, this list of conditions and the following disclaimer in the 1555682Smarkm * documentation and/or other materials provided with the distribution. 1655682Smarkm * 3. The name of the author may not be used to endorse or promote products 1755682Smarkm * derived from this software without specific prior written permission 1855682Smarkm * 1955682Smarkm * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR 2055682Smarkm * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 2155682Smarkm * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 2255682Smarkm * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, 2355682Smarkm * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 2455682Smarkm * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2555682Smarkm * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2655682Smarkm * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2755682Smarkm * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 2855682Smarkm * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2955682Smarkm */ 3055682Smarkm 3155682Smarkm#ifndef _SYS_SWAP_H_ 3255682Smarkm#define _SYS_SWAP_H_ 3355682Smarkm 3455682Smarkm#include <sys/syslimits.h> 3555682Smarkm 3678527Sassar/* These structures are used to return swap information for userland */ 3755682Smarkmstruct swapent { 3855682Smarkm dev_t se_dev; /* device id */ 3955682Smarkm int se_flags; /* flags */ 4055682Smarkm int se_nblks; /* total blocks */ 4178527Sassar int se_inuse; /* blocks in use */ 4255682Smarkm int se_priority; /* priority of this device */ 4378527Sassar char se_path[PATH_MAX]; /* path name */ 4455682Smarkm}; 4555682Smarkm 4655682Smarkm#ifdef _KERNEL 4755682Smarkm#define NETDEV (dev_t)(-2) /* network device (for nfs swap) */ 4855682Smarkm#endif /* _KERNEL */ 4955682Smarkm 5055682Smarkm#define SWAP_ON 1 /* begin swapping on device */ 5155682Smarkm#define SWAP_OFF 2 /* (stop swapping on device) */ 5255682Smarkm#define SWAP_NSWAP 3 /* how many swap devices ? */ 5355682Smarkm#define SWAP_STATS 4 /* get device info */ 5455682Smarkm#define SWAP_CTL 5 /* change priority on device */ 5555682Smarkm#define SWAP_DUMPDEV 7 /* use this device as dump device */ 5655682Smarkm 5755682Smarkm#define SWF_INUSE 0x00000001 /* in use: we have swapped here */ 5855682Smarkm#define SWF_ENABLE 0x00000002 /* enabled: we can swap here */ 5955682Smarkm#define SWF_BUSY 0x00000004 /* busy: I/O happening here */ 6055682Smarkm#define SWF_FAKE 0x00000008 /* fake: still being built */ 6155682Smarkm 6255682Smarkm#endif /* _SYS_SWAP_H_ */ 6355682Smarkm