From 199578d7e8dd5f3e862d836d520b44843738e810 Mon Sep 17 00:00:00 2001 From: bde Date: Fri, 1 Feb 2002 15:44:03 +0000 Subject: Compile osigreturn() unconditionally since it will always be needed on some arches and the syscall table is machine-independent. It was (bogusly) conditional on COMPAT_43, so this usually makes no difference. ia64: in addition: - replace the bogus cloned comment before osigreturn() by a correct one. osigreturn() is just a stub fo ia64's. - fix the formatting of cloned comment before sigreturn(). - fix the return code. use nosys() instead of returning ENOSYS to get the same semantics as if the syscall is not in the syscall table. Generating SIGSYS is actually correct here. - fix style bugs. powerpc: copy the cleaned up ia64 stub. This mainly fixes a bogus comment. sparc64: copy the cleaned up the ia64 stub, since there was no stub before. --- sys/alpha/alpha/machdep.c | 2 -- sys/amd64/amd64/machdep.c | 2 -- sys/i386/i386/machdep.c | 2 -- sys/ia64/ia64/machdep.c | 21 ++++++--------------- sys/pc98/i386/machdep.c | 2 -- sys/pc98/pc98/machdep.c | 2 -- sys/powerpc/aim/machdep.c | 10 ++++++---- sys/powerpc/powerpc/machdep.c | 10 ++++++---- sys/sparc64/sparc64/machdep.c | 12 ++++++++++++ 9 files changed, 30 insertions(+), 33 deletions(-) (limited to 'sys') diff --git a/sys/alpha/alpha/machdep.c b/sys/alpha/alpha/machdep.c index 50df8e7..73a6765 100644 --- a/sys/alpha/alpha/machdep.c +++ b/sys/alpha/alpha/machdep.c @@ -1440,7 +1440,6 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) * make sure that the user has not modified the * state to gain improper privileges. */ -#ifdef COMPAT_43 int osigreturn(struct thread *td, struct osigreturn_args /* { @@ -1500,7 +1499,6 @@ osigreturn(struct thread *td, td->td_pcb->pcb_fp_control = ksc.sc_fp_control; return (EJUSTRETURN); } -#endif int sigreturn(struct thread *td, diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 807ab20..0d23bcf 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -587,7 +587,6 @@ sendsig(catcher, sig, mask, code) * make sure that the user has not modified the * state to gain improper privileges. */ -#ifdef COMPAT_43 int osigreturn(td, uap) struct thread *td; @@ -698,7 +697,6 @@ osigreturn(td, uap) regs->tf_eflags = eflags; return (EJUSTRETURN); } -#endif int sigreturn(td, uap) diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 807ab20..0d23bcf 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -587,7 +587,6 @@ sendsig(catcher, sig, mask, code) * make sure that the user has not modified the * state to gain improper privileges. */ -#ifdef COMPAT_43 int osigreturn(td, uap) struct thread *td; @@ -698,7 +697,6 @@ osigreturn(td, uap) regs->tf_eflags = eflags; return (EJUSTRETURN); } -#endif int sigreturn(td, uap) diff --git a/sys/ia64/ia64/machdep.c b/sys/ia64/ia64/machdep.c index e199336..095efb6 100644 --- a/sys/ia64/ia64/machdep.c +++ b/sys/ia64/ia64/machdep.c @@ -936,24 +936,16 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) } /* - * System call to cleanup state after a signal - * has been taken. Reset signal mask and - * stack state from context left by sendsig (above). - * Return to previous pc and psl as specified by - * context left by sendsig. Check carefully to - * make sure that the user has not modified the - * state to gain improper privileges. + * Stub to satisfy the reference to osigreturn in the syscall table. This + * is needed even for newer arches that don't support old signals because + * the syscall table is machine-independent. */ -#ifdef COMPAT_43 int -osigreturn(struct thread *td, - struct osigreturn_args /* { - struct osigcontext *sigcntxp; - } */ *uap) +osigreturn(struct thread *td, struct osigreturn_args *uap) { - return EOPNOTSUPP; + + return (nosys(td, (struct nosys_args *)uap)); } -#endif /* * System call to cleanup state after a signal @@ -964,7 +956,6 @@ osigreturn(struct thread *td, * make sure that the user has not modified the * state to gain improper privileges. */ - int sigreturn(struct thread *td, struct sigreturn_args /* { diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c index aeb61c9..63a24ff 100644 --- a/sys/pc98/i386/machdep.c +++ b/sys/pc98/i386/machdep.c @@ -600,7 +600,6 @@ sendsig(catcher, sig, mask, code) * make sure that the user has not modified the * state to gain improper privileges. */ -#ifdef COMPAT_43 int osigreturn(td, uap) struct thread *td; @@ -711,7 +710,6 @@ osigreturn(td, uap) regs->tf_eflags = eflags; return (EJUSTRETURN); } -#endif int sigreturn(td, uap) diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c index aeb61c9..63a24ff 100644 --- a/sys/pc98/pc98/machdep.c +++ b/sys/pc98/pc98/machdep.c @@ -600,7 +600,6 @@ sendsig(catcher, sig, mask, code) * make sure that the user has not modified the * state to gain improper privileges. */ -#ifdef COMPAT_43 int osigreturn(td, uap) struct thread *td; @@ -711,7 +710,6 @@ osigreturn(td, uap) regs->tf_eflags = eflags; return (EJUSTRETURN); } -#endif int sigreturn(td, uap) diff --git a/sys/powerpc/aim/machdep.c b/sys/powerpc/aim/machdep.c index 9a79ad8..c93d5e3 100644 --- a/sys/powerpc/aim/machdep.c +++ b/sys/powerpc/aim/machdep.c @@ -723,15 +723,17 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) return; } -#ifdef COMPAT_43 +/* + * Stub to satisfy the reference to osigreturn in the syscall table. This + * is needed even for newer arches that don't support old signals because + * the syscall table is machine-independent. + */ int osigreturn(struct thread *td, struct osigreturn_args *uap) { - /* XXX: To be done */ - return(ENOSYS); + return (nosys(td, (struct nosys_args *)uap)); } -#endif int sigreturn(struct thread *td, struct sigreturn_args *uap) diff --git a/sys/powerpc/powerpc/machdep.c b/sys/powerpc/powerpc/machdep.c index 9a79ad8..c93d5e3 100644 --- a/sys/powerpc/powerpc/machdep.c +++ b/sys/powerpc/powerpc/machdep.c @@ -723,15 +723,17 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) return; } -#ifdef COMPAT_43 +/* + * Stub to satisfy the reference to osigreturn in the syscall table. This + * is needed even for newer arches that don't support old signals because + * the syscall table is machine-independent. + */ int osigreturn(struct thread *td, struct osigreturn_args *uap) { - /* XXX: To be done */ - return(ENOSYS); + return (nosys(td, (struct nosys_args *)uap)); } -#endif int sigreturn(struct thread *td, struct sigreturn_args *uap) diff --git a/sys/sparc64/sparc64/machdep.c b/sys/sparc64/sparc64/machdep.c index ebeb5d7..8e0d578 100644 --- a/sys/sparc64/sparc64/machdep.c +++ b/sys/sparc64/sparc64/machdep.c @@ -446,6 +446,18 @@ sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) PROC_LOCK(p); } +/* + * Stub to satisfy the reference to osigreturn in the syscall table. This + * is needed even for newer arches that don't support old signals because + * the syscall table is machine-independent. + */ +int +osigreturn(struct thread *td, struct osigreturn_args *uap) +{ + + return (nosys(td, (struct nosys_args *)uap)); +} + #ifndef _SYS_SYSPROTO_H_ struct sigreturn_args { ucontext_t *ucp; -- cgit v1.1