diff options
Diffstat (limited to 'kernel/compat.c')
| -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 | { |
