From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix <sys/sysctl.h> ([BZ #140])
Date: Thu, 29 Apr 2004 19:40:00 -0000 [thread overview]
Message-ID: <20040429172804.GV5191@sunsite.ms.mff.cuni.cz> (raw)
Hi!
Without the following patch
#include <sys/sysctl.h>
#include <sys/sysinfo.h>
int
main (void)
{
struct sysinfo si;
sysinfo (&si);
return 0;
}
will not compile.
2004-04-29 Jakub Jelinek <jakub@redhat.com>
[BZ #140]
* sysdeps/unix/sysv/linux/sys/sysctl.h: Remove linux/compiler.h
include.
(_LINUX_KERNEL_H, _LINUX_TYPES_H, _LINUX_LIST_H): Only define if not
yet defined, #undef back after including linux/sysctl.h if defined
here.
(__LINUX_COMPILER_H, __user): Define if not yet defined, #undef
back after including linux/sysctl.h if defined here.
--- libc/sysdeps/unix/sysv/linux/sys/sysctl.h.jj 2003-07-30 12:00:52.000000000 +0200
+++ libc/sysdeps/unix/sysv/linux/sys/sysctl.h 2004-04-29 21:26:10.088848633 +0200
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1999, 2002, 2003 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1999, 2002, 2003, 2004 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
@@ -23,14 +23,44 @@
#define __need_size_t
#include <stddef.h>
/* Prevent more kernel headers than necessary to be included. */
-#define _LINUX_KERNEL_H 1
-#define _LINUX_TYPES_H 1
-#define _LINUX_LIST_H 1
-/* We do need this one for the declarations in <linux/sysctl.h>,
- since we've elided the inclusion of <linux/kernel.h> that gets them. */
-#include <linux/compiler.h>
+#ifndef _LINUX_KERNEL_H
+# define _LINUX_KERNEL_H 1
+# define __undef_LINUX_KERNEL_H
+#endif
+#ifndef _LINUX_TYPES_H
+# define _LINUX_TYPES_H 1
+# define __undef_LINUX_TYPES_H
+#endif
+#ifndef _LINUX_LIST_H
+# define _LINUX_LIST_H 1
+# define __undef_LINUX_LIST_H
+#endif
+#ifndef __LINUX_COMPILER_H
+# define __LINUX_COMPILER_H 1
+# define __user
+# define __undef__LINUX_COMPILER_H
+#endif
+
#include <linux/sysctl.h>
+#ifdef __undef_LINUX_KERNEL_H
+# undef _LINUX_KERNEL_H
+# undef __undef_LINUX_KERNEL_H
+#endif
+#ifdef __undef_LINUX_TYPES_H
+# undef _LINUX_TYPES_H
+# undef __undef_LINUX_TYPES_H
+#endif
+#ifdef __undef_LINUX_LIST_H
+# undef _LINUX_LIST_H
+# undef __undef_LINUX_LIST_H
+#endif
+#ifdef __undef__LINUX_COMPILER_H
+# undef __LINUX_COMPILER_H
+# undef __user
+# undef __undef__LINUX_COMPILER_H
+#endif
+
__BEGIN_DECLS
/* Read or write system parameters. */
Jakub
next reply other threads:[~2004-04-29 19:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-29 19:40 Jakub Jelinek [this message]
2004-04-29 20:09 ` Roland McGrath
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040429172804.GV5191@sunsite.ms.mff.cuni.cz \
--to=jakub@redhat.com \
--cc=drepper@redhat.com \
--cc=libc-hacker@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).