Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 55931
b: refs/heads/master
c: 83f5d12
h: refs/heads/master
i:
  55929: d3278fb
  55927: 873ecf7
v: v3
  • Loading branch information
Davide Libenzi authored and Linus Torvalds committed May 11, 2007
1 parent cc90eb1 commit 91e3167
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 57ac8898508638ca6d15ecd8b911a431d673ff30
refs/heads/master: 83f5d1266926c75890f1bc4678e49d79483cb573
23 changes: 23 additions & 0 deletions trunk/fs/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

5 changes: 5 additions & 0 deletions trunk/include/linux/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,11 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs,
return lhs->tv_nsec - rhs->tv_nsec;
}

extern int get_compat_itimerspec(struct itimerspec *dst,
const struct compat_itimerspec __user *src);
extern int put_compat_itimerspec(struct compat_itimerspec __user *dst,
const struct itimerspec *src);

asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp);

extern int compat_printk(const char *fmt, ...);
Expand Down
8 changes: 4 additions & 4 deletions trunk/kernel/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,17 +475,17 @@ asmlinkage long compat_sys_sched_getaffinity(compat_pid_t pid, unsigned int len,
return min_length;
}

static int get_compat_itimerspec(struct itimerspec *dst,
struct compat_itimerspec __user *src)
int get_compat_itimerspec(struct itimerspec *dst,
const struct compat_itimerspec __user *src)
{
if (get_compat_timespec(&dst->it_interval, &src->it_interval) ||
get_compat_timespec(&dst->it_value, &src->it_value))
return -EFAULT;
return 0;
}

static int put_compat_itimerspec(struct compat_itimerspec __user *dst,
struct itimerspec *src)
int put_compat_itimerspec(struct compat_itimerspec __user *dst,
const struct itimerspec *src)
{
if (put_compat_timespec(&src->it_interval, &dst->it_interval) ||
put_compat_timespec(&src->it_value, &dst->it_value))
Expand Down

0 comments on commit 91e3167

Please sign in to comment.