swapoff.c 427 B

123456789101112131415161718192021
  1. /* swapoff.c - Disable region for swapping
  2. *
  3. * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com>
  4. USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_SBIN|TOYFLAG_NEEDROOT))
  5. config SWAPOFF
  6. bool "swapoff"
  7. default y
  8. help
  9. usage: swapoff swapregion
  10. Disable swapping on a given swapregion.
  11. */
  12. #include "toys.h"
  13. void swapoff_main(void)
  14. {
  15. if (swapoff(toys.optargs[0])) perror_exit("failed to remove swaparea");
  16. }