Mercurial > hg > toybox
view toys/swapoff.c @ 649:2364ace48ab1
Bugfix from Avery Pennarun: getpriority() uses a different range than nice(), so follow thenice man page and zero errno then check it if nice returns -1.
author | Rob Landley <rob@landley.net> |
---|---|
date | Thu, 16 Aug 2012 22:24:30 -0500 |
parents | b4a9fd8773d6 |
children |
line wrap: on
line source
/* vi: set sw=4 ts=4: * * swapoff.c - Disable region for swapping * * Copyright 2012 Elie De Brauwer <eliedebrauwer@gmail.com> * * Not in SUSv4. USE_SWAPOFF(NEWTOY(swapoff, "<1>1", TOYFLAG_BIN|TOYFLAG_NEEDROOT)) config SWAPOFF bool "swapoff" default y help usage: swapoff swapregion Disable swapping on a given swapregion. */ #include "toys.h" void swapoff_main(void) { if (swapoff(toys.optargs[0])) perror_exit("failed to remove swaparea"); }