1 diff --git a/mount/swapon.c b/mount/swapon.c
2 index a8e5cc1..e5f945e 100644
11 #include "swap_constants.h"
16 +#ifdef HAVE_SYS_SWAP_H
17 +# include <sys/swap.h>
20 +#ifndef SWAPON_HAS_TWO_ARGS
21 +/* libc is insane, let's call the kernel */
22 +# include <sys/syscall.h>
23 +# define swapon(path, flags) syscall(SYS_swapon, path, flags)
24 +# define swapoff(path) syscall(SYS_swapoff, path)
27 #define streq(s, t) (strcmp ((s), (t)) == 0)
29 #define _PATH_FSTAB "/etc/fstab"
30 #define PROC_SWAPS "/proc/swaps"
32 -#ifdef SWAPON_HAS_TWO_ARGS
33 -# include <asm/page.h>
34 -# include <sys/swap.h>
37 -#define SWAPON_NEEDS_TWO_ARGS
42 @@ -75,24 +80,6 @@ swapoff_usage(FILE *fp, int n) {
46 -#ifdef SWAPON_HAS_TWO_ARGS
47 -#define SWAPON_NEEDS_TWO_ARGS
50 -#if defined(SWAPON_NEEDS_TWO_ARGS) && !defined(SWAPON_HAS_TWO_ARGS)
51 -/* We want a swapon with two args, but have an old libc.
52 - Build the kernel call by hand. */
53 -#include <linux/unistd.h>
55 -_syscall2(int, swapon, const char *, path, int, flags);
57 -_syscall1(int, swapoff, const char *, path);
59 -/* just do as libc says */
65 * contents of /proc/swaps
67 @@ -219,7 +206,6 @@ do_swapon(const char *orig_special, int prio) {
71 -#ifdef SWAPON_NEEDS_TWO_ARGS
75 @@ -234,9 +220,7 @@ do_swapon(const char *orig_special, int prio) {
77 status = swapon(special, flags);
80 - status = swapon(special);
85 fprintf(stderr, "%s: %s: %s\n",