diff options
author | Christoph Hellwig <hch@lst.de> | 2006-01-09 23:52:08 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-10 11:01:32 -0500 |
commit | 3a0f69d59ba41fbcad6a17b6e8aab02bf45e20ce (patch) | |
tree | 8ba042dda77490f574f2c46bd038fd99a7f977e4 /kernel | |
parent | f042e0f80b0a9f5bb57c36d60a2798de6ca943b2 (diff) |
[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>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/compat.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/kernel/compat.c b/kernel/compat.c index 102296e21ea8..256e5d9f0647 100644 --- a/kernel/compat.c +++ b/kernel/compat.c | |||
@@ -514,6 +514,24 @@ static int put_compat_itimerspec(struct compat_itimerspec __user *dst, | |||
514 | return 0; | 514 | return 0; |
515 | } | 515 | } |
516 | 516 | ||
517 | long compat_sys_timer_create(clockid_t which_clock, | ||
518 | struct compat_sigevent __user *timer_event_spec, | ||
519 | timer_t __user *created_timer_id) | ||
520 | { | ||
521 | struct sigevent __user *event = NULL; | ||
522 | |||
523 | if (timer_event_spec) { | ||
524 | struct sigevent kevent; | ||
525 | |||
526 | event = compat_alloc_user_space(sizeof(*event)); | ||
527 | if (get_compat_sigevent(&kevent, timer_event_spec) || | ||
528 | copy_to_user(event, &kevent, sizeof(*event))) | ||
529 | return -EFAULT; | ||
530 | } | ||
531 | |||
532 | return sys_timer_create(which_clock, event, created_timer_id); | ||
533 | } | ||
534 | |||
517 | long compat_sys_timer_settime(timer_t timer_id, int flags, | 535 | long compat_sys_timer_settime(timer_t timer_id, int flags, |
518 | struct compat_itimerspec __user *new, | 536 | struct compat_itimerspec __user *new, |
519 | struct compat_itimerspec __user *old) | 537 | struct compat_itimerspec __user *old) |
@@ -649,8 +667,6 @@ int get_compat_sigevent(struct sigevent *event, | |||
649 | ? -EFAULT : 0; | 667 | ? -EFAULT : 0; |
650 | } | 668 | } |
651 | 669 | ||
652 | /* timer_create is architecture specific because it needs sigevent conversion */ | ||
653 | |||
654 | long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, | 670 | long compat_get_bitmap(unsigned long *mask, compat_ulong_t __user *umask, |
655 | unsigned long bitmap_size) | 671 | unsigned long bitmap_size) |
656 | { | 672 | { |