public inbox for linux-arch@vger.kernel.org
 help / color / mirror / Atom feed
From: Anton Blanchard <anton@samba.org>
To: linux-arch@vger.kernel.org
Subject: [meissner@suse.de: getdents patch for 32 -> 64 converter]
Date: Wed, 24 Mar 2004 12:17:28 +1100	[thread overview]
Message-ID: <20040324011728.GF27747@krispykreme> (raw)


Im guessing this fix will be required on other 64bit archs.

Anton

----- Forwarded message from Marcus Meissner <meissner@suse.de> -----

From: Marcus Meissner <meissner@suse.de>
To: linuxppc64-dev@lists.linuxppc.org
Subject: getdents patch for 32 -> 64 converter

Hi,

With 2.6.4 we now have the glorious hidden d_type passing in
getdents.

glibc CVS expects this to be passed if we have a kernel version after 2.6.4,
so we have to also handle it in the 32bit syscall converter.

The kernel at least bootet here and my testcase (bootstrap gcc)
works fine now.

Can someone please review / apply?

Ciao, Marcus

--- linux/arch/ppc64/kernel/sys_ppc32.c.dtype	2004-03-23 14:10:10.000000000 +0100
+++ linux/arch/ppc64/kernel/sys_ppc32.c	2004-03-23 14:11:02.000000000 +0100
@@ -534,7 +534,7 @@
 {
 	struct linux_dirent32 * dirent;
 	struct getdents_callback32 * buf = (struct getdents_callback32 *) __buf;
-	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 1);
+	int reclen = ROUND_UP(NAME_OFFSET(dirent) + namlen + 2);

 	buf->error = -EINVAL;	/* only used if we fail.. */
 	if (reclen > buf->count)
@@ -548,6 +548,7 @@
 	put_user(reclen, &dirent->d_reclen);
 	copy_to_user(dirent->d_name, name, namlen);
 	put_user(0, dirent->d_name + namlen);
+	put_user(d_type, (char *) dirent + reclen - 1);
 	((char *) dirent) += reclen;
 	buf->current_dir = dirent;
 	buf->count -= reclen;

** Sent via the linuxppc64-dev mail list. See http://lists.linuxppc.org/

----- End forwarded message -----

                 reply	other threads:[~2004-03-24  1:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20040324011728.GF27747@krispykreme \
    --to=anton@samba.org \
    --cc=linux-arch@vger.kernel.org \
    /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