mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
signal/timer/event: timerfd compat code
This patch implements the necessary compat code for the timerfd system call. Signed-off-by: Davide Libenzi <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
57ac889850
commit
83f5d12669
3 changed files with 32 additions and 4 deletions
23
fs/compat.c
23
fs/compat.c
|
|
@ -2225,3 +2225,26 @@ asmlinkage long compat_sys_signalfd(int ufd,
|
|||
|
||||
#endif /* CONFIG_SIGNALFD */
|
||||
|
||||
#ifdef CONFIG_TIMERFD
|
||||
|
||||
asmlinkage long compat_sys_timerfd(int ufd, int clockid, int flags,
|
||||
const struct compat_itimerspec __user *utmr)
|
||||
{
|
||||
long res;
|
||||
struct itimerspec t;
|
||||
struct itimerspec __user *ut;
|
||||
|
||||
res = -EFAULT;
|
||||
if (get_compat_itimerspec(&t, utmr))
|
||||
goto err_exit;
|
||||
ut = compat_alloc_user_space(sizeof(*ut));
|
||||
if (copy_to_user(ut, &t, sizeof(t)) )
|
||||
goto err_exit;
|
||||
|
||||
res = sys_timerfd(ufd, clockid, flags, ut);
|
||||
err_exit:
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_TIMERFD */
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue