From: Anton Blanchard <anton@samba.org>
To: Randolph Chung <tausq@parisc-linux.org>
Cc: Linus <torvalds@transmeta.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][COMPAT] {get,set}affinity unification
Date: Sat, 12 Apr 2003 03:15:06 +1000 [thread overview]
Message-ID: <20030411171506.GA657@krispykreme> (raw)
In-Reply-To: <20030411062110.GS12993@tausq.org>
Hi,
> +extern asmlinkage long sys_sched_getaffinity(pid_t pid, unsigned int len,
> + unsigned long *user_mask_ptr);
> +
> +asmlinkage int compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
> + compat_ulong_t *user_mask_ptr)
> +{
> + unsigned long kernel_mask;
> + mm_segment_t old_fs;
> + int ret;
> +
> + old_fs = get_fs();
> + set_fs(KERNEL_DS);
> + ret = sys_sched_getaffinity(pid,
> + sizeof(kernel_mask),
> + &kernel_mask);
> + set_fs(old_fs);
> +
> + if (ret == 0) {
> + if (put_user(kernel_mask, user_mask_ptr))
> + ret = -EFAULT;
> + }
> +
> + return ret;
> +}
We should really return sizeof(compat_ulong_t) here. Can you check over
the ppc64 and sparc64 versions of these, I think there are some other
problems (getaffinity returns > 0 on success but you check for 0).
Anton
next prev parent reply other threads:[~2003-04-11 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-11 6:21 [PATCH][COMPAT] {get,set}affinity unification Randolph Chung
2003-04-11 17:15 ` Anton Blanchard [this message]
2003-04-12 22:56 ` Randolph Chung
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=20030411171506.GA657@krispykreme \
--to=anton@samba.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tausq@parisc-linux.org \
--cc=torvalds@transmeta.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