LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Mackerras <paulus@samba.org>
To: joakim.tjernlund@transmode.se
Cc: linuxppc-dev Development <linuxppc-dev@ozlabs.org>
Subject: Re: times(2) sys call bug?
Date: Fri, 21 Nov 2008 10:52:14 +1100	[thread overview]
Message-ID: <18725.63534.3316.841949@cargo.ozlabs.ibm.com> (raw)
In-Reply-To: <1227199742.5224.99.camel@gentoo-jocke.transmode.se>

Joakim Tjernlund writes:

> This little hack changes the kernel sys call handling in an crude
> way and then it works. Apperently the kernel thinks is an error if the
> syscall returns a value between -_LAST_ERRNO and -1.

Try this patch and let me if it fixes it.  If it does I'll push it
upstream.

Paul.

diff --git a/kernel/sys.c b/kernel/sys.c
index 31deba8..1bf8c5c 100644
--- a/kernel/sys.c
+++ b/kernel/sys.c
@@ -33,6 +33,7 @@
 #include <linux/task_io_accounting_ops.h>
 #include <linux/seccomp.h>
 #include <linux/cpu.h>
+#include <linux/ptrace.h>
 
 #include <linux/compat.h>
 #include <linux/syscalls.h>
@@ -878,6 +879,7 @@ asmlinkage long sys_times(struct tms __user * tbuf)
 		if (copy_to_user(tbuf, &tmp, sizeof(struct tms)))
 			return -EFAULT;
 	}
+	force_successful_syscall_return();
 	return (long) jiffies_64_to_clock_t(get_jiffies_64());
 }
 

  reply	other threads:[~2008-11-20 23:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20 15:09 times(2) sys call bug? Joakim Tjernlund
2008-11-20 15:37 ` Josh Boyer
2008-11-20 16:49   ` Joakim Tjernlund
2008-11-20 23:52     ` Paul Mackerras [this message]
2008-11-21  8:31       ` Joakim Tjernlund
2008-11-21  8:41       ` Gabriel Paubert
2008-11-21  8:47         ` Joakim Tjernlund
2008-11-21  9:03         ` Paul Mackerras
2008-11-21  9:15           ` Joakim Tjernlund
2008-11-21  9:50           ` Gabriel Paubert
2008-11-21  9:55             ` Paul Mackerras
2008-11-21 10:13             ` Joakim Tjernlund
2008-11-21  9:31       ` Joakim Tjernlund
2008-11-21  9:51         ` Paul Mackerras
2008-11-21 10:07           ` Joakim Tjernlund
2008-11-21  9:53         ` Joakim Tjernlund

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=18725.63534.3316.841949@cargo.ozlabs.ibm.com \
    --to=paulus@samba.org \
    --cc=joakim.tjernlund@transmode.se \
    --cc=linuxppc-dev@ozlabs.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