Messages in this thread Patch in this message | | | Date | Sun, 29 Mar 1998 20:32:16 -0500 | Subject | Another include file cleanup | From | tytso@mit ... |
| |
Hi Linus,
Here's another patch to cleanup compiling system programs that need to include linux/stat.h and linux/socket.h (or which include other system header files which drag these files in). It avoids defining symbols which are already defined by the glibc header files.
For example, the fix to linux/socket.h is required if you want to make pppd compile on a glibc system.
- Ted
Patch generated: on Sun Mar 29 20:29:08 EST 1998 by tytso@rsts-11.mit.edu against Linux version 2.1.91 =================================================================== RCS file: include/linux/RCS/stat.h,v retrieving revision 1.1 diff -u -r1.1 include/linux/stat.h --- include/linux/stat.h 1998/03/28 17:40:06 1.1 +++ include/linux/stat.h 1998/03/28 17:41:37 @@ -7,6 +7,8 @@ #endif +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) + #define S_IFMT 00170000 #define S_IFSOCK 0140000 #define S_IFLNK 0120000 @@ -41,6 +43,8 @@ #define S_IROTH 00004 #define S_IWOTH 00002 #define S_IXOTH 00001 + +#endif #ifdef __KERNEL__ #define S_IRWXUGO (S_IRWXU|S_IRWXG|S_IRWXO) =================================================================== RCS file: include/linux/RCS/socket.h,v retrieving revision 1.1 diff -u -r1.1 include/linux/socket.h --- include/linux/socket.h 1998/03/29 23:58:08 1.1 +++ include/linux/socket.h 1998/03/29 23:59:27 @@ -1,6 +1,8 @@ #ifndef _LINUX_SOCKET_H #define _LINUX_SOCKET_H +#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) + #include <asm/socket.h> /* arch-dependent defines */ #include <linux/sockios.h> /* the SIOCxxx I/O controls */ #include <linux/uio.h> /* iovec support */ @@ -245,4 +247,5 @@ extern int move_addr_to_kernel(void *uaddr, int ulen, void *kaddr); extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); #endif +#endif /* not kernel and not glibc */ #endif /* _LINUX_SOCKET_H */ - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu
| |