From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8284 invoked by alias); 26 Aug 2004 11:24:23 -0000 Mailing-List: contact libc-hacker-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sources.redhat.com Received: (qmail 8256 invoked from network); 26 Aug 2004 11:24:20 -0000 Received: from unknown (HELO r-rr.iij4u.or.jp) (210.130.0.76) by sourceware.org with SMTP; 26 Aug 2004 11:24:20 -0000 Received: from localhost (frgw.3in.ne.jp [210.251.121.226]) by r-rr.iij4u.or.jp (8.11.6+IIJ/8.11.6) with ESMTP id i7QBODP25346; Thu, 26 Aug 2004 20:24:13 +0900 (JST) Date: Thu, 26 Aug 2004 11:24:00 -0000 Message-Id: <20040826.202305.43004745.kkojima@rr.iij4u.or.jp> To: drepper@redhat.com Cc: libc-hacker@sources.redhat.com Subject: Re: [PATCH] SH: Fixup pread/pwrite From: Kaz Kojima In-Reply-To: <412DA970.2060604@redhat.com> References: <20040825.165724.32717645.kkojima@rr.iij4u.or.jp> <412DA970.2060604@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-SW-Source: 2004-08/txt/msg00077.txt.bz2 Ulrich Drepper wrote: >> The pread/write* stuff of sh-linux just includes the mips one and now >> the mips implementation uses more mips specific things like sgidefs.h >> which doesn't exist on SH. The appended patch just copies them and >> removes the mips specific lines from them. > > Yeah, but it's a copy. I would rather like to see you using the other > files. Yet another copy means more maintenance problems. You can > define a macro in the SH files which prevents the MIPS header from being > included. Or maybe this is even one of the rare situations where it is > OK to test for __mips__ or whatever the symbol gcc defines is since it > is indeed only for mips you want these headers. How about the patch below? BTW, sysdeps/unix/sysv/linux/mips/pwrite64.c doesn't include sgidefs.h, though it looks ChangeLog says pwrite64.c does. Regards, kaz -- 2004-08-26 Kaz Kojima * sysdeps/unix/sysv/linux/mips/pread.c: Include sgidefs.h only if _HAVE_NO_SGIDEFS_H isn't defined. * sysdeps/unix/sysv/linux/mips/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/mips/pread64.c: Likewise. * sysdeps/unix/sysv/linux/sh/pread.c: Define _HAVE_NO_SGIDEFS_H and _MIPS_SIM. * sysdeps/unix/sysv/linux/sh/pwrite.c: Likewise. * sysdeps/unix/sysv/linux/sh/pread64.c: Likewise. * sysdeps/unix/sysv/linux/sh/pwrite64.c: Likewise. diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/mips/pread.c LOCAL/libc/sysdeps/unix/sysv/linux/mips/pread.c --- ORIG/libc/sysdeps/unix/sysv/linux/mips/pread.c Wed Aug 25 14:41:49 2004 +++ LOCAL/libc/sysdeps/unix/sysv/linux/mips/pread.c Thu Aug 26 19:08:21 2004 @@ -28,7 +28,9 @@ #include #include +#ifndef _HAVE_NO_SGIDEFS_H #include +#endif #ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pread diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/mips/pread64.c LOCAL/libc/sysdeps/unix/sysv/linux/mips/pread64.c --- ORIG/libc/sysdeps/unix/sysv/linux/mips/pread64.c Wed Aug 25 14:41:49 2004 +++ LOCAL/libc/sysdeps/unix/sysv/linux/mips/pread64.c Thu Aug 26 19:02:51 2004 @@ -27,7 +27,9 @@ #include #include +#ifndef _HAVE_NO_SGIDEFS_H #include +#endif #ifdef __NR_pread64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pread diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/mips/pwrite.c LOCAL/libc/sysdeps/unix/sysv/linux/mips/pwrite.c --- ORIG/libc/sysdeps/unix/sysv/linux/mips/pwrite.c Wed Aug 25 14:41:49 2004 +++ LOCAL/libc/sysdeps/unix/sysv/linux/mips/pwrite.c Thu Aug 26 19:02:34 2004 @@ -28,7 +28,9 @@ #include #include +#ifndef _HAVE_NO_SGIDEFS_H #include +#endif #ifdef __NR_pwrite64 /* Newer kernels renamed but it's the same. */ # ifdef __NR_pwrite diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/pread.c LOCAL/libc/sysdeps/unix/sysv/linux/sh/pread.c --- ORIG/libc/sysdeps/unix/sysv/linux/sh/pread.c Thu Feb 20 14:22:52 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/pread.c Thu Aug 26 19:41:56 2004 @@ -1 +1,3 @@ +#define _HAVE_NO_SGIDEFS_H +#define _MIPS_SIM -1 #include diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/pread64.c LOCAL/libc/sysdeps/unix/sysv/linux/sh/pread64.c --- ORIG/libc/sysdeps/unix/sysv/linux/sh/pread64.c Thu Feb 20 14:23:52 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/pread64.c Thu Aug 26 19:42:24 2004 @@ -1 +1,3 @@ +#define _HAVE_NO_SGIDEFS_H +#define _MIPS_SIM -1 #include diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/pwrite.c LOCAL/libc/sysdeps/unix/sysv/linux/sh/pwrite.c --- ORIG/libc/sysdeps/unix/sysv/linux/sh/pwrite.c Thu Feb 20 14:24:07 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/pwrite.c Thu Aug 26 19:41:22 2004 @@ -1 +1,3 @@ +#define _HAVE_NO_SGIDEFS_H +#define _MIPS_SIM -1 #include diff -u3prN ORIG/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c LOCAL/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c --- ORIG/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c Thu Feb 20 14:24:23 2003 +++ LOCAL/libc/sysdeps/unix/sysv/linux/sh/pwrite64.c Thu Aug 26 19:41:38 2004 @@ -1 +1,3 @@ +#define _HAVE_NO_SGIDEFS_H +#define _MIPS_SIM -1 #include