* [parisc-linux] Duplicate ustat structure
@ 2006-07-16 16:03 Jeff Bailey
[not found] ` <jeodvpbj2k.fsf@sykes.suse.de>
0 siblings, 1 reply; 4+ messages in thread
From: Jeff Bailey @ 2006-07-16 16:03 UTC (permalink / raw)
To: carlos; +Cc: libc-ports, parisc-linux
Carlos,
This patch is needed to work around a compilation failure with ustat.c
when using kernel headers produced from the output of "make
headers_install".
The problem is that bits/ustat.h includes the definition of struct
ustat. However, sys/types.h eventually winds up pulling in
linux/types.h which also defines struct ustat. Since this definition
forms part of the kernel ABI, the kernel header is the correct place to
define this.
Ubuntu and Fedora are now using these headers. Debian will be shortly.
I beleive that Gentoo either has or is about to move to them.
tks,
Jeff Bailey
2006-07-16 Jeff Bailey <jbailey@ubuntu.com>
* sysdeps/unix/sysv/linux/hppa/bits/ustat.h: New file.
--- /dev/null 2006-07-13 14:56:30.000000000 -0400
+++ sysdeps/unix/sysv/linux/hppa/bits/ustat.h 2006-07-16 11:42:52.000000000 -0400
@@ -0,0 +1,34 @@
+/* Copyright (C) 1997, 2002, 2006 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
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ The GNU C Library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with the GNU C Library; if not, write to the Free
+ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+ 02111-1307 USA. */
+
+#ifndef _SYS_USTAT_H
+# error "Never include <bits/ustat.h> directly; use <sys/ustat.h> instead."
+#endif
+
+#include <sys/types.h>
+
+#if 0
+/* On hppa, sys/types.h pulls in linux/types.h which defines this */
+struct ustat
+ {
+ __daddr_t f_tfree; /* Number of free blocks. */
+ __ino_t f_tinode; /* Number of free inodes. */
+ char f_fname[6];
+ char f_fpack[6];
+ };
+#endif
--
I do not agree with a word you say, but I will defend to the death your
right to say it.
- Voltaire
_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <jeodvpbj2k.fsf@sykes.suse.de>]
* [parisc-linux] Re: Duplicate ustat structure [not found] ` <jeodvpbj2k.fsf@sykes.suse.de> @ 2006-07-16 17:07 ` Jeff Bailey 2006-07-16 20:13 ` Carlos O'Donell 0 siblings, 1 reply; 4+ messages in thread From: Jeff Bailey @ 2006-07-16 17:07 UTC (permalink / raw) To: Andreas Schwab; +Cc: libc-ports, parisc-linux On Sun, Jul 16, 2006 at 06:39:15PM +0200, Andreas Schwab wrote: > > The problem is that bits/ustat.h includes the definition of struct > > ustat. However, sys/types.h eventually winds up pulling in > > linux/types.h which also defines struct ustat. > > <sys/types.h> should not include <linux/types.h> in the first place. It seems like it ought to now that the kernel is exporting a set of headers that are intended to be used by userspace. struct ustat is defined in linux/types.h. But in general, this is the path by which it gets included: include/sys/types.h includes thread_db.h nptl_db/thread_db.h includes procfs.h ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h includes asm/elf.h for elf_gregset_t and elf_fpregset_t asm-parisc/elf.h includes asm/ptrace.h unnecessarily, but relies on it to pull in linux/types for __u32 asm-parisc/ptrace.h includes linux/types.h for __u64 So the following patch would work instead, but I think this type of fix used to be right when the kernel folks didn't want to provide userspace headers. Now that they are doing so, I think it's more correct for us to use them. 2006-07-16 Jeff Bailey <jbailey@ubuntu.com> * sysdeps/unix/sysv/linux/hppa/sys/procfs.h: Don't include elf.h. Declare elf_greg_t, elf_gregset_t, elf_fpreg_t, and elf_fpregset_t. Index: sysdeps/unix/sysv/linux/hppa/sys/procfs.h =================================================================== RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/hppa/sys/procfs.h,v retrieving revision 1.2 diff -u -p -r1.2 procfs.h --- sysdeps/unix/sysv/linux/hppa/sys/procfs.h 6 Jul 2001 04:56:16 -0000 1.2 +++ sysdeps/unix/sysv/linux/hppa/sys/procfs.h 16 Jul 2006 16:57:39 -0000 @@ -34,10 +34,18 @@ #include <sys/types.h> #include <sys/ucontext.h> #include <sys/user.h> -#include <asm/elf.h> __BEGIN_DECLS +typedef unsigned long elf_greg_t; +#define ELF_NGREG 80 /* We only need 64 at present, but leave space + for expansion. */ +typedef elf_greg_t elf_gregset_t[ELF_NGREG]; + +#define ELF_NFPREG 32 +typedef double elf_fpreg_t; +typedef elf_fpreg_t elf_fpregset_t[ELF_NFPREG]; + struct elf_siginfo { int si_signo; /* Signal number. */ -- I do not agree with a word you say, but I will defend to the death your right to say it. - Voltaire _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 4+ messages in thread
* [parisc-linux] Re: Duplicate ustat structure 2006-07-16 17:07 ` [parisc-linux] " Jeff Bailey @ 2006-07-16 20:13 ` Carlos O'Donell 2006-07-25 0:47 ` Jeff Bailey 0 siblings, 1 reply; 4+ messages in thread From: Carlos O'Donell @ 2006-07-16 20:13 UTC (permalink / raw) To: Jeff Bailey; +Cc: Andreas Schwab, libc-ports, parisc-linux On 7/16/06, Jeff Bailey <jbailey@raspberryginger.com> wrote: > On Sun, Jul 16, 2006 at 06:39:15PM +0200, Andreas Schwab wrote: > > > > The problem is that bits/ustat.h includes the definition of struct > > > ustat. However, sys/types.h eventually winds up pulling in > > > linux/types.h which also defines struct ustat. > > > > <sys/types.h> should not include <linux/types.h> in the first place. > > It seems like it ought to now that the kernel is exporting a set of > headers that are intended to be used by userspace. struct ustat is > defined in linux/types.h. In which case this patch should go upstream to libc-alpha, where the generic version of ustat.h should be changed. Cheers, Carlos. _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 4+ messages in thread
* [parisc-linux] Re: Duplicate ustat structure 2006-07-16 20:13 ` Carlos O'Donell @ 2006-07-25 0:47 ` Jeff Bailey 0 siblings, 0 replies; 4+ messages in thread From: Jeff Bailey @ 2006-07-25 0:47 UTC (permalink / raw) To: Carlos O'Donell; +Cc: Andreas Schwab, libc-ports, parisc-linux On dim, 2006-07-16 at 16:13 -0400, Carlos O'Donell wrote: > On 7/16/06, Jeff Bailey <jbailey@raspberryginger.com> wrote: > > On Sun, Jul 16, 2006 at 06:39:15PM +0200, Andreas Schwab wrote: > > > > > > The problem is that bits/ustat.h includes the definition of struct > > > > ustat. However, sys/types.h eventually winds up pulling in > > > > linux/types.h which also defines struct ustat. > > > > > > <sys/types.h> should not include <linux/types.h> in the first place. > > > > It seems like it ought to now that the kernel is exporting a set of > > headers that are intended to be used by userspace. struct ustat is > > defined in linux/types.h. > > In which case this patch should go upstream to libc-alpha, where the > generic version of ustat.h should be changed. Certainly, but could you apply the second patch in the meantime? That's what all the other arch's do right now, and it will at least make current glibc buildable with current kernel headers. I'll try and pitch the concept of using kernel headers instead of copying values into glibc when I have enough time and energy to fight that battle. Tks, Jeff Bailey -- Although when you're in the situation that RMS is telling you that you're being too ideological about freedom, maybe, just maybe, it's true. - Matthew Wilcox _______________________________________________ parisc-linux mailing list parisc-linux@lists.parisc-linux.org http://lists.parisc-linux.org/mailman/listinfo/parisc-linux ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2006-07-25 0:47 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-07-16 16:03 [parisc-linux] Duplicate ustat structure Jeff Bailey
[not found] ` <jeodvpbj2k.fsf@sykes.suse.de>
2006-07-16 17:07 ` [parisc-linux] " Jeff Bailey
2006-07-16 20:13 ` Carlos O'Donell
2006-07-25 0:47 ` Jeff Bailey
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox