* Copyright (c) 1980 Regents of the University of California.
* All rights reserved. The Berkeley software License Agreement
* specifies the terms and conditions for redistribution.
"@(#) Copyright (c) 1980 Regents of the University of California.\n\
static char sccsid
[] = "@(#)swapon.c 5.2 (Berkeley) %G%";
fprintf(stderr
, "usage: swapon name...\n");
if (argc
== 1 && !strcmp(*argv
, "-a")) {
while ( (fsp
= getfsent()) != 0){
if (strcmp(fsp
->fs_type
, FSTAB_SW
) != 0)
if (swapon(fsp
->fs_spec
) == -1) {
"%s: Device not configured\n",
case EBUSY
: /* ignore already in use */
printf("Adding %s as swap device\n",
if (swapon(*argv
++) == -1) {
fprintf(stderr
, "%s: Device not configured\n",
fprintf(stderr
, "%s: Device already in use\n",