public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fix for include/linux/fs.h in 2.4.0 kernels
@ 2001-02-02 23:04 Jocelyn Mayer
  2001-02-02 23:25 ` Keith Owens
  0 siblings, 1 reply; 13+ messages in thread
From: Jocelyn Mayer @ 2001-02-02 23:04 UTC (permalink / raw)
  To: linux-kernel

I had some problems while compiling some applications 
with the 2.4.0 kernel.
The problem was a conflict between string.h from the libc
and the one from the kernel, which is included in fs.h
So, using <string.h> and <linux/fs.h> at the same time
brings some conflicts.
It seems to me that <linux/string.h> should not be apparent 
from user mode, so I did this patch:

--- fs.h-orig   Fri Feb  2 23:55:35
2001                                                                                                                                      
+++ fs.h        Fri Feb  2 21:26:05
2001                                                                                                                                      
@@ -20,7 +20,7
@@                                                                                                                                                             
 #include
<linux/stat.h>                                                                                                                                                      
 #include
<linux/cache.h>                                                                                                                                                     
 #include
<linux/stddef.h>                                                                                                                                                    
-#include
<linux/string.h>                                                                                                                                                    
+/*  #include <linux/string.h>
*/                                                                                                                                             
                                                                                                                                                                              
 #include
<asm/atomic.h>                                                                                                                                                      
 #include
<asm/bitops.h>                                                                                                                                                      
@@ -190,6 +190,7
@@                                                                                                                                                           
                                                                                                                                                                              
 #include
<asm/semaphore.h>                                                                                                                                                   
 #include
<asm/byteorder.h>                                                                                                                                                   
+#include
<linux/string.h>                                                                                                                                                    
                                                                                                                                                                              
 extern void update_atime (struct inode
*);                                                                                                                                   
 #define UPDATE_ATIME(inode) update_atime
(inode)                                                                                                                             
 

Like this, the #include <linux/string.h> is "protected" 
by a #ifdef __KERNEL__, so I don't have any conflict any more.

I recompiled my kernel without any problem since I did that patch.

Regards.

Jocelyn Mayer.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: Fix for include/linux/fs.h in 2.4.0 kernels
@ 2001-02-03  2:49 Frédéric L. W. Meunier
  2001-02-03  3:03 ` Brian May
  2001-02-03  3:10 ` Keith Owens
  0 siblings, 2 replies; 13+ messages in thread
From: Frédéric L. W. Meunier @ 2001-02-03  2:49 UTC (permalink / raw)
  To: Keith Owens, Jocelyn Mayer; +Cc: Linux Kernel

Keith Owens wrote:

> Rule 2. Any glibc that has a symlink from
> /usr/include/{linux,asm} to /usr/src/linux/include/{linux,asm}
> is wrong.

Such symlinks are created by the user.

> Relying on /usr/include/{linux,asm} always pointing at the
> current kernel source is broken as designed.

>From glibc 2.2.1 FAQ:

2.17.   I have /usr/include/net and /usr/include/scsi as symlinks
	into my Linux source tree.  Is that wrong?

{PB} This was necessary for libc5, but is not correct when
using glibc. Including the kernel header files directly in user
programs usually does not work (see question 3.5). glibc
provides its own <net/*> and <scsi/*> header files to replace
them, and you may have to remove any symlink that you have in
place before you install glibc. However, /usr/include/asm and
/usr/include/linux should remain as they were.

Keith, are you saying that glibc is wrong?

3.5.    On Linux I've got problems with the declarations in Linux
	kernel headers.

{UD,AJ} On Linux, the use of kernel headers is reduced to the
minimum. This gives Linus the ability to change the headers
more freely. Also, user programs are now insulated from changes
in the size of kernel data structures.

For example, the sigset_t type is 32 or 64 bits wide in the
kernel. In glibc it is 1024 bits wide. This guarantees that
when the kernel gets a bigger sigset_t (for POSIX.1e realtime
support, say) user programs will not have to be recompiled.
Consult the header files for more information about the
changes.

Therefore you shouldn't include Linux kernel header files
directly if glibc has defined a replacement. Otherwise you
might get undefined results because of type conflicts.

> /usr/include/{linux,asm} must be real directories that are
> shipped as part of glibc, not symlinks to some random version
> of the kernel. Fix /usr/include.

But make install didn't create them. I built 2.2 and 2.2.1.

-- 
Frédéric L. W. Meunier - http://www.pervalidus.net/
0@pervalidus.{net, {dyndns.}org} Tel: 55-21-717-2399 (Niterói-RJ BR)
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2001-02-03 11:38 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-02-02 23:04 Fix for include/linux/fs.h in 2.4.0 kernels Jocelyn Mayer
2001-02-02 23:25 ` Keith Owens
2001-02-03  7:42   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2001-02-03  2:49 Frédéric L. W. Meunier
2001-02-03  3:03 ` Brian May
2001-02-03  3:10 ` Keith Owens
2001-02-03  4:21   ` Brian May
2001-02-03  4:39     ` Brian Wellington
2001-02-03  4:41       ` Brian May
2001-02-03  8:48   ` Graham Murray
2001-02-03  8:59     ` Keith Owens
2001-02-03 10:09       ` Graham Murray
2001-02-03 11:38         ` Keith Owens

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox