From 835980c4bb73fe6b5ff714c5f9a37a7e688018a9 Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 6 Aug 2003 21:14:37 -0700 Subject: [PATCH] [PATCH] Add do_setitimer prototype to linux/time.h From: Peter Chubb Currently, do_setitimer() is used in several files, but doesn't appear in any header. Thus its declaration is repeated in some files, and its use causes a warning in others (because there is no declaration present). This patch: -- adds a couple of declarations to linux/times.h -- removes the (now duplicate) declarations from other files. --- arch/alpha/kernel/osf_sys.c | 2 -- arch/mips/kernel/sysirix.c | 3 --- arch/x86_64/ia32/sys_ia32.c | 2 -- include/linux/time.h | 3 +++ kernel/compat.c | 4 ---- kernel/itimer.c | 1 + kernel/timer.c | 2 -- 7 files changed, 4 insertions(+), 13 deletions(-) diff --git a/arch/alpha/kernel/osf_sys.c b/arch/alpha/kernel/osf_sys.c index cce7e0d072500..bd0e69f0532e8 100644 --- a/arch/alpha/kernel/osf_sys.c +++ b/arch/alpha/kernel/osf_sys.c @@ -821,8 +821,6 @@ osf_setsysinfo(unsigned long op, void *buffer, unsigned long nbytes, affects all sorts of things, like timeval and itimerval. */ extern struct timezone sys_tz; -extern int do_getitimer(int which, struct itimerval *value); -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); extern asmlinkage int sys_utimes(char *, struct timeval *); extern int do_adjtimex(struct timex *); diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 620fd87d72bc6..022aa036efef2 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c @@ -636,9 +636,6 @@ asmlinkage int irix_stime(int value) return 0; } -extern int do_setitimer(int which, struct itimerval *value, - struct itimerval *ovalue); - static inline void jiffiestotv(unsigned long jiffies, struct timeval *value) { value->tv_usec = (jiffies % HZ) * (1000000 / HZ); diff --git a/arch/x86_64/ia32/sys_ia32.c b/arch/x86_64/ia32/sys_ia32.c index a3f4c9708110c..e1150347f6d07 100644 --- a/arch/x86_64/ia32/sys_ia32.c +++ b/arch/x86_64/ia32/sys_ia32.c @@ -428,8 +428,6 @@ put_tv32(struct compat_timeval *o, struct timeval *i) return err; } -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); - asmlinkage long sys32_alarm(unsigned int seconds) { diff --git a/include/linux/time.h b/include/linux/time.h index 719b6b3647083..0a0fc40912ba9 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -217,6 +217,9 @@ extern void clock_was_set(void); // call when ever the clock is set extern int do_posix_clock_monotonic_gettime(struct timespec *tp); extern long do_nanosleep(struct timespec *t); extern long do_utimes(char __user * filename, struct timeval * times); +struct itimerval; +extern int do_setitimer(int which, struct itimerval *value, struct itimerval *ovalue); +extern int do_getitimer(int which, struct itimerval *value); static inline void set_normalized_timespec (struct timespec *ts, time_t sec, long nsec) diff --git a/kernel/compat.c b/kernel/compat.c index de5820d09d715..f5e1df8834b3a 100644 --- a/kernel/compat.c +++ b/kernel/compat.c @@ -116,8 +116,6 @@ static inline long put_compat_itimerval(struct compat_itimerval *o, __put_user(i->it_value.tv_usec, &o->it_value.tv_usec))); } -extern int do_getitimer(int which, struct itimerval *value); - asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it) { struct itimerval kit; @@ -129,8 +127,6 @@ asmlinkage long compat_sys_getitimer(int which, struct compat_itimerval *it) return error; } -extern int do_setitimer(int which, struct itimerval *, struct itimerval *); - asmlinkage long compat_sys_setitimer(int which, struct compat_itimerval *in, struct compat_itimerval *out) { diff --git a/kernel/itimer.c b/kernel/itimer.c index a544d4090d36c..1a95e09b41b62 100644 --- a/kernel/itimer.c +++ b/kernel/itimer.c @@ -9,6 +9,7 @@ #include #include #include +#include #include diff --git a/kernel/timer.c b/kernel/timer.c index 3995425e44a50..19e03ef778872 100644 --- a/kernel/timer.c +++ b/kernel/timer.c @@ -841,8 +841,6 @@ void do_timer(struct pt_regs *regs) #if !defined(__alpha__) && !defined(__ia64__) -extern int do_setitimer(int, struct itimerval *, struct itimerval *); - /* * For backwards compatibility? This can be done in libc so Alpha * and all newer ports shouldn't need it. -- 2.53.0