This is the mail archive of the
libc-hacker@sourceware.cygnus.com
mailing list for the glibc project.
Patch for <sys/swap.h>
- To: libc-hacker@cygnus.com
- Subject: Patch for <sys/swap.h>
- From: Andreas Jaeger <aj@arthur.rhein-neckar.de>
- Date: Fri, 2 Oct 1998 16:34:40 +0200 (CEST)
Compiling the following test program:
#include <sys/swap.h>
int
main(void)
{
}
fails since recent Linux kernels need PAGE_SIZE in <linux/swap.h>:
In file included from /usr/include/sys/swap.h:26,
from test-swap.c:1:
/usr/include/linux/swap.h:13: `PAGE_SIZE' undeclared here (not in a function)
/usr/include/linux/swap.h:13: size of array `reserved' has non-integer type
Instead of including <linux/swap.h>, I propose to add the three flags
from <linux/swap.h> directly to <sys/swap.h> for glibc 2.0 and glibc
2.1.
Andreas
1998-10-02 Andreas Jaeger <aj@arthur.rhein-neckar.de>
* sysdeps/unix/sysv/linux/sys/swap.h (SWAP_FLAG_PREFER,
SWAP_FLAG_PRIO_MASK,SWAP_FLAG_PRIO_SHIFT): Added.
Remove inclusion of <linux/swap.h>.
--- sysdeps/unix/sysv/linux/sys/swap.h.~1~ Sat Jan 17 11:04:52 1998
+++ sysdeps/unix/sysv/linux/sys/swap.h Fri Oct 2 16:32:25 1998
@@ -1,5 +1,5 @@
/* Calls to enable and disable swapping on specified locations. Linux version.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 1998 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
@@ -22,8 +22,12 @@
#define _SYS_SWAP_H 1
#include <features.h>
-/* Get constants from kernel headers. */
-#include <linux/swap.h>
+/* The swap priority is encoded as:
+ (prio << SWAP_FLAG_PRIO_SHIFT) & SWAP_FLAG_PRIO_MASK
+*/
+#define SWAP_FLAG_PREFER 0x8000 /* Set if swap priority is specified. */
+#define SWAP_FLAG_PRIO_MASK 0x7fff
+#define SWAP_FLAG_PRIO_SHIFT 0
__BEGIN_DECLS
--
Andreas Jaeger aj@arthur.rhein-neckar.de jaeger@informatik.uni-kl.de
for pgp-key finger ajaeger@aixd1.rhrk.uni-kl.de