swapctl.2 (2010 09)

s
swapctl(2) swapctl(2)
exit(1);
}
/* list the swap device configured above */
swent.ste_path = path;
swt.swt_n = 1;
swt.swt_flags = SW_PRIMARY | SW_NEXTBOOT;
swt.swt_ent = &swent;
rv = swapctl(SC_LIST, (void *)&swt);
if (rv != 1) { /* returns the number of swap devices returned */
printf("swapctl/SC_LIST returned: %d \n", rv);
perror("swapctl/SC_LIST failed");
exit(2);
}
printf("Primary swap for next boot: %s \n", swent.ste_path);
/* Remove the above configured primary swap */
swp.sr_flag = SW_PRIMARY | SW_NEXTBOOT;
swp.sr_name = path; /* same path as used for SC_ADD */
swp.sr_start = 0; /* same start as used for SC_ADD */
swp.sr_length = 0; /* same length as used for SC_ADD */
swp.sr_priority = 1;
rv = swapctl(SC_REMOVE, (void *)&swp);
if (rv) {
perror("swapctl/SC_REMOVE failed");
exit(3);
}
return 0;
}
WARNINGS
If swapctl() is used for configuring primary swap, other methods for configuring primary swap like
lvlnboot, vxvmboot, and system configuration files (see lvlnboot (1M), vxvmboot (1M), and system(4)),
and PA HP-UX boot loader mechanism will become ineffective. In other words, if a device is configured
for primary swap using
swapctl(), then other device(s) that are configured for primary swap using the
above mentioned methods will not be effective.
The
lvlnboot, vxvmboot, and system configuration file methods for configuring swap are deprecated
and will be obsoleted in future releases.
AUTHOR
swapctl() was developed by HP.
SEE ALSO
hpux(1M), lvlnboot(1M), vxvmboot(1M), swapctl(2), system(4), swchunk(5).
HP-UX 11i Version 3: September 2010 5 Hewlett-Packard Company 5