[PATCH] common compat_sys_timer_create
The comment in compat.c is wrong, every architecture provides a get_compat_sigevent() for the IPC compat code already. This basically moves the x86_64 version to common code and removes all the others. Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Paul Mackerras <paulus@samba.org> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Martin Schwidefsky <schwidefsky@de.ibm.com> Cc: "David S. Miller" <davem@davemloft.net> Acked-by: Andi Kleen <ak@muc.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:

committed by
Linus Torvalds

parent
f042e0f80b
commit
3a0f69d59b
@@ -1120,39 +1120,3 @@ long sys32_lookup_dcookie(unsigned long cookie_high,
|
||||
return sys_lookup_dcookie((cookie_high << 32) | cookie_low,
|
||||
buf, len);
|
||||
}
|
||||
|
||||
extern asmlinkage long
|
||||
sys_timer_create(clockid_t which_clock,
|
||||
struct sigevent __user *timer_event_spec,
|
||||
timer_t __user *created_timer_id);
|
||||
|
||||
long
|
||||
sys32_timer_create(u32 clock, struct compat_sigevent __user *se32,
|
||||
timer_t __user *timer_id)
|
||||
{
|
||||
struct sigevent se;
|
||||
mm_segment_t oldfs;
|
||||
timer_t t;
|
||||
long err;
|
||||
|
||||
if (se32 == NULL)
|
||||
return sys_timer_create(clock, NULL, timer_id);
|
||||
|
||||
if (get_compat_sigevent(&se, se32))
|
||||
return -EFAULT;
|
||||
|
||||
if (!access_ok(VERIFY_WRITE,timer_id,sizeof(timer_t)))
|
||||
return -EFAULT;
|
||||
|
||||
oldfs = get_fs();
|
||||
set_fs(KERNEL_DS);
|
||||
err = sys_timer_create(clock,
|
||||
(struct sigevent __user *) &se,
|
||||
(timer_t __user *) &t);
|
||||
set_fs(oldfs);
|
||||
|
||||
if (!err)
|
||||
err = __put_user (t, timer_id);
|
||||
|
||||
return err;
|
||||
}
|
||||
|
Reference in New Issue
Block a user