Commit 35d64a33 authored by Linus Torvalds's avatar Linus Torvalds

Don't fold nanosleep() into clock_nanosleep().

The latter has buggy restart functionality and is a lot
more complicated anyway.
parent 59ccfc46
......@@ -214,7 +214,7 @@ extern int sigprocmask(int, sigset_t *, sigset_t *);
struct pt_regs;
extern int get_signal_to_deliver(siginfo_t *info, struct pt_regs *regs, void *cookie);
#endif
#define FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
#endif /* __KERNEL__ */
#endif /* _LINUX_SIGNAL_H */
......@@ -1104,29 +1104,6 @@ long clock_nanosleep_restart(struct restart_block *restart_block);
extern long do_clock_nanosleep(clockid_t which_clock, int flags,
struct timespec *t);
#ifdef FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
asmlinkage long
sys_nanosleep(struct timespec __user *rqtp, struct timespec __user *rmtp)
{
struct timespec t;
long ret;
if (copy_from_user(&t, rqtp, sizeof (t)))
return -EFAULT;
if ((unsigned) t.tv_nsec >= NSEC_PER_SEC || t.tv_sec < 0)
return -EINVAL;
ret = do_clock_nanosleep(CLOCK_REALTIME, 0, &t);
if (ret == -ERESTART_RESTARTBLOCK && rmtp &&
copy_to_user(rmtp, &t, sizeof (t)))
return -EFAULT;
return ret;
}
#endif // ! FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
asmlinkage long
sys_clock_nanosleep(clockid_t which_clock, int flags,
const struct timespec __user *rqtp,
......@@ -1244,7 +1221,7 @@ do_clock_nanosleep(clockid_t which_clock, int flags, struct timespec *tsave)
return 0;
}
/*
* This will restart either clock_nanosleep or clock_nanosleep
* This will restart clock_nanosleep. Incorrectly, btw.
*/
long
clock_nanosleep_restart(struct restart_block *restart_block)
......
......@@ -1059,7 +1059,6 @@ asmlinkage long sys_gettid(void)
{
return current->pid;
}
#ifndef FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
static long nanosleep_restart(struct restart_block *restart)
{
......@@ -1118,7 +1117,6 @@ asmlinkage long sys_nanosleep(struct timespec *rqtp, struct timespec *rmtp)
}
return ret;
}
#endif // ! FOLD_NANO_SLEEP_INTO_CLOCK_NANO_SLEEP
/*
* sys_sysinfo - fill in sysinfo struct
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment