swap.h 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. /* $OpenBSD: swap.h,v 1.7 2013/09/30 12:02:30 millert Exp $ */
  2. /* $NetBSD: swap.h,v 1.2 1998/09/13 14:46:24 christos Exp $ */
  3. /*
  4. * Copyright (c) 1995, 1996, 1998 Matthew R. Green, Tobias Weingartner
  5. * All rights reserved.
  6. *
  7. * Redistribution and use in source and binary forms, with or without
  8. * modification, are permitted provided that the following conditions
  9. * are met:
  10. * 1. Redistributions of source code must retain the above copyright
  11. * notice, this list of conditions and the following disclaimer.
  12. * 2. Redistributions in binary form must reproduce the above copyright
  13. * notice, this list of conditions and the following disclaimer in the
  14. * documentation and/or other materials provided with the distribution.
  15. * 3. The name of the author may not be used to endorse or promote products
  16. * derived from this software without specific prior written permission
  17. *
  18. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  19. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  20. * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  21. * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
  22. * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
  23. * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  24. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  25. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  26. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  27. * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. #ifndef _SYS_SWAP_H_
  30. #define _SYS_SWAP_H_
  31. #include <sys/syslimits.h>
  32. /* These structures are used to return swap information for userland */
  33. struct swapent {
  34. dev_t se_dev; /* device id */
  35. int se_flags; /* flags */
  36. int se_nblks; /* total blocks */
  37. int se_inuse; /* blocks in use */
  38. int se_priority; /* priority of this device */
  39. char se_path[PATH_MAX]; /* path name */
  40. };
  41. #ifdef _KERNEL
  42. #define NETDEV (dev_t)(-2) /* network device (for nfs swap) */
  43. #endif /* _KERNEL */
  44. #define SWAP_ON 1 /* begin swapping on device */
  45. #define SWAP_OFF 2 /* (stop swapping on device) */
  46. #define SWAP_NSWAP 3 /* how many swap devices ? */
  47. #define SWAP_STATS 4 /* get device info */
  48. #define SWAP_CTL 5 /* change priority on device */
  49. #define SWAP_DUMPDEV 7 /* use this device as dump device */
  50. #define SWF_INUSE 0x00000001 /* in use: we have swapped here */
  51. #define SWF_ENABLE 0x00000002 /* enabled: we can swap here */
  52. #define SWF_BUSY 0x00000004 /* busy: I/O happening here */
  53. #define SWF_FAKE 0x00000008 /* fake: still being built */
  54. #endif /* _SYS_SWAP_H_ */