public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Kaz Kojima <kkojima@rr.iij4u.or.jp>
To: drepper@redhat.com
Cc: libc-hacker@sources.redhat.com
Subject: Re: [PATCH] SH: Fixup pread/pwrite
Date: Thu, 26 Aug 2004 11:24:00 -0000	[thread overview]
Message-ID: <20040826.202305.43004745.kkojima@rr.iij4u.or.jp> (raw)
In-Reply-To: <412DA970.2060604@redhat.com>

Ulrich Drepper <drepper@redhat.com> 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  <kkojima@rr.iij4u.or.jp>

	* 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 <bp-checks.h>
 
 #include <kernel-features.h>
+#ifndef _HAVE_NO_SGIDEFS_H
 #include <sgidefs.h>
+#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 <bp-checks.h>
 
 #include <kernel-features.h>
+#ifndef _HAVE_NO_SGIDEFS_H
 #include <sgidefs.h>
+#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 <bp-checks.h>
 
 #include <kernel-features.h>
+#ifndef _HAVE_NO_SGIDEFS_H
 #include <sgidefs.h>
+#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 <sysdeps/unix/sysv/linux/mips/pread.c>
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 <sysdeps/unix/sysv/linux/mips/pread64.c>
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 <sysdeps/unix/sysv/linux/mips/pwrite.c>
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 <sysdeps/unix/sysv/linux/mips/pwrite64.c>

  reply	other threads:[~2004-08-26 11:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-25  7:58 Kaz Kojima
2004-08-26  9:12 ` Ulrich Drepper
2004-08-26 11:24   ` Kaz Kojima [this message]
2004-08-26 17:01     ` Ulrich Drepper

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=20040826.202305.43004745.kkojima@rr.iij4u.or.jp \
    --to=kkojima@rr.iij4u.or.jp \
    --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).