diff options
author | marcel <marcel@FreeBSD.org> | 1999-09-29 15:03:48 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 1999-09-29 15:03:48 +0000 |
commit | d5e8d714b93b1824409b762780bec45541995276 (patch) | |
tree | 6c8b2043aa3edb629a1ac31d0703f667667a8072 /sys/nfsserver | |
parent | a77a86a32324d1cd4c2f1b3055c97e6bc066a6eb (diff) | |
download | FreeBSD-src-d5e8d714b93b1824409b762780bec45541995276.zip FreeBSD-src-d5e8d714b93b1824409b762780bec45541995276.tar.gz |
sigset_t change (part 2 of 5)
-----------------------------
The core of the signalling code has been rewritten to operate
on the new sigset_t. No methodological changes have been made.
Most references to a sigset_t object are through macros (see
signalvar.h) to create a level of abstraction and to provide
a basis for further improvements.
The NSIG constant has not been changed to reflect the maximum
number of signals possible. The reason is that it breaks
programs (especially shells) which assume that all signals
have a non-null name in sys_signame. See src/bin/sh/trap.c
for an example. Instead _SIG_MAXSIG has been introduced to
hold the maximum signal possible with the new sigset_t.
struct sigprop has been moved from signalvar.h to kern_sig.c
because a) it is only used there, and b) access must be done
though function sigprop(). The latter because the table doesn't
holds properties for all signals, but only for the first NSIG
signals.
signal.h has been reorganized to make reading easier and to
add the new and/or modified structures. The "old" structures
are moved to signalvar.h to prevent namespace polution.
Especially the coda filesystem suffers from the change, because
it contained lines like (p->p_sigmask == SIGIO), which is easy
to do for integral types, but not for compound types.
NOTE: kdump (and port linux_kdump) must be recompiled.
Thanks to Garrett Wollman and Daniel Eischen for pressing the
importance of changing sigreturn as well.
Diffstat (limited to 'sys/nfsserver')
-rw-r--r-- | sys/nfsserver/nfs.h | 6 | ||||
-rw-r--r-- | sys/nfsserver/nfs_srvsock.c | 9 | ||||
-rw-r--r-- | sys/nfsserver/nfsrvstats.h | 6 |
3 files changed, 14 insertions, 7 deletions
diff --git a/sys/nfsserver/nfs.h b/sys/nfsserver/nfs.h index efdb607..296e34f 100644 --- a/sys/nfsserver/nfs.h +++ b/sys/nfsserver/nfs.h @@ -326,8 +326,10 @@ struct uio; struct buf; struct vattr; struct nameidata; /* XXX */ * such as SIGALRM will not expect file I/O system calls to be interrupted * by them and break. */ -#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ - sigmask(SIGHUP)|sigmask(SIGQUIT)) +#define NFSINT_SIGMASK(set) \ + (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \ + SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \ + SIGISMEMBER(set, SIGQUIT)) /* * Socket errors ignored for connectionless sockets?? diff --git a/sys/nfsserver/nfs_srvsock.c b/sys/nfsserver/nfs_srvsock.c index 0059c51..9434fb9 100644 --- a/sys/nfsserver/nfs_srvsock.c +++ b/sys/nfsserver/nfs_srvsock.c @@ -55,6 +55,7 @@ #include <sys/syslog.h> #include <sys/tprintf.h> #include <sys/sysctl.h> +#include <sys/signalvar.h> #include <netinet/in.h> #include <netinet/tcp.h> @@ -1501,14 +1502,16 @@ nfs_sigintr(nmp, rep, p) struct nfsreq *rep; register struct proc *p; { + sigset_t tmpset; + tmpset = p->p_siglist; + SIGSETNAND(tmpset, p->p_sigmask); + SIGSETNAND(tmpset, p->p_sigignore); if (rep && (rep->r_flags & R_SOFTTERM)) return (EINTR); if (!(nmp->nm_flag & NFSMNT_INT)) return (0); - if (p && p->p_siglist && - (((p->p_siglist & ~p->p_sigmask) & ~p->p_sigignore) & - NFSINT_SIGMASK)) + if (p && SIGNOTEMPTY(p->p_siglist) && NFSINT_SIGMASK(tmpset)) return (EINTR); return (0); } diff --git a/sys/nfsserver/nfsrvstats.h b/sys/nfsserver/nfsrvstats.h index efdb607..296e34f 100644 --- a/sys/nfsserver/nfsrvstats.h +++ b/sys/nfsserver/nfsrvstats.h @@ -326,8 +326,10 @@ struct uio; struct buf; struct vattr; struct nameidata; /* XXX */ * such as SIGALRM will not expect file I/O system calls to be interrupted * by them and break. */ -#define NFSINT_SIGMASK (sigmask(SIGINT)|sigmask(SIGTERM)|sigmask(SIGKILL)| \ - sigmask(SIGHUP)|sigmask(SIGQUIT)) +#define NFSINT_SIGMASK(set) \ + (SIGISMEMBER(set, SIGINT) || SIGISMEMBER(set, SIGTERM) || \ + SIGISMEMBER(set, SIGHUP) || SIGISMEMBER(set, SIGKILL) || \ + SIGISMEMBER(set, SIGQUIT)) /* * Socket errors ignored for connectionless sockets?? |